source: Sophya/trunk/SophyaLib/NTools/rk4cdifeq.h@ 3862

Last change on this file since 3862 was 552, checked in by ansari, 26 years ago

namespace changed to SOPHYA cmv 5/11/99

File size: 1.2 KB
Line 
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
7namespace SOPHYA {
8
9// <summary> Runge-Kutta ordre 4 adaptatif </summary>
10// Runge-Kutta ordre 4 adaptatif, avec correction du pas d'integration
11class RK4CDiffEq : public RK4DiffEq {
12public:
13 // Constructeurs. Voir <linkto class=DiffEqSolver>DiffEqSolver</linkto>
14 // <group>
15 RK4CDiffEq();
16 RK4CDiffEq(DiffEqFunction*);
17 RK4CDiffEq(DIFEQFCN1);
18 // </group>
19
20 // Precision souhaitee, en absolu ou relatif, independamment pour chaque
21 // fonction ou globalement
22 // <group>
23 RK4CDiffEq& Accuracy(double);
24 RK4CDiffEq& AbsAccuracy(Vector const& vScal);
25 RK4CDiffEq& AbsAccuracy(double scal);
26 RK4CDiffEq& RelAccuracy();
27 // </group>
28
29 // Implementation RK4 adaptatif
30 virtual void SolveArr(Matrix& y, double* t, double tf, int n);
31
32protected:
33 // Un pas adaptatif
34 void RKCStep(Vector& newY, Vector const& y0, Vector const& yScale,
35 double dttry, double& dtdone, double& dtnext);
36
37 double eps;
38 bool relAccuracy;
39 Vector accScale;
40 Vector yTemp; // Pour ne pas reallouer
41 Vector ySave;
42};
43
44} // Fin du namespace
45
46#endif
Note: See TracBrowser for help on using the repository browser.