Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F86100941
AdamsMoulton.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, 07:03
Size
2 KB
Mime Type
text/x-c++
Expires
Sun, Oct 6, 07:03 (2 d)
Engine
blob
Format
Raw Data
Handle
21254670
Attached To
R9686 PCSCproject
AdamsMoulton.h
View Options
#ifndef ODELIBRARY_ADAMSMOULTON_H
#define ODELIBRARY_ADAMSMOULTON_H
#include <iostream>
#include <Eigen/Dense>
#include <list>
#include <vector>
#include "MultistepAbstractSolver.h"
class
AdamsMoulton
:
public
MultistepAbstractSolver
{
private:
/**
* When applying an implicit multistep method to solve a linear ODE system, at each iteration the update on the
* y value is performed solving a suitable linear system. The matrix that defines this system is constant through-out the
* iterations, whereas the rhs vector of the linear system updateMatrix*yNext=rhsVector is computed at each iteration.
*/
Eigen
::
MatrixXd
updateMatrix
;
/**
* This method sets the coefficients defining the Adams Bashforth method.
*/
void
setBCoeff
();
/**
* This function defines the update which is performed at each step of Adams Moulton method.
* @param y : reference to the last computed value of y
* @param t : time corresponding to the last computed value of y. The function computes y at time t+stepSize.
*/
void
step
(
Eigen
::
VectorXd
&
y
,
double
t
)
override
;
public:
AdamsMoulton
();
AdamsMoulton
(
double
t0
,
double
tf
,
int
n
,
int
steps
,
Eigen
::
VectorXd
&
y0
);
/**
* This method sets the number of steps defining the multistep Adams Bashforth algorithm.
* @param n : number of steps.
*/
void
setStepsAlgo
(
int
n
);
/**
* This method overrides the setRightHandSide method of the abstract mother class. This operation is needed for implicit multistep
* methods, because the matrix employed at each iteration for the update of y, updateMatrix, has to be computed and stored
* as a variable of this class.
* @param rhsMatrix: Matrix defining the ODE linear system
* @param g_: function of t, part of the rhs expression.
*/
void
setRightHandSide
(
Eigen
::
MatrixXd
&
rhsMatrix
,
Eigen
::
VectorXd
(
*
g_
)(
double
t
))
override
;
void
setRightHandSide
(
Eigen
::
MatrixXd
&
rhsMatrix
,
std
::
function
<
Eigen
::
VectorXd
(
double
)
>
g_
)
override
;
};
#endif
Event Timeline
Log In to Comment