PDA

View Full Version : Fourth-order Runge Kutta solver


Doug Goncz
Apr28-04, 03:14 AM
<jabberwocky><div class="vbmenu_control"><a href="jabberwocky:;" onClick="newWindow=window.open('','usenetCode','toolbar=no, location=no,scrollbars=yes,resizable=yes,status=no ,width=650,height=400'); newWindow.document.write('<HTML><HEAD><TITLE>Usenet ASCII</TITLE></HEAD><BODY topmargin=0 leftmargin=0 BGCOLOR=#F1F1F1><table border=0 width=625><td bgcolor=midnightblue><font color=#F1F1F1>This Usenet message\'s original ASCII form: </font></td></tr><tr><td width=449><br><br><font face=courier><UL><PRE>\n\nIn Mathcad the rkfixed function is described as a fourth order Runge-Kutta\ndifferential equation solver. I noted that it was rounding off the first four\ngear shifts in my bicycle simulation. Instead of gear 2, I had gear 1.883. I\nlooks like it smooths the ends.\n\nWhat exactly is a fourth order Runge-Kutta solver?\n\nI have written a first order solver, I think, and it\'s fast, so I use that now,\nbut I\'ll need the sbval solver to find the power required to complete a given\ncourse in a given time over arbitrary terrain. This will round off my gear\nchanges too, I am afraid.\n\nThe "solve block" is a vector of equations each a function of the y vector, and\nit seems the value of each is multiplied by dt and added to the value of y to\nupdate y for the next step. Yes, I am using rkfixed, not rkadapt. rkadapt does\neven more complicated stuff.\n\nMaking progress, though. I have got integer gears, accurate gear ratios,\ncadences and limits, shift decisions, and terrain modeled as a Fourier series.\n\nWhy model terrain as a Fourier series? It makes finding the slope at any point\nmuch easier. When terrain = altitude function of s, the slope is merely d alt /\nds, the sine of the slope angle. You multiply by weight to get force and throw\nit in the force balance. Then, to update force, you differentiate again and\nplug and chug.\n\n\nYours,\n\nDoug Goncz ( ftp://users.aol.com/DGoncz/ )\n\nMy physics project at NVCC:\nhttp://groups.google.com/groups?q=dgoncz&scoring=d plus\n"bicycle", "fluorescent", "inverter", "flywheel", "ultracapacitor", etc.\nin the search box\n</UL></PRE></font></td></tr></table></BODY><HTML>');"> <IMG SRC=/images/buttons/ip.gif BORDER=0 ALIGN=CENTER ALT="View this Usenet post in original ASCII form">&nbsp;&nbsp;View this Usenet post in original ASCII form </a></div><P></jabberwocky>In Mathcad the rkfixed function is described as a fourth order Runge-Kutta
differential equation solver. I noted that it was rounding off the first four
gear shifts in my bicycle simulation. Instead of gear 2, I had gear 1.883. I
looks like it smooths the ends.

What exactly is a fourth order Runge-Kutta solver?

I have written a first order solver, I think, and it's fast, so I use that now,
but I'll need the sbval solver to find the power required to complete a given
course in a given time over arbitrary terrain. This will round off my gear
changes too, I am afraid.

The "solve block" is a vector of equations each a function of the y vector, and
it seems the value of each is multiplied by dt and added to the value of y to
update y for the next step. Yes, I am using rkfixed, not rkadapt. rkadapt does
even more complicated stuff.

Making progress, though. I have got integer gears, accurate gear ratios,
cadences and limits, shift decisions, and terrain modeled as a Fourier series.

Why model terrain as a Fourier series? It makes finding the slope at any point
much easier. When terrain = altitude function of s, the slope is merely d alt /
ds, the sine of the slope angle. You multiply by weight to get force and throw
it in the force balance. Then, to update force, you differentiate again and
plug and chug.


Yours,

Doug Goncz ( ftp://users.aol.com/DGoncz/ )

My physics project at NVCC:
http://groups.google.com/groups?q=dgoncz&scoring=d plus
"bicycle", "fluorescent", "inverter", "flywheel", "ultracapacitor", etc.
in the search box