integrators
Class BackwardEulerIntegrator
java.lang.Object
integrators.Integrator
integrators.BackwardEulerIntegrator
- public class BackwardEulerIntegrator
- extends Integrator
BackwardEulerIntegrator is a custom-modified backward Euler method
with simple-minded adaptive stepsizing that exploits the same partially
explicit corrector formula as the SemiExplicitAPCIntegrator. Basically
it makes an estimate of y(t+h) by first making such an estimate with
the forward Euler step y(t+h) = y(t) + hf(y(t)), then using that estimate
to calculate the backward Euler step y(t+h) = y(t) + hf(y(t+h)), then
iterating the backward step to convergence. At high accuracy (<10E-4)
this is usually much slower than a higher-order method; however, since
it is "guaranteed" to be stable at low accuracy (10E-2 or even 10E-1) it
can often take much bigger steps than other methods, especially if the
parameters are such as to render the equations relatively stiff... of
course they are still low-accuracy steps.
Method Summary |
protected void |
getFhatAndDfdyi(NodeValues[] fhat_vals,
NodeValues[] dfdyi_vals)
|
void |
init(Model model)
Any object planning to use an Integrator of any kind MUST call its
init(Model) method, which (among other things) is generally used to allocate
storage arrays for the intermediates in an integration method. |
float |
IntegrateOneStep()
Integrates across a single time step. |
void |
reset()
Should be called after the Integrator has crossed an entire interval. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BackwardEulerIntegrator
public BackwardEulerIntegrator()
init
public void init(Model model)
- Description copied from class:
Integrator
- Any object planning to use an Integrator of any kind MUST call its
init(Model) method, which (among other things) is generally used to allocate
storage arrays for the intermediates in an integration method. This method
does NOT do any numerics so does not depend on the state of the model, but
it DOES need to be called after the model has been properly populated with
Cells and Nodes, and needs to be called again if these change.
- Overrides:
init
in class Integrator
reset
public void reset()
- Description copied from class:
Integrator
- Should be called after the Integrator has crossed an entire interval.
The base class does nothing; typical subclasses will override Integrator.reset()
to reset the time step size to the default value. This method is NOT used to
reallocate storage; that requires a call to init().
- Overrides:
reset
in class Integrator
IntegrateOneStep
public float IntegrateOneStep()
- Description copied from class:
Integrator
- Integrates across a single time step. Return value is the size of the
timestep, which may differ from that specified by the calling method if the
Integrator subclass adapts the step size to match error requirements.
- Overrides:
IntegrateOneStep
in class Integrator
getFhatAndDfdyi
protected void getFhatAndDfdyi(NodeValues[] fhat_vals,
NodeValues[] dfdyi_vals)