multimodemodel.integrate#
- multimodemodel.integrate(initial_state, params, RHS, scheme=<multimodemodel.api.integration.TimeSteppingFunctionBase object>, step=1.0, time=3600.0)[source]#
Integrate a system of differential equations.
Generator which can be iterated over to produce new time steps.
- Parameters:
initial_state (
State) – Initial conditions of the prognostic variables.params (
Parameters) – Parameters of the governing equations.RHS (
Callable[[State,Parameters],State]) – Function defining the set of equations to integrate.scheme (
TimeSteppingScheme, defaultadams_bashforth3) – Time integration scheme to usestep (
float, default1.0) – Length of time steptime (
float, default3600.0) – Integration time. Will be reduced to the next integral multiple of step
- Yields:
State– Next time step.
Example
Integrate the set of linear shallow water equations:
>>> integrator = integrate(init_state, params, linearised_swe, step=1., time=10e4) >>> for next_state in integrator: ... pass