by Dennis Darland dennis.darland@yahoo.com
dennisdarland.comComments welcome
Sode.rb is a Ruby program to generate a Ruby program to solve a single (or a system of) ordinary differential equation(s). (I (9/18/2008) have discpovered serious problems with its handling of systems of equations but single equationns were OK as far as I know. I have made an attempt to incorporate the fix from MapleSode.rb above, but it needs more testing.) A long Taylor series method, pioneered by Prof. Y.F. Chang, who taught at the University of Nebraska in the late 1970's when I was a graduate student there, is used. The number of Taylor series terms can be specified in the problem file, though it is usually 30. This was originally written in Unicon, but Unicon, although having overloaded operators in its CVS, still doesn't have then released, which caused me to switch to Ruby. During the development, especially in the beginning, it took an EXTREME effort on my part to work out the details and I made many mistakes (I suffer from a mental illness.) The result from tests seem generally good now. The complex example does not work as well as I would want. I wonder whether it is becaise the Taylor series for exponential function decrease slowly and don't alternate in sign. Anyway I get a significant number of downloads but no comments, suggestions or questions. It may be some people were disappointed in early versions, as it was a STRUGGLE for me, and I probably released to early and often, (as I thought this was part of the idea of OPEN SOURCE) but that kept me going.
Y. F. Chang's Draft Typescript(1978) on Taylor Series [HOW IT WORKS] Chang on ATS
The Taylor series terms are used to calculate the values of the dependent variables, and also (optionally) the radius of convergence and order of any singularities. These can be used to reduce the size of the next increment. Increasing it in the middle results in large errors because ecace sucessive term is multipiied by increasing powers of the ratio of the new $h to the old $h. In the begining I start with a very small $h and increase it until the estimated trucation error is too large and back up or else reach a maximum.