usode by Dennis J. Darland dennis.darland@yahoo.com http://www.dennisdarland.com/index.html usode.icn is source to a Unicon program to generate a Unicon program to numerically solve either a single ordinary differential equation or a system of such equations. The files in the archive may be placed in the directory of your choice, but sode must then be run in that directory & the problem files placed there as well. The command "make name=sin" would solve the problem in "sin.ude" The basic problems are solved by the script "test.basic" Also the APFP class files & unicon & unicon overloaded operators are required. See http://sode.sourceforge.net/index.html The output unicon code is found in "diffeq.icn". Use "make name=your_problem.ude" to build & run it. The problem file is found in a "---.ude" file. There are many in the usode??tar.gz file. The format is below Unicon can be found at: http://unicon.sourceforge.net/index.html APFP can be found at http://sourceforge.net/projects/apfp/ Format of .ude file: ---------------------------------- ode spec $ constants spec $ initial values $ procedure exact_soln_y(x) for icon. # analytic solutiion to be numerically compared. --- Any other functions( user defined) $ ------------------------------------ The ode spec is of the form diff(y,x,N) = x * sin(x); The operations + - / * are supported. The functions which may be used are ln exp sin cos tan sinh cosh tanh arcsin arccos arctan Si(not in Icon) erf(not in Icon) expt(a,b) (a to b power.) Positive literals may also be used. M1 can be used for -1. diff (y,x,M) for M < N & M > 0 can be used for the lower derivatives of y. ------------------------------------------ SAMPLE .ide file -------------------------------------------- diff ( y1 , x , 6 ) = 3 * diff( y1, x , 1) - 2* diff( y2, x, 2); diff ( y2 , x , 3 ) = 2* diff( y1, x , 2) - 2 * diff( y3, x, 2); diff ( y3 , x , 3 ) = 2* diff( y1, x , 5) - 2 * y2; $ MAX_TERMS:=30; # Max Number of Taylor series terms MIN_TERMS:=11; # Min Number of Taylor series terms $ H := 0.0001; #initial H x_start := 3.0; #initial x x_end := 3.0003; #final x y1_init[1] := 1; #initial value of y1 y1_init[2] := 2; #initial value of y1' y1_init[3] := 0.7; #etc. y1_init[4] := 1.7; y1_init[5] := 0.6; y1_init[6] := 0.9; y2_init[1] := 9.6; y2_init[2] := 6.5; y2_init[3] := 8.5; y3_init[1] := 6.8; y3_init[2] := 6.5; y3_init[3] := 3.5; log10relerr := -6.0; #log base 10 of relative eror permittd default = -8.0; log10abserr := -6.0; #log base 10 of absolute eror permittd default = -8.0; HMIN := 0.00001; # minimum H HMAX := 1.0; # maximum H adjust_h := 1; # whether to adjust H (1 is true. 0 is false.) look_poles := 1; # whether to estimate singularities(1 is true. 0 is false.) disp_incr :=0.1 # 0 for endpoints only -1 for "natural" H MAX_ITER := 100; # Maximum number of iterations of main loop. MAX_HOURS := 0; # Maximum number of hours to execute - # 0 default MAX_MINUTES := 15; # Maximum number minutes to execute - # 15 default SMALL_FLOAT := 1.0e-200; #default SMALLISH_FLOAT := 1.0e-10; #default LARGE_FLOAT := 1.0e100; #default ALMOST_1 := 0.99; #default PROGRESS_IND := 10; #iterations between progress output # 10 default $ procedure exact_soln_y1(x) return ZERO; # this solution is unknown. end procedure exact_soln_y2(x) return ZERO; # this solution is unknown. end procedure exact_soln_y3(x) return ZERO; # this solution is unknown. end $