Example Models

Lotka-Volterra

Contains an implementation of the Lotka Volterra model.

An implementation of a Lotka Volterra example model.

class calisim.example_models.lotka_volterra.LotkaVolterraModel[source]

Lotka Volterra simulation model.

get_observed_data() ndarray | DataFrame[source]

Retrieve observed data.

Returns:

The observed data.

Return type:

np.ndarray | pd.DataFrame

simulate(parameters: dict) ndarray | DataFrame[source]

Run the simulation.

Parameters:

parameters (dict) – The simulation parameters.

Returns:

The simulated data.

Return type:

np.ndarray | pd.DataFrame

SIR Ordinary Differential Equations

Contains an implementation of an SIR epidemiological model.

An implementation of an SIR epidemiological example model.

class calisim.example_models.sir_ode.SirOdeModel[source]

SIR ODE model.

get_observed_data() ndarray | DataFrame[source]

Retrieve observed data.

Returns:

The observed data.

Return type:

np.ndarray | pd.DataFrame

simulate(parameters: dict) ndarray | DataFrame[source]

Run the simulation.

Parameters:

parameters (dict) – The simulation parameters.

Returns:

The simulated data.

Return type:

np.ndarray | pd.DataFrame

Lorenz 95

Contains an implementation of a Lorenz95 model.

An implementation of a Lorenz95 example model.

class calisim.example_models.lorenz_95.Lorenz95[source]

The Lorenz95 model.

get_observed_data() ndarray | DataFrame[source]

Retrieve observed data.

Returns:

The observed data.

Return type:

np.ndarray | pd.DataFrame

lorenz95(x: ndarray, F: float) ndarray[source]

The Lorenz 95 model.

Parameters:
  • x (np.ndarray) – The input data.

  • F (float) – The force.

Returns:

The simulation output.

Return type:

np.ndarray

rk4_step(x: ndarray, F: float, dt: float) ndarray[source]

Runge-Kutta 4th order integration.

Parameters:
  • x (np.ndarray) – The input data.

  • F (float) – The force.

  • dt (float) – Rate of change over time.

Returns:

The integrated values.

Return type:

np.ndarray

simulate(parameters: dict) ndarray | DataFrame[source]

Run the simulation.

Parameters:

parameters (dict) – The simulation parameters.

Returns:

The simulated data.

Return type:

np.ndarray | pd.DataFrame

Anharmonic Oscillator

Contains an implementation of the anharmonic oscillator model.

An implementation of an anharmonic oscillator example model.

class calisim.example_models.anharmonic_oscillator.AnharmonicOscillator[source]

Anharmonic oscillator simulation model.

get_df() DataFrame[source]

Get the simulation dataframe.

Returns:

The simulation dataframe.

Return type:

pd.DataFrame

get_observed_data() ndarray | DataFrame[source]

Retrieve observed data.

Returns:

The observed data.

Return type:

np.ndarray | pd.DataFrame

reset_y() None[source]

Reset the trajectory vector.

simulate(parameters: dict) ndarray | DataFrame[source]

Run the simulation.

Parameters:

parameters (dict) – The simulation parameters.

Returns:

The simulated data.

Return type:

np.ndarray | pd.DataFrame

step(parameters: dict) None[source]

Run the model for one time step.

Parameters:

parameters (dict) – The simulation parameters.