Initial value problems

General initial value problems

The considered initial value problems are stated as a system of first-order ordinary differential equations defined via a function \(f\) together with an initial condition \(x_0\):

\[\begin{split}\begin{aligned} \dot{x} &= X(x) \\ x(0) &= x_0 \,. \end{aligned}\end{split}\]

Here, \(x\) is a function of time which takes values in the state space \(\mathcal{X} = \mathbb{R}^n\), for some \(n \in \mathbb{N}\). The right hand side \(X \colon \mathcal{X} \rightarrow \mathcal{X}\) defines a vector field on \(\mathcal{X}\) since for a flat state space \(T \mathcal{X} \cong \mathcal{X}\).

Initial value problems are defined using the IVP container type:

class example_gni_project.IVP(variables, vector_field, initial_condition)

Type defining an initial value problem.

variables

names of the state variables

Type:

tuple of strings (used for plotting)

vector_field

right hand side of the ODE

Type:

function

initial_condition

initial condition

Type:

np.ndarray

Initial value problems with Hamiltonian structure

The symplectic methods preserve the canonical Hamiltonian structure of initial value problems of the form

\[\begin{split}\begin{aligned} \begin{bmatrix} \dot{q} \\ \dot{p} \end{bmatrix} &= \begin{bmatrix} 0 & 1 \\ -1 & 0 \end{bmatrix} \, \begin{bmatrix} \frac{\partial H(q, p)}{\partial q} \\ \frac{\partial H(q, p)}{\partial p} \end{bmatrix} = \begin{bmatrix} +\frac{\partial H(q, p)}{\partial q} \\ -\frac{\partial H(q, p)}{\partial p} \end{bmatrix} \\ \begin{bmatrix} q(0) \\ p(0) \end{bmatrix} &= \begin{bmatrix} q_0 \\ p_0 \end{bmatrix} \,. \end{aligned}\end{split}\]

Here \(H \colon \mathcal{X} \rightarrow \mathbb{R}\) is the Hamiltonian which yields the sum of the kinetic energy and the potential energy of the system.