Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F79790418
BDF.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
Wed, Aug 28, 06:21
Size
1 KB
Mime Type
text/x-c++
Expires
Fri, Aug 30, 06:21 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20231478
Attached To
R9686 PCSCproject
BDF.h
View Options
#ifndef ODELIBRARY_BDF_H
#define ODELIBRARY_BDF_H
#include <iostream>
#include <Eigen/Dense>
#include <list>
#include <vector>
#include "MultistepAbstractSolver.h"
class BDF: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:
BDF();
BDF(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