<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt;color:#000000;"><DIV>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>Hi,</DIV>
<DIV> </DIV>
<DIV>I have a problem using ode "rkf". I defined a function like that:</DIV>
<DIV><STRONG>---</STRONG></DIV>
<DIV><STRONG>function Xdot = F(t,X)<BR>  [v1,v2,v3] = fonc(t,X(1),X(2));<BR>  xdot = v1;<BR>  ydot = v2;<BR>  Adot = v3;<BR><BR>  Xdot = [xdot; ydot; Adot];<BR>endfunction</STRONG></DIV>
<DIV><STRONG>---</STRONG></DIV>
<DIV>then I used : </DIV>
<DIV><STRONG>---</STRONG></DIV>
<DIV><STRONG>Sol = ode("rkf",X0,t0,t0:pas_temps:tf,F);</STRONG></DIV>
<DIV><STRONG>---</STRONG></DIV>
<DIV> </DIV>
<DIV>In this case, xdot and ydot don't depend on A=X(3), I obtain however a different result for x=X(1) and y=X(2) compared with the result obtained by integrating only x and y (same initial condition, etc.).</DIV>
<DIV> </DIV>
<DIV>If I use for example:</DIV>
<DIV>
<DIV><STRONG>---</STRONG></DIV>
<DIV><STRONG>function Xdot = F(t,X)</STRONG></DIV>
<DIV>  <STRONG>printf("t=%f \n",t);</STRONG><BR><STRONG>  </STRONG></DIV>
<DIV><STRONG>  [v1,v2,v3] = fonc(t,X(1),X(2));<BR>  xdot = v1;<BR>  ydot = v2;<BR>  Adot = v3;<BR><BR>  Xdot = [xdot; ydot; Adot];<BR>endfunction</STRONG></DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV><STRONG>Sol = ode("rkf",X0,t0,t0:pas_temps:tf,F);</STRONG></DIV>
<DIV><STRONG>---</STRONG></DIV>
<DIV>with t0=0.17, pas_temps=0.001 et tf=t0+pas_temps</DIV>
<DIV> </DIV>
<DIV>then Scilab returns that:</DIV>
<DIV><STRONG>---</STRONG></DIV>
<DIV><STRONG>t=0.170000 <BR>t=0.170250 <BR>t=0.170375 <BR>t=0.170923 <BR>t=0.171000 <BR>t=0.170500 <BR>t=0.170218 <BR>t=0.170326 <BR>t=0.170803 <BR>t=0.170870 <BR>t=0.170435 <BR>t=0.170870 <BR>t=0.170903 <BR>t=0.170919 <BR>t=0.170990 <BR>t=0.171000 <BR>t=0.170935 <BR>t=0.171000</STRONG></DIV>
<DIV><STRONG>---</STRONG></DIV>
<DIV>and as a consequence that changes the results for x and y (they are supposed not to change because they don't depend on A). I checked the definition of v3 and don't see errors. </DIV>
<DIV> </DIV>
<DIV>For me, the number of intermediate times is supposed to be less than that: the intermediate times used by the "rkf" method are t0, t0+1/4*pas_temps, t0+3/8*pas_temps, t0+12/13*pas_temps, t0+pas_temps, t0+1/2*pas_temps, as said here <A href="http://math.fullerton.edu/mathews/n2003/RungeKuttaFehlbergMod.html" rel=nofollow target=_blank><FONT color=#810081>http://math.fullerton.edu/mathews/n2003/RungeKuttaFehlbergMod.html</FONT></A>.</DIV>
<DIV> </DIV>
<DIV>So I defined myself a function rkf. After testing it, it returned the same results as given by integrating only x and y using the function ode.</DIV>
<DIV>
<DIV>
<DIV> </DIV></DIV></DIV>
<DIV>An explanation of that mystery?</DIV>
<DIV>Where can I find the code of the Scilab function ode?</DIV>
<DIV> </DIV></DIV>
<DIV>Thank you in advance.</DIV></DIV></DIV></div><br>




      </body></html>