Ordinary Differential Equations (ODE)#

An ODEProblem represents a first order ordinary differential equation (ODE) with a given state at an initial time. This ODEProblem is built with a function of time and state, as well as an array describing the initial state, and a time interval.

An ODEResult represents the solution of an ODE evaluated at a discrete set of times within the specified time interval.

Note

This feature is under active development. Future iterations include the integration of ODEProblem s with Discipline.

Architecture#

ODEProblem and ODEResult#

The main classes in the ODE submodule are the ODEProblem and ODEResult. These represent respectively the first-order ODE with its initial conditions, and the solution of this problem evaluated at a discrete set of values for time.

As a reminder, a first-order ordinary differential equation is an equation of the form:

\[\frac{ds}{dt}(t) = f(t, s(t)) \ \textrm{ and }\ s(t_0) = s_0\]

where \(s\) is the state which depends on \(t\), the time. The right-hand side function \(f\) is a function of the time and the state. The value of the state at an initial time \(t_0\) is known to be \(s_0\).

The solution of this problem is provided for discrete values of time within a given interval \([t_0,\ t_f]\).

@startuml
set namespaceSeparator none
class "ODEProblem" as gemseo.algos.ode.ode_problem.ODEProblem {
rhs_function
initial_state
initial_time
final_time
algorithm_name
}
class "ODEResult" as gemseo.algos.ode.ode_result.ODEResult {
state_vector
time_vector
is_converged
}

gemseo.algos.ode.ode_problem.ODEProblem *-- gemseo.algos.ode.ode_result.ODEResult : result
@enduml

../_images/ODEProblem_ODEResult_attributes_description.png

Correspondence between the elements of an ordinary differential equation with initial conditions and the attributes of the ODEProblem and ODEResult classes.#

Classes#

The classes described by the ODE module are as such:

Packages#

The submodules are organized in the following fashion.

@startuml packages
set namespaceSeparator none
package "gemseo.algos.ode" as gemseo.algos.ode {
}
package "gemseo.algos.ode.scipy_ode.scipy_ode" as gemseo.algos.ode.scipy_ode.scipy_ode {
}
package "gemseo.algos.ode.ode_problem" as gemseo.algos.ode.ode_problem {
}
package "gemseo.algos.ode.ode_result" as gemseo.algos.ode.ode_result {
}
package "gemseo.algos.ode.base_ode_solver_library" as gemseo.algos.ode.base_ode_solver_library {
}
package "gemseo.algos.ode.factory" as gemseo.algos.ode.factory {
}
gemseo.algos.ode.scipy_ode.scipy_ode --> gemseo.algos.ode.ode_result
gemseo.algos.ode.scipy_ode.scipy_ode --> gemseo.algos.ode.base_ode_solver_library
gemseo.algos.ode.ode_problem --> gemseo.algos.ode.ode_result
gemseo.algos.ode.base_ode_solver_lib --> gemseo.algos.ode.ode_problem
gemseo.algos.ode.factory --> gemseo.algos.ode.ode_problem
gemseo.algos.ode.factory --> gemseo.algos.ode.base_ode_solver_library
@enduml