home *** CD-ROM | disk | FTP | other *** search
/ Boot Disc 8 / boot-disc-1997-04.iso / PDA_Soft / Psion / misc / Spydrx / RKUTTA.WEB < prev    next >
Text File  |  1995-08-20  |  2KB  |  83 lines

  1.  
  2. <opts>
  3. <odest>screen</odest>
  4. <oname>home</oname>
  5. <onewl>lf</onewl>
  6. <cfmt>%y,%yp</cfmt>
  7. <ctype>iterate</ctype>
  8. <citer>25</citer>
  9. <call>no</call>
  10. <cdisp>fmtlist</cdisp>
  11. <cext>yes</cext>
  12. <rfmt>\n\N=\V\n\F\n\T\n</rfmt>
  13. <rall>yes</rall>
  14. <starg></starg>
  15. <srpl></srpl>
  16. <scount>1</scount>
  17. <sout>yes</sout>
  18. <nfmt>fixed</nfmt>
  19. <ndec>2</ndec>
  20. <nang>degrees</nang></opts>
  21. <cell>
  22. <cname>a</cname>
  23. <val>1</val></cell>
  24. <cell>
  25. <cname>h</cname>
  26. <text>step size constant...  how far in the x direction do we go each iteration.</text>
  27. <val>0.05</val>
  28. <form>0.05</form></cell>
  29. <cell>
  30. <cname>home</cname>
  31. <text>This is the home cell for a demonstration of a numerical solution to the differential equation describing simple harmonic motion:
  32.  
  33.     y''= -a*y
  34.  
  35. To execute the demonstration, put initial values into cells y and yp, then go to cell y, and choose Evaluate from the Special menu.
  36.  
  37. This example computes successive values of y and yp (y') with third order accuracy.  The Runge-Kutta formulae come from "Advanced Calulus For Engineers", by F.B. Hildebrandt, Prentice Hall, 1949.
  38.  
  39. These formulae are summarized below:
  40. h:=   (const value of step size)
  41. a:=   (const coefficient of restitution)
  42. k1:=h*yp
  43. k1p:=-a*h*y
  44. k2:=h*(yp+k1p!/2)
  45. k2p:=-a*h*(y+k1!/2)
  46. k3:=h*(yp+2*k2p!-k1p!)
  47. k3p:=-a*h*(y+2*k2!-k1!)
  48. y:=y+(k1!+4*k2!+k3!)/6
  49. yp:=yp+(k1p!+4*k2p!+k3p!)/6
  50. </text></cell>
  51. <cell>
  52. <cname>k1</cname>
  53. <val>0.25</val>
  54. <form>h*yp</form></cell>
  55. <cell>
  56. <cname>k1p</cname>
  57. <val>0.43</val>
  58. <form>-a*h*y</form></cell>
  59. <cell>
  60. <cname>k2</cname>
  61. <val>0.26</val>
  62. <form>h*(yp+k1p!/2)</form></cell>
  63. <cell>
  64. <cname>k2p</cname>
  65. <val>0.43</val>
  66. <form>-a*h*(y+k1!/2)</form></cell>
  67. <cell>
  68. <cname>k3</cname>
  69. <val>0.27</val>
  70. <form>h*(yp+2*k2p!-k1p!)</form></cell>
  71. <cell>
  72. <cname>k3p</cname>
  73. <val>0.42</val>
  74. <form>-a*h*(y+2*k2!-k1!)</form></cell>
  75. <cell>
  76. <cname>y</cname>
  77. <text>y is the displacement variable in the simple harmonic motion.</text>
  78. <val>-8.40</val>
  79. <form>y+(k1!+4*k2!+k3!)/6</form></cell>
  80. <cell>
  81. <cname>yp</cname>
  82. <val>5.45</val>
  83. <form>yp+(k1p!+4*k2p!+k3p!)/6</form></cell></eof>