<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"><DIV style="FONT-FAMILY: times new roman, new york, times, serif; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>Hello world !</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>I noticed that it depended on how I define Adot. For example, doing this :</DIV>
<DIV>
<DIV><STRONG>---</STRONG></DIV>
<DIV><STRONG>function Xdot = F(t,X)</STRONG></DIV>
<DIV><STRONG>  printf("t=%f \n",t);</STRONG></DIV>
<DIV><STRONG>  <BR>  [v1,v2,v3] = fonc(t,X(1),X(2));<BR>  xdot = v1;<BR>  ydot = v2;<BR>  Adot = 1;<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>leads to :</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.171000</STRONG></DIV>
<DIV><STRONG>---</STRONG></DIV>
<DIV> </DIV>
<DIV>I verified that these times correspond to the intermediate times used by the "rkf" method : 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">http://math.fullerton.edu/mathews/n2003/RungeKuttaFehlbergMod.html</A>.</DIV>
<DIV> </DIV>
<DIV>Now if I use for example :</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><STRONG></STRONG> </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. For me, the number of intermediate times is supposed to be the same, am I right ?</DIV>
<DIV> </DIV>
<DIV>An explanation of that mystery ?</DIV>
<DIV> </DIV></DIV>
<DIV>Thank you in advance.</DIV></DIV></div><br>




      </body></html>