MURE
Loading...
Searching...
No Matches
RKSolver.hxx
Go to the documentation of this file.
1/*
2 This file is part of MURE,
3 Copyright (C) 2007-2021 MURE developers.
4
5 MURE is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 MURE is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with MURE. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef _RKSolver_
20#define _RKSolver_
26#include <cmath>
27#include <vector>
28#include <iosfwd>
29
30using namespace std;
31#include "MUREGlobal.hxx"
32#include "MiscFunction.hxx"
33#include "BatemanSolver.hxx"
34//-----------------------------------------------------------------------------//
35
37
47//________________________________________________________________________
48
49class RKSolver : public BatemanSolver
50{
51 public:
52 RKSolver();
53 RKSolver(const RKSolver &BS);
54 ~RKSolver() override;
55
61
70 void Solve(double *N0, double **Matrix, int N, double t1, double t2) override;
72
78
80
85 void RungeKutta(double *YStart, double t1, double t2);
86
88
94 void BuildEqns(double t, double *N, double *dNdt);
95
96 void SetTheMatrix(double **f)
97 {
98 fTheMatrix = f;
99 }
100
102
107
109
110 protected:
112
120 void RK4(double *y, double *dydx, double x, double h, double *yout);
122
133 void AdaptStepSize(double *y, double *dydx, double *x, double htry, double eps, double *yscal, double *hdid, double *hnext);
134
135 double fHestimate;
136 double fHmin;
137 double fMaxHdid;
138 double fMinHdid;
139
140 private:
145
147 double **fTheMatrix;
148
149};
150#endif
Header file for BatemanSolver class.
Header file for vector operation, Regression and FindFitParameters functions.
Base class of Bateman-type solvers like Runge-Kutta or CRAM or any other.
Definition BatemanSolver.hxx:45
RKSolver class solves system of differential equations by Runge-Kutta method.
Definition RKSolver.hxx:50
void Solve(double *N0, double **Matrix, int N, double t1, double t2) override
Solve Bateman equation using Runge-Kutta method.
Definition RKSolver.cxx:50
void RungeKutta(double *YStart, double t1, double t2)
Runge Kutta calling method.
Definition RKSolver.cxx:98
void SetTheMatrix(double **f)
Definition RKSolver.hxx:96
void AdaptStepSize(double *y, double *dydx, double *x, double htry, double eps, double *yscal, double *hdid, double *hnext)
Adaptative Step Size method for RK.
Definition RKSolver.cxx:253
void RK4(double *y, double *dydx, double x, double h, double *yout)
Runge Kutta main method.
Definition RKSolver.cxx:192
double fMinHdid
store the effective RK min step
Definition RKSolver.hxx:138
~RKSolver() override
Destructor.
double fHestimate
RK Step estimation.
Definition RKSolver.hxx:135
double ** fTheMatrix
The evolution Matrix.
Definition RKSolver.hxx:147
double fMaxHdid
store the effective RK max step
Definition RKSolver.hxx:137
double fHmin
RK minimum Step.
Definition RKSolver.hxx:136
void BuildEqns(double t, double *N, double *dNdt)
Builds the Bateman equations for integration.
Definition RKSolver.cxx:67
RKSolver()
Normal constructor.
Definition RKSolver.cxx:30
the namespace of the Standard C++

MURE Project, documentation generated by Doxygen 1.9.7 - Fri Jan 19 2024