d.wachss
08-11-2005, 08:52 PM
This isn't really a bug, since it does not cause an error, but there is a slight redundancy in the semiimplicit extrapolation routine, stifbs.
the array a[] is initialized in lines 26-27 (in the C++ book) as
a[0]=nseq[0]+1;
for (k=0;k<KMAXX;k++) a[k+1]=a[k]+nseq[k+1];
then those lines are repeated as lines 35-36:
a[0] += nv;
for (k=0;k<KMAXX;k++) a[k+1]=a[k]+nseq[k+1];
so you are initializing a[] twice. You could just replace the initial
a[0]=nseq[0]+1;
line with
a[0]=nseq[0]+nv+1;
and everything would work (I've done this and had two years of successful stiff ODE solving) (I think I need a real life).
The alf[][] initialization statements that follow depend only on the difference between two a[] values, so the result is the same no matter how a[0] is set.
the array a[] is initialized in lines 26-27 (in the C++ book) as
a[0]=nseq[0]+1;
for (k=0;k<KMAXX;k++) a[k+1]=a[k]+nseq[k+1];
then those lines are repeated as lines 35-36:
a[0] += nv;
for (k=0;k<KMAXX;k++) a[k+1]=a[k]+nseq[k+1];
so you are initializing a[] twice. You could just replace the initial
a[0]=nseq[0]+1;
line with
a[0]=nseq[0]+nv+1;
and everything would work (I've done this and had two years of successful stiff ODE solving) (I think I need a real life).
The alf[][] initialization statements that follow depend only on the difference between two a[] values, so the result is the same no matter how a[0] is set.