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). 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, but that kept me going.
Y. F. Chang's Draft Typescript(1978) on Taylor Series [HOW IT WORKS] Chang on ATS
Y. F. Chang's FORTRAN Program using the same method Y. F. Chang's & George Corliss' FORTRAN Programs for solving differential equations and roots of polynomials using long Taylor Series
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.
Sample complicated generated program(Updated 9/29/2007)[problem corrected] : mtest6g.rb.txt
For information about using RubySode (Updated 5/19/2007) : README
Bugs in RubySode (revised 5/19/2007): BUGS
For information about the error in the solution(revised 5/19/2007): ABOUT ERROR
RubySode14.tgz has a corrected mtest6g test(complicated). RubySode13.tgz is a minor cleanup with a few more meaningful test files. RubySode12.tgz is a major improvement. I think I finally have "jump_" right ( I went back to old graduate student papers written when I was smarter and then reworked the implementation for RubySode12.) I tried eliminating the "higher_" variables -- but the error on low order equations was higher. The error estimation (in RubyApfp) was been debugged for release 10 . (using the rails calculators below). Then the diff's (or dependent variables) on the rhs were fixed. See results.html for testing.
To download RubySode14.tgz go to: RubySode14.tgz
NOTE: when downloading make sure you get the suffix ".tgz" In windows Vista I had to go to 'Windows explorer -- organize -- Folders and search options --view--- hide extensions for known file types` and deselect it.
Online Real Calculator using Apfp
Online Complex Calculator using Apfp
Note: I fixed a lot in Apfp in doing this calculator and it has now been incorporated into RubySode. I have done more extensive testing on Apfp as used in the calculator. It was so much easier. The one thing I have noticed is that the error was sometimes underestimated - I have fixed this.
To visit the sourceforge project web page try --(GET NEWS HERE!) SODE PROJECT
For info on RubyApfp: (which is included in RubySode13.tgz download) RubyApfp Home Page
The latest results (9/29/2007) Complicated problem fixed