Class Index | File Index

Classes


Built-In Namespace _global_

Field Summary
Field Attributes Field Name and Description
 
constant
 
constant
 
constant
 
constant
 
constant
 
constant
 
constant
 
constant
 
constant
 
constant
 
constant
 
constant ( = 1e-8)
 
X
constant ( = 0 )
 
Y
constant ( = 1 )
 
Z
constant ( = 2 )
Method Summary
Method Attributes Method Name and Description
 
eigSolve(K, M, nEigModes, method, maxiter)
Eigenvalues and eigenvectors solver.
 
eye(nRows)
Alias for dentity(), see identity
 
identity(nRows)
Returned identity matrix of given size, see Matrix#Identity
 
linSolve(a, rhs, saveOrig, method, precompDecomps)
Linear system equation solver.
 
mat(arry)
Returns new Matrix object from given array
 
ones(nRows, nCols)
Returns new Vector or Matrix full of given size full of ones
 
range(a, b, c)
Returns sequence (array) with start, stop, step.
 
vec(arry)
Returns new Vector object from given array
 
zeros(nRows, nCols)
Returns new Vector or Matrix full of given size full of zeros
Field Detail
JSM_CHOLESKY
constant
Defined in: jsmatrix.src.js.

JSM_FULLPIVOT
constant
Defined in: jsmatrix.src.js.

JSM_GAUSS
constant
Defined in: jsmatrix.src.js.

JSM_GAUSSJORDAN
constant
Defined in: jsmatrix.src.js.

JSM_INV_IT
constant
Defined in: jsmatrix.src.js.

JSM_LDU
constant
Defined in: jsmatrix.src.js.

JSM_LU
constant
Defined in: jsmatrix.src.js.

JSM_NOPIVOT
constant
Defined in: jsmatrix.src.js.

JSM_PARTPIVOT
constant
Defined in: jsmatrix.src.js.

JSM_QR
constant
Defined in: jsmatrix.src.js.

JSM_SUBSPACE
constant
Defined in: jsmatrix.src.js.

JSM_TOL
constant ( = 1e-8)
Defined in: jsmatrix.src.js.

X
constant ( = 0 )
Defined in: jsmatrix.src.js.

Y
constant ( = 1 )
Defined in: jsmatrix.src.js.

Z
constant ( = 2 )
Defined in: jsmatrix.src.js.
Method Detail
{[[floats]|[Vectors]]} eigSolve(K, M, nEigModes, method, maxiter)
Eigenvalues and eigenvectors solver. Returns first nEigModes eigenvales and eigenvectors of problem K*vi=oi^2*M*vi (oi is i-th eigenvale and vi is i-th eigenvector). Typycal example of usage is eigenvale dynamics.
Defined in: jsmatrix.src.js.
K = mat([[9,3,0,0],[3,8,2,0],[0,2,7,2],[0,0,2,8]]);
M = Matrix.Diagonal([3,2,4,3]);
e = eigSolve(K,M,4);
o = e[0];
v = e[1];
o1 = o[0]; // o1 = 1.2504038497315775
o2 = o[1]; // o2 = 2.279120228657416
o3 = o[2]; // o3 = 2.948867853467429
o4 = o[3]; // o4 = 4.938274734810245
v1 = v[0]; // v1 = Vector([ 0.1288306767139194, -0.22540165581364102, 0.4265175098731745, -0.20077135620035116 ])
v2 = v[1]; // v2 = Vector([ 0.4514687335612619, -0.32545467450354726, -0.11713473474653795, 0.2014979513549984 ])
v3 = v[2]; // v3 = Vector([ 0.14681878659487543, -0.007507144503266177, -0.21233717286242818, -0.5016212772448967 ])
v4 = v[3]; // v4 = Vector([ 0.3022519091588433, 0.585847242190032, 0.09630780190740544, 0.028264211960396433 ])
c1 = K.x(v1).sub(M.x(v1).x(o1)); // c1 = Vector([ 6.045241529584189e-10, -2.9052349415081835e-10, -2.091367079515294e-10, 2.697864154299623e-10 ])
c2 = K.x(v2).sub(M.x(v2).x(o2)); // c2 = Vector([ 8.74326433475403e-9, -4.933693453779142e-10, -1.5765841965276195e-8, -2.9551703084607084e-8 ])
c3 = K.x(v3).sub(M.x(v3).x(o3)); // c3 = Vector([ 4.5619911848149286e-8, 1.2227673172604536e-8, -9.32639299122684e-10, 1.3564216416739328e-8 ])
c4 = K.x(v4).sub(M.x(v4).x(o4)); // c4 = Vector([ 9.357854047209457e-9, -3.189910557921394e-10, -1.804510585401431e-8, -3.197205944438508e-8 ])
Parameters:
{Matrix} K
first matrix (stiffness matrix for dynamics)
{Matrix} M
second matrix (mass matrix for dynamics)
{int} nEigModes Optional, Default: 1
number of first eigenvalues and eigenvectors to be returned
{int} method Optional, Default: JSM_INV_IT
method of the solution. JSM_INV_IT stands for Stodola's inverse iterations methods with Gramm-Schmidt orthogonalization
{int} maxiter Optional, Default: 1000
maximum number of iterations
Returns:
{[[floats]|[Vectors]]} [[o1,o2,...,oN],[v1,v2,...,vN]], oi is i-th eigenvale (squared eigenfrequency for dynamics), vi is i-th eigenvector. N = nEigModes

