|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Solver
This class is an interface for differents numerical integration methods of first order differential equations. The implementation of a solver could be done writing:
...
public MyODESolver implements DerivableFunction
{
...
RVector x0 = new RVector(n);
// Creating the solver
Solver mySolver = Euler(0.1, // time interval integration
x0, // initial condition
this // function xDot is passed to Solver
);
...
// integration at time t+dt of x' = f(x) implemented by xDot(x) function
x_dt = mySolver.step(x_t);
// current time integration
t_dt = mySolver.getTime();
// current integrated value
x_dt = mySolver.getLastValue();
...
// implementation of x' = f(x)
public RVector xDot(RVector x)
{
...
// code to calculate x' = f(x)
...
return xdot;
}
}
| Field Summary | |
|---|---|
static double |
startTime
|
| Method Summary | |
|---|---|
RVector |
getInitialCondition()
Gets the initial condition for position x(0). |
RVector |
getLastValue()
Gets the current value of position x computed by step function. |
double |
getSampleTime()
Gets the interval of integration. |
double |
getTime()
Gets current time of integration. |
void |
setInitialCondition(RVector initialCondition)
Sets the initial condition for position x(0) = x0. |
void |
setSampleTime(double dt)
Sets the interval of integration. |
void |
step(RVector x)
Computes step integration from time t to t+dt of x' = f(x). |
| Field Detail |
|---|
static final double startTime
| Method Detail |
|---|
void setSampleTime(double dt)
dt - interval [sec]double getSampleTime()
double getTime()
void setInitialCondition(RVector initialCondition)
initialCondition - RVector getInitialCondition()
RVector getLastValue()
step function.
void step(RVector x)
x - argument of f(x)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||