Last change
on this file since 220 was 220, checked in by ansari, 26 years ago |
Creation module DPC/NTools Reza 09/04/99
|
File size:
1.1 KB
|
Rev | Line | |
---|
[220] | 1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
| 2 | #ifndef RK4CDIFEQ_H_SEEN
|
---|
| 3 | #define RK4CDIFEQ_H_SEEN
|
---|
| 4 |
|
---|
| 5 | #include "difeq.h"
|
---|
| 6 |
|
---|
| 7 | // <summary> Runge-Kutta ordre 4 adaptatif </summary>
|
---|
| 8 | // Runge-Kutta ordre 4 adaptatif, avec correction du pas d'integration
|
---|
| 9 | class RK4CDiffEq : public RK4DiffEq {
|
---|
| 10 | public:
|
---|
| 11 | // Constructeurs. Voir <linkto class=DiffEqSolver>DiffEqSolver</linkto>
|
---|
| 12 | // <group>
|
---|
| 13 | RK4CDiffEq();
|
---|
| 14 | RK4CDiffEq(DiffEqFunction*);
|
---|
| 15 | RK4CDiffEq(DIFEQFCN1);
|
---|
| 16 | // </group>
|
---|
| 17 |
|
---|
| 18 | // Precision souhaitee, en absolu ou relatif, independamment pour chaque
|
---|
| 19 | // fonction ou globalement
|
---|
| 20 | // <group>
|
---|
| 21 | RK4CDiffEq& Accuracy(double);
|
---|
| 22 | RK4CDiffEq& AbsAccuracy(Vector const& vScal);
|
---|
| 23 | RK4CDiffEq& AbsAccuracy(double scal);
|
---|
| 24 | RK4CDiffEq& RelAccuracy();
|
---|
| 25 | // </group>
|
---|
| 26 |
|
---|
| 27 | // Implementation RK4 adaptatif
|
---|
| 28 | virtual void SolveArr(Matrix& y, double* t, double tf, int n);
|
---|
| 29 |
|
---|
| 30 | protected:
|
---|
| 31 | // Un pas adaptatif
|
---|
| 32 | void RKCStep(Vector& newY, Vector const& y0, Vector const& yScale,
|
---|
| 33 | double dttry, double& dtdone, double& dtnext);
|
---|
| 34 |
|
---|
| 35 | double eps;
|
---|
| 36 | bool relAccuracy;
|
---|
| 37 | Vector accScale;
|
---|
| 38 | Vector yTemp; // Pour ne pas reallouer
|
---|
| 39 | Vector ySave;
|
---|
| 40 | };
|
---|
| 41 |
|
---|
| 42 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.