This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
odeiv_evolve_apply returns final value different than input
- From: James <james dot umbanhowar at mcgill dot ca>
- To: gsl-discuss at sources dot redhat dot com
- Date: Sat, 16 Mar 2002 14:22:00 -0500
- Subject: odeiv_evolve_apply returns final value different than input
Hello,
I'm trying to get evenly spaced samples from the adaptive step side
integrator as suggested in the manual. however, the value t returned
from gsl_odeiv_evolve_apply as the final value is 1x10-18 less than ti.
I've developed an inelegant workaround but was wondering why this was
happening? Is this a problem of different sized doubles?
For example, when i run the code at bottom i get out puts for h (step
size), t (time) - ti (final time)
of:
0.000000e+00 -6.938894e-18
Thanks for any help,
James Umbanhowar
All variables in the code are doubles.
ti = 0;
while(ti<max(20/params[1],params[5]*1000)) \\loop until time
max(...,...)
{
ti += params[5]; \\data output step size
while (t < ti)
{
gsl_odeiv_evolve_apply (e, c, s,&sys,&t, ti, &h,y);
printf("%e %e %.3e\n",h,t<ti,t-ti,);
}
fprintf(datafile,"%.3f %.3f \n",ti,y[0]-y[1]);
}