eye(nRows)
Alias for dentity(), see identity
Defined in: jsmatrix.src.js.
Parameters:
nRows

{Matrix} identity(nRows)
Returned identity matrix of given size, see Matrix#Identity
Defined in: jsmatrix.src.js.
m = identity(3); // m = Matrix([[1,0,0],[0,1,0],[0,0,1]])
Parameters:
{int} nRows
number of rows and columns of returned matrix
Returns:
{Matrix} nRows x nRows identity matrix

{Vector|[Vectors]|Matrix} linSolve(a, rhs, saveOrig, method, precompDecomps)
Linear system equation solver. Returns vector x as a solution of a*ret=rhs, see Matrix#solveForRhs for input desription
Defined in: jsmatrix.src.js.
Parameters:
{Matrix} a
{Vector|[Vectors]|Matrix} rhs
{bool} saveOrig Optional, Default: true
{int} method Optional, Default: JSM_GAUSS
{[Matrices]} precompDecomps Optional
Returns:
{Vector|[Vectors]|Matrix} solution x of a*x=rhs

{Matrix} mat(arry)
Returns new Matrix object from given array
Defined in: jsmatrix.src.js.
m = mat([[1,2,3],[4,5,6],[7,8,9]]) // m = Matrix([[1,2,3],[4,5,6],[7,8,9]])
Parameters:
{[floats](2D)} arry Optional, Default: []
array containing matrix elements
Returns:
{Matrix} new Matrix object

{Matrix|Vector} ones(nRows, nCols)
Returns new Vector or Matrix full of given size full of ones
Defined in: jsmatrix.src.js.
m = zeros(2,3); // m = Matrix([[1,1,1],[1,1,1]])
v = zeros(4) // v = Vector([1,1,1,1])
Parameters:
{int} nRows
number of rows of returned object
{int} nCols Optional
if specified, new Matrix of size (nRows,nCols) is returned, new vector of size nRows otherwise
Returns:
{Matrix|Vector} new Matrix or Vector object

{[floats]} range(a, b, c)
Returns sequence (array) with start, stop, step. Inspired by Python syntax
Defined in: jsmatrix.src.js.
r = range(8);     // r = [0,1,2,3,4,5,6,7]
r = range(2,8);   // r = [2,3,4,5,7]
r = range(2,8,2); // r = [2,4,6]
Parameters:
{float|int} a
start/stop (according to b, see example)
{float|int} b Optional
stop
{float|int} c Optional, Default: 1
step
Returns:
{[floats]} array containing given sequence

{Vector} vec(arry)
Returns new Vector object from given array
Defined in: jsmatrix.src.js.
v = vec([1,2,3,4]) // v = Vector([1,2,3,4])
Parameters:
{[floats]} arry Optional, Default: []
array containing vector elements
Returns:
{Vector} new Vector object

{Matrix|Vector} zeros(nRows, nCols)
Returns new Vector or Matrix full of given size full of zeros
Defined in: jsmatrix.src.js.
m = zeros(2,3); // m = Matrix([[0,0,0],[0,0,0]])
v = zeros(4) // v = Vector([0,0,0,0])
Parameters:
{int} nRows
number of rows of returned object
{int} nCols Optional
if specified, new Matrix of size (nRows,nCols) is returned, new vector of size nRows otherwise
Returns:
{Matrix|Vector} new Matrix or Vector object

Documentation generated by JsDoc Toolkit 2.4.0 on Sun Oct 23 2011 11:05:29 GMT+0200 (CEST)