-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdyn.hpp
More file actions
40 lines (27 loc) · 856 Bytes
/
dyn.hpp
File metadata and controls
40 lines (27 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef DYN_MOD_H
#define DYN_MOD_H
#include <Eigen/Dense>
#include <functional>
class DynamicModel {
public:
// State function type
typedef std::function<Eigen::VectorXd
(double, const Eigen::VectorXd&, const Eigen::VectorXd&)> stf;
// State function: dx/dt = f(t,x,w)
const stf f;
// State dimension
const int n;
// Absolute & relative tolerance
const double abstol, reltol;
// Constructor
DynamicModel(const stf& f_, int n_,
double abstol_, double reltol_);
// Propagate state from ti to tf with noise w
Eigen::VectorXd operator() (double ti, double tf,
const Eigen::VectorXd& xi, const Eigen::VectorXd& w);
private:
// Workspace
Eigen::VectorXd work;
int iwork[5];
};
#endif