ploonetide.numerical.Simulation

class ploonetide.numerical.Simulation(variables)[source]

Bases: object

Build and run a simulation.

Parameters:

variables (list) – List of Variable instances

__init__(variables)[source]

Methods

__init__(variables)

run(t, dt[, t0, jacobian, show_progress])

Run the simulation.

set_diff_eq(calc_diff_eqs, params, ...)

Set the differential equation function.

set_integration_method([method])

Set the integration method.

Attributes

run(t, dt, t0=0.0, jacobian=None, show_progress=False)[source]

Run the simulation.

Parameters:
  • t (float) – Final time

  • dt (float) – Timestep

  • t0 (float) – Initial time (default 0.0)

  • show_progress (bool) – Show a progress bar for the integration.

set_diff_eq(calc_diff_eqs, params, ini_conds, events)[source]

Set the differential equation function.

Parameters:
  • calc_diff_eqs – Callable returning dy/dt

  • **kwargs – Additional arguments passed to the function

set_integration_method(method='RK45')[source]

Set the integration method.

Parameters:

method (str) – Integration method name.

supported_integration_methods = ('RK45', 'RK23', 'DOP853', 'Radau', 'BDF', 'LSODA')