|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Solver2
This class is an interface for differents numerical integration methods of first order differential equations system. The implementation of a solver could be done writing:
... public MyODESolver implements DerivableFunction2 { ... RVector x0 = new RVector(n); RVector y0 = new RVector(n); // Creating the solver Solver2 mySolver = Euler2(0.1, // time interval integration x0, // initial condition position y0, // initial condition velocity this // function xDot2 is passed to Solver ); ... // integration at time t+dt of x'' = f(x, y) implemented by xDot2(x, y) function - y=x' mySolver.step(x_t, y_t); // current time integration t_dt = mySolver.getTime(); // current integrated value x_dt = mySolver.getLastValuePosition(); y_dt = mySolver.getLastValueVelocity(); ... // implementation of x'' = f(x, x') y= x'; public RVector xDot2(RVector x, RVector y) { ... // code to calculate x'' = f(x, y) ... return xdot2; } }
Field Summary | |
---|---|
static double |
startTime
|
Method Summary | |
---|---|
RVector |
getInitialConditionPosition()
Gets the initial condition for position x(0). |
RVector |
getInitialConditionVelocity()
Gets the initial condition for velocity x'(0). |
RVector |
getLastValuePosition()
Gets the current value of position x computed by step function. |
RVector |
getLastValueVelocity()
Gets the current value of velocity x'computed by step function. |
double |
getSampleTime()
Gets the interval of integration. |
double |
getTime()
Gets current time of integration. |
void |
resetTime()
Sets the current time to zero. |
void |
setInitialConditionPosition(RVector initialCondition)
Sets the initial condition for position x(0) = x0. |
void |
setInitialConditionVelocity(RVector initialCondition)
Sets the initial condition for velocity x'(0) = y0. |
void |
setSampleTime(double dt)
Sets the interval of integration. |
void |
setTargetFunction(DerivableFunction2 target)
Sets the target function to be integrated |
void |
step(RVector position,
RVector velocity)
Computes step integration from time t to t+dt of x'' = f(x, x'). |
Field Detail |
---|
static final double startTime
Method Detail |
---|
void setSampleTime(double dt)
dt
- interval [sec]double getSampleTime()
double getTime()
void resetTime()
void setInitialConditionPosition(RVector initialCondition)
initialCondition
- RVector getInitialConditionPosition()
RVector getLastValuePosition()
step
function.
void setInitialConditionVelocity(RVector initialCondition)
initialCondition
- RVector getInitialConditionVelocity()
RVector getLastValueVelocity()
step
function.
void setTargetFunction(DerivableFunction2 target)
target
- the function.void step(RVector position, RVector velocity)
position
- x argument of f(x, x')velocity
- x' argument of f(x, x')
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |