(attach-handler integrator observe step-size initial-state)
We implement the observation callback by adding a StepHandler to the integration. The StepHandler is not invoked at every grid point; rather, it is invoked once in a while over a range of time within which the integrated function may be accurately evaluated. The handler we install does this, invoking the callback for each requested grid point within the valid range, ensuring that we also invoke the callback for the final point.
We implement the observation callback by adding a StepHandler to the integration. The StepHandler is not invoked at every grid point; rather, it is invoked once in a while over a range of time within which the integrated function may be accurately evaluated. The handler we install does this, invoking the callback for each requested grid point within the valid range, ensuring that we also invoke the callback for the final point.
(evolve state-derivative & state-derivative-args)
evolve takes a state derivative function constructor and its arguments, and returns an integrator via make-integrator.
In particular, the returned function accepts a callback function which will be invoked at intermediate grid points of the integration.
evolve takes a state derivative function constructor and its arguments, and returns an integrator via make-integrator. In particular, the returned function accepts a callback function which will be invoked at intermediate grid points of the integration.
(integrate-state-derivative state-derivative
state-derivative-args
initial-state
t1
dt)
A wrapper for evolve, which is more convenient when you just want a vector of (time, state) pairs over the integration interval instead of having to deal with a callback. Integrates the supplied state derivative (and its argument package) from [0 to t1] in steps of size dt
A wrapper for evolve, which is more convenient when you just want a vector of (time, state) pairs over the integration interval instead of having to deal with a callback. Integrates the supplied state derivative (and its argument package) from [0 to t1] in steps of size dt
(integration-opts state-derivative
derivative-args
initial-state
{:keys [compile? epsilon] :or {epsilon 1.0E-8}})
Returns a map with the following kv pairs:
:integrator
an instance of GraggBulirschStoerIntegrator:equations
instance of FirstOrderDifferentialEquations:dimension
the total number of entries in the flattened initial state tuple:stopwatch
IStopwatch instance that records total evaluation time inside
the derivative function:counter
an atom containing a Long that increments every time derivative fn
is called.Returns a map with the following kv pairs: - `:integrator` an instance of GraggBulirschStoerIntegrator - `:equations` instance of FirstOrderDifferentialEquations - `:dimension` the total number of entries in the flattened initial state tuple - `:stopwatch` IStopwatch instance that records total evaluation time inside the derivative function - `:counter` an atom containing a Long that increments every time derivative fn is called.
(make-integrator state-derivative derivative-args)
make-integrator takes a state derivative function (which in this system is assumed to be a map from a structure to a structure of the same shape, as differentiating a function does not change its shape), and returns an integrator, which is a function of several arguments: the initial state, an intermediate-state observation function, the step size desired, the final time to seek, and an error tolerance. If the observe function is not nil, it will be invoked with the time as first argument and integrated state as the second, at each intermediate step.
make-integrator takes a state derivative function (which in this system is assumed to be a map from a structure to a structure of the same shape, as differentiating a function does not change its shape), and returns an integrator, which is a function of several arguments: the initial state, an intermediate-state observation function, the step size desired, the final time to seek, and an error tolerance. If the observe function is not nil, it will be invoked with the time as first argument and integrated state as the second, at each intermediate step.
(state-advancer state-derivative & state-derivative-args)
state-advancer takes a state derivative function constructor followed by the arguments to construct it with. The state derivative function is constructed and an integrator is produced which takes:
as arguments. Optionally, supply an options map with these optional fields:
:compile?
: If true, the ODE solver will compile your state function.
:epsilon
: The maximum error tolerance allowed by the ODE solver, both
relative and absolute.
Returns the final state.
The state derivative is expected to map a structure to a structure of the same shape, and is required to have the time parameter as the first element.
state-advancer takes a state derivative function constructor followed by the arguments to construct it with. The state derivative function is constructed and an integrator is produced which takes: - initial state - target time as arguments. Optionally, supply an options map with these optional fields: `:compile?`: If true, the ODE solver will compile your state function. `:epsilon`: The maximum error tolerance allowed by the ODE solver, both relative and absolute. Returns the final state. The state derivative is expected to map a structure to a structure of the same shape, and is required to have the time parameter as the first element.
(step-handler observe step-size initial-state)
Generates a StepHandler instance that can be attached to an integrator.
When used as an observation callback, the StepHandler
is not invoked at
every grid point; rather, it is invoked once in a while over a range of time
within which the integrated function may be accurately evaluated. The handler
we install does this, invoking the callback for each requested grid point
within the valid range, ensuring that we also invoke the callback for the
final point.
Generates a StepHandler instance that can be attached to an integrator. When used as an observation callback, the `StepHandler` is not invoked at every grid point; rather, it is invoked once in a while over a range of time within which the integrated function may be accurately evaluated. The handler we install does this, invoking the callback for each requested grid point within the valid range, ensuring that we also invoke the callback for the final point.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close