philsupertramp/game-math
Loading...
Searching...
No Matches
ode.h
Go to the documentation of this file.
1
12#pragma once
13#include <functional>
14#include <vector>
15
17using ODE = std::function<Matrix<double>(double, Matrix<double>)>;
18
20using ODEJac = std::function<Matrix<double>(double, Matrix<double>)>;
21
25struct ODEResult {
32
39 : Y(y)
40 , T(t) { }
41
48 ODEResult(const Matrix<double>& y, const Matrix<double>& t, const Matrix<int>& iter)
49 : Y(y)
50 , T(t)
51 , Iterations(iter) { }
52};
56struct ODEOption {
58 double h = 0;
60 double TOL = 1e-7;
62 int maxIter = 50;
64 ODEJac Jac = nullptr;
65};
Definition: Matrix.h:42
std::function< Matrix< double >(double, Matrix< double >)> ODEJac
alias for Jacobian-Matrix of ODE
Definition: ode.h:20
std::function< Matrix< double >(double, Matrix< double >)> ODE
alias for ODE
Definition: ode.h:17
Definition: ode.h:56
double TOL
tolerance for the algorithm to determine convergence
Definition: ode.h:60
int maxIter
max iterations for integrated newton steps
Definition: ode.h:62
double h
step width of t
Definition: ode.h:58
ODEJac Jac
jacobian matrix of given function
Definition: ode.h:64
Definition: ode.h:25
Matrix< int > Iterations
number iterations per time step
Definition: ode.h:31
ODEResult(const Matrix< double > &y, const Matrix< double > &t)
Definition: ode.h:38
Matrix< double > Y
Y-values.
Definition: ode.h:27
Matrix< double > T
T-values (mostly time)
Definition: ode.h:29
ODEResult(const Matrix< double > &y, const Matrix< double > &t, const Matrix< int > &iter)
Definition: ode.h:48