Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F86090466
RungeKutta.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Oct 4, 05:28
Size
1 KB
Mime Type
text/x-c++
Expires
Sun, Oct 6, 05:28 (2 d)
Engine
blob
Format
Raw Data
Handle
21259301
Attached To
R9686 PCSCproject
RungeKutta.h
View Options
#ifndef ODELIBRARY_RUNGEKUTTA_H
#define ODELIBRARY_RUNGEKUTTA_H
#include "AbstractSolver.h"
/**
* The famous Runge Kutta solver. Solutions for 4 methods order are available. It will compute the 4th order udpate by
* default, a.k.a. the RK4 method.
*/
class
RungeKutta
:
public
AbstractSolver
{
private:
//
int
methodOrder
;
public:
RungeKutta
(
double
t0
,
double
tf
,
int
n
,
int
order
,
Eigen
::
VectorXd
&
y0
);
/**
* Default constructor sets the method order to 4.
*/
RungeKutta
()
:
AbstractSolver
()
{
methodOrder
=
4
;
};
/**
* Setter for the method order, will throw an exception if the order is invalid.
* @param n : method order, integer, can be 1, 2, 3 or 4
*/
void
setMethodOrder
(
int
n
);
/// getter for the method order
int
getMethodOrder
();
/**
* Step method for runge Kutta, it will depend on the method order.
* @param y : Eigen vector, the current value of the equation
* @param t : double, the current time where the step must be performed
*/
void
step
(
Eigen
::
VectorXd
&
y
,
double
t
)
override
;
};
#endif
//ODELIBRARY_RUNGEKUTTA_H
Event Timeline
Log In to Comment