InitialValueProblem¶
-
class
probnum.problems.
InitialValueProblem
(f, t0, tmax, y0, df=None, ddf=None, solution=None)[source]¶ Bases:
object
First order ODE initial value problem.
Compute a function \(y=y(t)\) that solves
\[\dot y(t) = f(t, y(t)), \quad y(t_0) = y_0\]on time-interval \([t_0, t_\text{max}]\). Solved by probabilistic ODE solvers in
probnum.diffeq
.- Parameters
t0 (
float
) – Initial point in time.tmax (
float
) – Final point in time.df (
Optional
[Callable
[[float
,ndarray
],ndarray
]]) – Jacobian of the ODE vector-field \(f=f(t,y)\) with respect to the \(y\) variable.ddf (
Optional
[Callable
[[float
,ndarray
],ndarray
]]) – Hessian of the ODE vector-field \(f=f(t,y)\) with respect to the \(y\) variable.solution (
Optional
[Callable
[[float
,ndarray
],ndarray
]]) – Closed form, analytic solution to the problem. Used for testing and benchmarking.
Examples
>>> def f(t, x): ... return x*(1-x) >>> ivp = InitialValueProblem(f, t0=0., tmax=3., y0=0.1) >>> ivp.t0, ivp.tmax, ivp.y0 (0.0, 3.0, 0.1) >>> np.round(ivp.f(ivp.t0, ivp.y0), 2) 0.09
Attributes Summary
Attributes Documentation
-
ddf
: Optional[Callable[[float, numpy.ndarray], numpy.ndarray]] = None¶
-
df
: Optional[Callable[[float, numpy.ndarray], numpy.ndarray]] = None¶
-
solution
: Optional[Callable[[float, numpy.ndarray], numpy.ndarray]] = None¶