monir
10-02-2007, 11:37 AM
Hello;
1) The NR (fortran,p. 557) suggests and uses (in sub ODEINT) a general-purpose scaling vector:
....YSCAL(i)=|y(i)|+|h*DYDX(i)|
for getting a constant local fractional error, with a caveat "except very near zero crossings".
2) By "zero crossings", I suppose it means either the dependent variable element y(i) or the incremental element h*DYDX(i) changes sign within the current step.
Is my interpretation correct ???
3) What happens if some equations in the set of ODEs experience "zero crossings" and one needs to specify desired accuracies differently for those elements of the vector YSCAL corresponding to those equations ??? The result would be inconsistent error tolerances for the integration of the ODEs !!
4) On the other hand, if one chooses to specify:
....YSCAL(i)=|y(i)| for the entire set, it would imply that the dependent variables of the ODEs differ considerably in magnitude, which is NOT the case!
5) When I applied the "global" fractional error scaling (NR,p.557) based on the increments of the dependent variables at each step:
....YSCAL(i)=|h*DYDX(i)|
together with:
large stepsize to be attempted; HTRY=0.009
X1=0.02, X2=0.03, NVAR=60; and
a conservative desired overall tolerance level; EPS=1.E-6
the algorithm ODEINT() appears to go for ever, with calculated HNEXT in RKQC() in the order of 1.E-8 or less, NSTP in ODEINT in the 100s, and the runtime in hrs on a 3.2 GHz m/c!!
6) This might be "expected and normal", since the authors suggested MAXSTP=10,000 in sub ODEINT(), and one would just have to be patient and let the program continues till its normal exit, even if it takes days !!
7) Has anyone experience such difficulties ???
8) Has anyone come up with a better general-purpose scaling vector YSCAL(i) for sub ODEINT() ???
(I'm using the F90 source code from:
http://www.nrbook.com/a/bookfpdf/f16-2.pdf)
Your expert suggestion(s) would be greatly appreciated.
Monir
1) The NR (fortran,p. 557) suggests and uses (in sub ODEINT) a general-purpose scaling vector:
....YSCAL(i)=|y(i)|+|h*DYDX(i)|
for getting a constant local fractional error, with a caveat "except very near zero crossings".
2) By "zero crossings", I suppose it means either the dependent variable element y(i) or the incremental element h*DYDX(i) changes sign within the current step.
Is my interpretation correct ???
3) What happens if some equations in the set of ODEs experience "zero crossings" and one needs to specify desired accuracies differently for those elements of the vector YSCAL corresponding to those equations ??? The result would be inconsistent error tolerances for the integration of the ODEs !!
4) On the other hand, if one chooses to specify:
....YSCAL(i)=|y(i)| for the entire set, it would imply that the dependent variables of the ODEs differ considerably in magnitude, which is NOT the case!
5) When I applied the "global" fractional error scaling (NR,p.557) based on the increments of the dependent variables at each step:
....YSCAL(i)=|h*DYDX(i)|
together with:
large stepsize to be attempted; HTRY=0.009
X1=0.02, X2=0.03, NVAR=60; and
a conservative desired overall tolerance level; EPS=1.E-6
the algorithm ODEINT() appears to go for ever, with calculated HNEXT in RKQC() in the order of 1.E-8 or less, NSTP in ODEINT in the 100s, and the runtime in hrs on a 3.2 GHz m/c!!
6) This might be "expected and normal", since the authors suggested MAXSTP=10,000 in sub ODEINT(), and one would just have to be patient and let the program continues till its normal exit, even if it takes days !!
7) Has anyone experience such difficulties ???
8) Has anyone come up with a better general-purpose scaling vector YSCAL(i) for sub ODEINT() ???
(I'm using the F90 source code from:
http://www.nrbook.com/a/bookfpdf/f16-2.pdf)
Your expert suggestion(s) would be greatly appreciated.
Monir