Changeset 508 in Sophya for trunk/SophyaLib/NTools/difeq.cc
- Timestamp:
- Oct 25, 1999, 12:36:22 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/NTools/difeq.cc
r244 r508 106 106 //++ 107 107 DiffEqSolver& 108 DiffEqSolver::StartV( Vector const& yi, double t)108 DiffEqSolver::StartV(OVector const& yi, double t) 109 109 // 110 110 // Spécifie le point de départ de l'intégration de l'équadif. … … 169 169 170 170 //++ 171 // virtual void DiffEqSolver::SolveArr( Matrix& y, double* t, double tf, int n)=0171 // virtual void DiffEqSolver::SolveArr(OMatrix& y, double* t, double tf, int n)=0 172 172 // Lance la résolution de l'équadif, jusqu'à la valeur 173 173 // tf du temps. N valeurs intermédiaires sont retournées dans … … 189 189 //++ 190 190 void 191 DiffEqSolver::SolveV( Vector& yf, double tf)191 DiffEqSolver::SolveV(OVector& yf, double tf) 192 192 // 193 193 // Lance la résolution de l'équadif, jusqu'à la valeur … … 201 201 { 202 202 double t; 203 Matrix m(1, mFunc->NFuncReal());203 OMatrix m(1, mFunc->NFuncReal()); 204 204 SolveArr(m, &t, tf, 1); 205 205 yf.Realloc(mFunc->NFunc()); … … 219 219 ASSERT(mFunc->NFunc() == 1); 220 220 double t; 221 Matrix m(1,mFunc->NFuncReal());221 OMatrix m(1,mFunc->NFuncReal()); 222 222 SolveArr(m, &t, tf, 1); 223 223 yf = m(0,0); … … 238 238 { 239 239 double t; 240 Matrix m(1, mFunc->NFuncReal());240 OMatrix m(1, mFunc->NFuncReal()); 241 241 SolveArr(m, &t, tf, 1); 242 242 for (int i=0; i<mFunc->NFunc(); i++) … … 258 258 { 259 259 ASSERT(mFunc->NFunc() == 1); 260 Matrix m(n, mFunc->NFuncReal());260 OMatrix m(n, mFunc->NFuncReal()); 261 261 SolveArr(m, t, tf, n); 262 262 for (int i=0; i<n; i++) … … 281 281 //-- 282 282 { 283 Matrix m(n, mFunc->NFuncReal());283 OMatrix m(n, mFunc->NFuncReal()); 284 284 SolveArr(m, t, tf, n); 285 285 for (int i=0; i<n; i++) … … 318 318 319 319 //++ 320 // virtual void ComputeV( Vector& fpi,Vector const& fi)320 // virtual void ComputeV(OVector& fpi, OVector const& fi) 321 321 // Calcule les valeurs des dérivées fpi à partir des valeurs 322 322 // des fonctions fi. A redéfinir. … … 340 340 341 341 //++ 342 // virtual void AdjustStart( Vector& start, double tstart)342 // virtual void AdjustStart(OVector& start, double tstart) 343 343 // Pour ajuster le vecteur de départ quand il y a des 344 344 // fonctions à usage interne... … … 405 405 406 406 void 407 DiffEqFcnT1::ComputeV( Vector& fpi,Vector const& fi)407 DiffEqFcnT1::ComputeV(OVector& fpi, OVector const& fi) 408 408 { 409 409 fpi(0) = (*mFcn)(fi(0), fi(1)); … … 412 412 413 413 void 414 DiffEqFcnT1::AdjustStart( Vector& start, double tstart)414 DiffEqFcnT1::AdjustStart(OVector& start, double tstart) 415 415 { 416 416 start.Realloc(2); … … 446 446 447 447 void 448 DiffEqFcn2::ComputeV( Vector& fpi,Vector const& fi)448 DiffEqFcn2::ComputeV(OVector& fpi, OVector const& fi) 449 449 { 450 450 fpi(0) = fi(1); … … 481 481 482 482 void 483 DiffEqFcnT2::ComputeV( Vector& fpi,Vector const& fi)483 DiffEqFcnT2::ComputeV(OVector& fpi, OVector const& fi) 484 484 { 485 485 fpi(0) = fi(1); … … 489 489 490 490 void 491 DiffEqFcnT2::AdjustStart( Vector& start, double tstart)491 DiffEqFcnT2::AdjustStart(OVector& start, double tstart) 492 492 { 493 493 start.Realloc(3); … … 505 505 // un vecteur de dimension 3. 506 506 // On fournit une fonction de type 507 //| typedef void(*DIFEQFCNV)( Vector& y2,Vector const& y1,508 //| Vector const& y);507 //| typedef void(*DIFEQFCNV)(OVector& y2, OVector const& y1, 508 //| OVector const& y); 509 509 // qui retourne y'' en fonction de y' et y. 510 510 // Note : le système résolu est alors en fait … … 527 527 528 528 void 529 DiffEqFcnV::ComputeV( Vector& fpi,Vector const& fi)529 DiffEqFcnV::ComputeV(OVector& fpi, OVector const& fi) 530 530 { 531 531 fpi(0) = fi(3); … … 582 582 583 583 void 584 RK4DiffEq::SolveArr( Matrix& y, double* t, double tf, int n)584 RK4DiffEq::SolveArr(OMatrix& y, double* t, double tf, int n) 585 585 { 586 586 //TIMEF; … … 592 592 double dx = (tf - mXStart)/(n*nStep); 593 593 594 Vector yt = mYStart;594 OVector yt = mYStart; 595 595 596 596 k1.Realloc(mFunc->NFuncReal()); … … 610 610 611 611 void 612 RK4DiffEq::RKStep( Vector& newY,Vector const& y0, double dt)612 RK4DiffEq::RKStep(OVector& newY, OVector const& y0, double dt) 613 613 { 614 614 mFunc->ComputeV(k1, y0);
Note:
See TracChangeset
for help on using the changeset viewer.