Generalized Modal Analysis (GMA) routines for solving 1-D generalized mode. A Generalized 1-D Mode is constructed by starting with a curve in the ODE solution space where the points on the curve are taken as ODE initial conditions (t=0). The evolution of the curve is found by solving each point on the curve, and using t as the evolution parameter. So for example, the curve is carried by the vector field, and results in a new curve at t=1 (or any other number).
Copyright 2012, Lance Larsen Licensed under the MIT license
Uses ODE.js
GMAmode class | Generalized Modal Analysis (GMA) routines for solving 1-D generalized mode. |
GMAmode | Creates a new GMA model object. |
Functions | |
GMAmode | Creates a new GMAmode object. |
setnContours | Set the number of contours to retrieve from getContours. |
solve | Calculate the evolution of the modal curve. |
tinit | This is called after the odes are solved to set up the t array, which is a complete array of timestep values. |
getStep4t | Get the step count associated with the time t. |
getStepIterator | Iterates through the solution points skipping values as indicated in ‘opt’. |
getContour | Get the generalized mode contour. |
getContours | Push GMA contours onto an array. |
getSolution | Gets one of the ODE solutions used to calculate the generalized mode evolution. |
getSolutions | Push a set of ODE solutions onto an array. |
setLimit | Add a limit function that is used to bound the ODE solution points that are retained. |
Global | Globally scoped functions |
Functions | |
defaultFactory | The default contour or solution factory just returns the object passed in. |
Creates a new GMA model object. Solve is called automatically to calculate the modal solution.
Functions | |
GMAmode | Creates a new GMAmode object. |
setnContours | Set the number of contours to retrieve from getContours. |
solve | Calculate the evolution of the modal curve. |
tinit | This is called after the odes are solved to set up the t array, which is a complete array of timestep values. |
getStep4t | Get the step count associated with the time t. |
getStepIterator | Iterates through the solution points skipping values as indicated in ‘opt’. |
getContour | Get the generalized mode contour. |
getContours | Push GMA contours onto an array. |
getSolution | Gets one of the ODE solutions used to calculate the generalized mode evolution. |
getSolutions | Push a set of ODE solutions onto an array. |
setLimit | Add a limit function that is used to bound the ODE solution points that are retained. |
Creates a new GMAmode object.
opt | An object with the following properites |
opt.V | The vector field or ODE |
opt.steps | The number of steps to solve for each point on initial modal curve |
opt.dt | The timestep for each step |
opt.t | The initial time value |
opt.pts | The initial mode curve |
opt.ncontours | Number of contours to return from getContours. Initializes this.ncontours and this.last_index. (Default: 6) |
opt.contourOffset | The ode index offset to the first contour. Initializes this.ctrOffset and this.last_index. (Default: 0) |
opt.contourTotalSteps | The total number of ode steps over the contour range. Initializes this.contourTotalSteps. (Default: this.steps - opt.contourOffset) |
opt.limit | (Optional) A limit function used to indicate when to bound the solution. The function should take a point and indicate true if the point is within the bounds, or false if it is not. |
opt.contourFactory | (Optional) factory used to process contour objects. The function form is ‘contourFactory(gmaobj, stepn, contour)’ where gmaobj is this object, stepn is the stepn is index used to get the points, and contour is a object with ‘data’ holding the contour data. |
opt.solutionFactory | (Optional) factory used to process solutions that are returned from getSolution. The function form is ‘solutionFactory(gmaobj, stepn, contour)’ |
Set the number of contours to retrieve from getContours.
opt | Object to hold the parameters. All are optional. |
opt.ncontours | Number of contours to return from getContours. Initializes this.ncontours and this.last_index. |
opt.contourOffset | The ode index offset to the first contour. Initializes this.ctrOffset and this.last_index. |
opt.contourTotalSteps | The total number of ode steps over the contour range. Initializes this.contourTotalSteps. |
Calculate the evolution of the modal curve. The optional parameters are not needed if solve is called more than once. Calling solve without the optional parameters extends the solution.
steps | The number of steps to solve for each point on initial mode curve |
dt | The timestep for each step |
t | (Optional) The initial time value |
pts | (Optional)The initial mode curve |
limit | (Optional)A limit function used to indicate when to bound the solution. The function should take a point and indicate true if the point is within the bounds, or false if it is not. |
Iterates through the solution points skipping values as indicated in ‘opt’.
opt | (Optional) Object with the following input fields |
opt.nCurves | The number of modal or solution curves to extract. Default is 6. |
opt.offset | The offset to the first index to use. |
opt.totalSteps | The last step to use as a modal curve. The default is the number of solve steps. |
Get the generalized mode contour.
stepn | The ODE step that is associated with the the contour. |
raw | Returns the result without passing it through the contourFactory. |
A contour generated by the contourFactory function that was passed to the constructor. The contourFactory function is called as ‘contourFactory(gmaobj, stepn, contour)’, where contour contain the fields ‘t’ and ‘pts’ where ‘t’ is a parameter array, and ‘pts’ are the contour points.
Push GMA contours onto an array.
arry | An array to push contours onto using ‘arry.push(value)’ |
opt | Options used by GMAmode.getStepIterator. |
Gets one of the ODE solutions used to calculate the generalized mode evolution.
idx | The index of the ODE solution to get. |
raw | Returns the result without passing it through the solutionFactory. |
A value as returned by the solutionFactory. The solution factory is called as solutionFactory(gmaobj, stepn, contour) as defined in
Push a set of ODE solutions onto an array.
arry | The array to add solutions to using ‘arry.push(soln)’ |
opt | Options used by GMAmode.getStepIterator for selecting the set of solutions. |
Globally scoped functions
Functions | |
defaultFactory | The default contour or solution factory just returns the object passed in. |
The default contour or solution factory just returns the object passed in.
gmaobj | The GMAmode object that the contour is associated with. |
stepn | The index used when getting the modal contour. |
contour | An object with field ‘t’ and ‘pts’. Both are arrays of the same size, with ‘t’ being the parameter value, and ‘pts’ the associated ODE solution points. |
This simply returns the contour (or solution) value that is passed in without modification.