\(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\R}[1]{ {\rm #1} }\)
an_ode¶
View page sourceAn ODE Solution¶
ODE¶
Parameter Vector¶
We refer to \(x\) as the parameter vector in the ode.
Initial Value¶
Solution¶
This initial value problem has the following analytic solution (which can be used to check function values and derivatives):
Algorithm¶
The rk4_step method is used to approximate the solution for \(y(t)\) at \(t = 2\) . Note that this approximation has no truncation error for \(i < 4\) .
option¶
This algorithm uses the n_arg and n_other options; see below:
n_arg¶
This is the size of the vectors x and y above . There is an assert checking that n_arg > 0.
n_other¶
This is the number of Runge-Kutta steps used to approximate the solution of the ODE \(y(t)\) . There is an assert checking that n_other > 0.
Implementation¶
rk4_step , cpp_an_ode , py_an_ode .
Derivative¶
The partial of \(y_i (t)\) with respect to \(x_j\) is