|\^/| Maple 12 (IBM INTEL LINUX)
._|\| |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2008
\ MAPLE / All rights reserved. Maple is a trademark of
<____ ____> Waterloo Maple Inc.
| Type ? for help.
> #BEGIN OUTFILE1
>
> # Begin Function number 3
> display_alot := proc(iter)
> global
> glob_max_terms,
> DEBUGMASSIVE,
> glob_iolevel,
> INFO,
> DEBUGL,
> ALWAYS,
> #Top Generate Globals Decl
> glob_normmax,
> glob_max_trunc_err,
> glob_look_poles,
> glob_clock_sec,
> glob_almost_1,
> glob_warned,
> glob_no_eqs,
> glob_max_iter,
> glob_log10_relerr,
> sec_in_min,
> djd_debug2,
> glob_dump,
> glob_warned2,
> glob_small_float,
> glob_display_flag,
> glob_log10normmin,
> glob_log10relerr,
> glob_optimal_start,
> glob_abserr,
> glob_dump_analytic,
> glob_large_float,
> centuries_in_millinium,
> days_in_year,
> glob_iter,
> glob_unchanged_h_cnt,
> glob_hmax,
> glob_initial_pass,
> glob_hmin,
> glob_h,
> glob_reached_optimal_h,
> glob_not_yet_finished,
> glob_max_minutes,
> glob_orig_start_sec,
> glob_max_rel_trunc_err,
> glob_log10_abserr,
> glob_optimal_done,
> min_in_hour,
> glob_curr_iter_when_opt,
> glob_start,
> glob_smallish_float,
> glob_not_yet_start_msg,
> hours_in_day,
> djd_debug,
> glob_max_opt_iter,
> glob_html_log,
> glob_log10abserr,
> glob_max_sec,
> glob_clock_start_sec,
> glob_optimal_expect_sec,
> glob_percent_done,
> MAX_UNCHANGED,
> glob_current_iter,
> glob_optimal_clock_start_sec,
> glob_relerr,
> glob_last_good_h,
> glob_disp_incr,
> years_in_century,
> glob_subiter_method,
> glob_max_hours,
> glob_hmin_init,
> #Bottom Generate Globals Decl
> #BEGIN CONST
> array_const_0D0,
> array_const_1,
> #END CONST
> array_log,
> array_last_rel_error,
> array_pole,
> array_type_pole,
> array_norms,
> array_y_init,
> array_1st_rel_error,
> array_y,
> array_x,
> array_m1,
> array_tmp0,
> array_tmp1,
> array_y_higher_work2,
> array_real_pole,
> array_y_higher,
> array_y_set_initial,
> array_poles,
> array_complex_pole,
> array_y_higher_work,
> glob_last;
>
> local abserr, analytic_val_y, ind_var, numeric_val, relerr, term_no;
> #TOP DISPLAY ALOT
> if (iter >= 0) then # if number 1
> ind_var := array_x[1];
> omniout_float(ALWAYS,"x[1] ",33,ind_var,20," ");
> analytic_val_y := exact_soln_y(ind_var);
> omniout_float(ALWAYS,"y[1] (analytic) ",33,analytic_val_y,20," ");
> term_no := 1;
> numeric_val := array_y[term_no];
> abserr := abs(numeric_val - analytic_val_y);
> omniout_float(ALWAYS,"y[1] (numeric) ",33,numeric_val,20," ");
> if (abs(analytic_val_y) <> 0.0) then # if number 2
> relerr := abserr*100.0/abs(analytic_val_y);
> else
> relerr := -1.0 ;
> fi;# end if 2
> ;
> if glob_iter = 1 then # if number 2
> array_1st_rel_error[1] := relerr;
> else
> array_last_rel_error[1] := relerr;
> fi;# end if 2
> ;
> omniout_float(ALWAYS,"absolute error ",4,abserr,20," ");
> omniout_float(ALWAYS,"relative error ",4,relerr,20,"%");
> omniout_float(ALWAYS,"h ",4,glob_h,20," ");
> #BOTTOM DISPLAY ALOT
> fi;# end if 1
> ;
> # End Function number 3
> end;
display_alot := proc(iter)
local abserr, analytic_val_y, ind_var, numeric_val, relerr, term_no;
global glob_max_terms, DEBUGMASSIVE, glob_iolevel, INFO, DEBUGL, ALWAYS,
glob_normmax, glob_max_trunc_err, glob_look_poles, glob_clock_sec,
glob_almost_1, glob_warned, glob_no_eqs, glob_max_iter, glob_log10_relerr,
sec_in_min, djd_debug2, glob_dump, glob_warned2, glob_small_float,
glob_display_flag, glob_log10normmin, glob_log10relerr, glob_optimal_start,
glob_abserr, glob_dump_analytic, glob_large_float, centuries_in_millinium,
days_in_year, glob_iter, glob_unchanged_h_cnt, glob_hmax, glob_initial_pass,
glob_hmin, glob_h, glob_reached_optimal_h, glob_not_yet_finished,
glob_max_minutes, glob_orig_start_sec, glob_max_rel_trunc_err,
glob_log10_abserr, glob_optimal_done, min_in_hour, glob_curr_iter_when_opt,
glob_start, glob_smallish_float, glob_not_yet_start_msg, hours_in_day,
djd_debug, glob_max_opt_iter, glob_html_log, glob_log10abserr, glob_max_sec,
glob_clock_start_sec, glob_optimal_expect_sec, glob_percent_done,
MAX_UNCHANGED, glob_current_iter, glob_optimal_clock_start_sec, glob_relerr,
glob_last_good_h, glob_disp_incr, years_in_century, glob_subiter_method,
glob_max_hours, glob_hmin_init, array_const_0D0, array_const_1, array_log,
array_last_rel_error, array_pole, array_type_pole, array_norms,
array_y_init, array_1st_rel_error, array_y, array_x, array_m1, array_tmp0,
array_tmp1, array_y_higher_work2, array_real_pole, array_y_higher,
array_y_set_initial, array_poles, array_complex_pole, array_y_higher_work,
glob_last;
if 0 <= iter then
ind_var := array_x[1];
omniout_float(ALWAYS, "x[1] ", 33,
ind_var, 20, " ");
analytic_val_y := exact_soln_y(ind_var);
omniout_float(ALWAYS, "y[1] (analytic) ", 33,
analytic_val_y, 20, " ");
term_no := 1;
numeric_val := array_y[term_no];
abserr := abs(numeric_val - analytic_val_y);
omniout_float(ALWAYS, "y[1] (numeric) ", 33,
numeric_val, 20, " ");
if abs(analytic_val_y) <> 0. then
relerr := abserr*100.0/abs(analytic_val_y)
else relerr := -1.0
end if;
if glob_iter = 1 then array_1st_rel_error[1] := relerr
else array_last_rel_error[1] := relerr
end if;
omniout_float(ALWAYS, "absolute error ", 4,
abserr, 20, " ");
omniout_float(ALWAYS, "relative error ", 4,
relerr, 20, "%");
omniout_float(ALWAYS, "h ", 4,
glob_h, 20, " ")
end if
end proc
> # Begin Function number 4
> adjust_for_pole := proc(h_param)
> global
> glob_max_terms,
> DEBUGMASSIVE,
> glob_iolevel,
> INFO,
> DEBUGL,
> ALWAYS,
> #Top Generate Globals Decl
> glob_normmax,
> glob_max_trunc_err,
> glob_look_poles,
> glob_clock_sec,
> glob_almost_1,
> glob_warned,
> glob_no_eqs,
> glob_max_iter,
> glob_log10_relerr,
> sec_in_min,
> djd_debug2,
> glob_dump,
> glob_warned2,
> glob_small_float,
> glob_display_flag,
> glob_log10normmin,
> glob_log10relerr,
> glob_optimal_start,
> glob_abserr,
> glob_dump_analytic,
> glob_large_float,
> centuries_in_millinium,
> days_in_year,
> glob_iter,
> glob_unchanged_h_cnt,
> glob_hmax,
> glob_initial_pass,
> glob_hmin,
> glob_h,
> glob_reached_optimal_h,
> glob_not_yet_finished,
> glob_max_minutes,
> glob_orig_start_sec,
> glob_max_rel_trunc_err,
> glob_log10_abserr,
> glob_optimal_done,
> min_in_hour,
> glob_curr_iter_when_opt,
> glob_start,
> glob_smallish_float,
> glob_not_yet_start_msg,
> hours_in_day,
> djd_debug,
> glob_max_opt_iter,
> glob_html_log,
> glob_log10abserr,
> glob_max_sec,
> glob_clock_start_sec,
> glob_optimal_expect_sec,
> glob_percent_done,
> MAX_UNCHANGED,
> glob_current_iter,
> glob_optimal_clock_start_sec,
> glob_relerr,
> glob_last_good_h,
> glob_disp_incr,
> years_in_century,
> glob_subiter_method,
> glob_max_hours,
> glob_hmin_init,
> #Bottom Generate Globals Decl
> #BEGIN CONST
> array_const_0D0,
> array_const_1,
> #END CONST
> array_log,
> array_last_rel_error,
> array_pole,
> array_type_pole,
> array_norms,
> array_y_init,
> array_1st_rel_error,
> array_y,
> array_x,
> array_m1,
> array_tmp0,
> array_tmp1,
> array_y_higher_work2,
> array_real_pole,
> array_y_higher,
> array_y_set_initial,
> array_poles,
> array_complex_pole,
> array_y_higher_work,
> glob_last;
>
> local hnew, sz2, tmp;
> #TOP ADJUST FOR POLE
>
> hnew := h_param;
> glob_normmax := glob_small_float;
> if (abs(array_y_higher[1,1]) > glob_small_float) then # if number 1
> tmp := abs(array_y_higher[1,1]);
> if (tmp < glob_normmax) then # if number 2
> glob_normmax := tmp;
> fi;# end if 2
> fi;# end if 1
> ;
> if (glob_look_poles and (abs(array_pole[1]) > glob_small_float) and (array_pole[1] <> glob_large_float)) then # if number 1
> sz2 := array_pole[1]/10.0;
> if (sz2 < hnew) then # if number 2
> omniout_float(INFO,"glob_h adjusted to ",20,h_param,12,"due to singularity.");
> omniout_str(INFO,"Reached Optimal");
> newline();
> return(hnew);
> fi;# end if 2
> fi;# end if 1
> ;
> if (not glob_reached_optimal_h) then # if number 1
> glob_reached_optimal_h := true;
> glob_curr_iter_when_opt := glob_current_iter;
> glob_optimal_clock_start_sec := elapsed_time_seconds();
> glob_optimal_start := array_x[1];
> fi;# end if 1
> ;
> hnew := sz2;
> #END block
> #BOTTOM ADJUST FOR POLE
> # End Function number 4
> end;
adjust_for_pole := proc(h_param)
local hnew, sz2, tmp;
global glob_max_terms, DEBUGMASSIVE, glob_iolevel, INFO, DEBUGL, ALWAYS,
glob_normmax, glob_max_trunc_err, glob_look_poles, glob_clock_sec,
glob_almost_1, glob_warned, glob_no_eqs, glob_max_iter, glob_log10_relerr,
sec_in_min, djd_debug2, glob_dump, glob_warned2, glob_small_float,
glob_display_flag, glob_log10normmin, glob_log10relerr, glob_optimal_start,
glob_abserr, glob_dump_analytic, glob_large_float, centuries_in_millinium,
days_in_year, glob_iter, glob_unchanged_h_cnt, glob_hmax, glob_initial_pass,
glob_hmin, glob_h, glob_reached_optimal_h, glob_not_yet_finished,
glob_max_minutes, glob_orig_start_sec, glob_max_rel_trunc_err,
glob_log10_abserr, glob_optimal_done, min_in_hour, glob_curr_iter_when_opt,
glob_start, glob_smallish_float, glob_not_yet_start_msg, hours_in_day,
djd_debug, glob_max_opt_iter, glob_html_log, glob_log10abserr, glob_max_sec,
glob_clock_start_sec, glob_optimal_expect_sec, glob_percent_done,
MAX_UNCHANGED, glob_current_iter, glob_optimal_clock_start_sec, glob_relerr,
glob_last_good_h, glob_disp_incr, years_in_century, glob_subiter_method,
glob_max_hours, glob_hmin_init, array_const_0D0, array_const_1, array_log,
array_last_rel_error, array_pole, array_type_pole, array_norms,
array_y_init, array_1st_rel_error, array_y, array_x, array_m1, array_tmp0,
array_tmp1, array_y_higher_work2, array_real_pole, array_y_higher,
array_y_set_initial, array_poles, array_complex_pole, array_y_higher_work,
glob_last;
hnew := h_param;
glob_normmax := glob_small_float;
if glob_small_float < abs(array_y_higher[1, 1]) then
tmp := abs(array_y_higher[1, 1]);
if tmp < glob_normmax then glob_normmax := tmp end if
end if;
if glob_look_poles and glob_small_float < abs(array_pole[1]) and
array_pole[1] <> glob_large_float then
sz2 := array_pole[1]/10.0;
if sz2 < hnew then
omniout_float(INFO, "glob_h adjusted to ", 20, h_param, 12,
"due to singularity.");
omniout_str(INFO, "Reached Optimal");
newline();
return hnew
end if
end if;
if not glob_reached_optimal_h then
glob_reached_optimal_h := true;
glob_curr_iter_when_opt := glob_current_iter;
glob_optimal_clock_start_sec := elapsed_time_seconds();
glob_optimal_start := array_x[1]
end if;
hnew := sz2
end proc
> # Begin Function number 5
> prog_report := proc(x_start,x_end)
> global
> glob_max_terms,
> DEBUGMASSIVE,
> glob_iolevel,
> INFO,
> DEBUGL,
> ALWAYS,
> #Top Generate Globals Decl
> glob_normmax,
> glob_max_trunc_err,
> glob_look_poles,
> glob_clock_sec,
> glob_almost_1,
> glob_warned,
> glob_no_eqs,
> glob_max_iter,
> glob_log10_relerr,
> sec_in_min,
> djd_debug2,
> glob_dump,
> glob_warned2,
> glob_small_float,
> glob_display_flag,
> glob_log10normmin,
> glob_log10relerr,
> glob_optimal_start,
> glob_abserr,
> glob_dump_analytic,
> glob_large_float,
> centuries_in_millinium,
> days_in_year,
> glob_iter,
> glob_unchanged_h_cnt,
> glob_hmax,
> glob_initial_pass,
> glob_hmin,
> glob_h,
> glob_reached_optimal_h,
> glob_not_yet_finished,
> glob_max_minutes,
> glob_orig_start_sec,
> glob_max_rel_trunc_err,
> glob_log10_abserr,
> glob_optimal_done,
> min_in_hour,
> glob_curr_iter_when_opt,
> glob_start,
> glob_smallish_float,
> glob_not_yet_start_msg,
> hours_in_day,
> djd_debug,
> glob_max_opt_iter,
> glob_html_log,
> glob_log10abserr,
> glob_max_sec,
> glob_clock_start_sec,
> glob_optimal_expect_sec,
> glob_percent_done,
> MAX_UNCHANGED,
> glob_current_iter,
> glob_optimal_clock_start_sec,
> glob_relerr,
> glob_last_good_h,
> glob_disp_incr,
> years_in_century,
> glob_subiter_method,
> glob_max_hours,
> glob_hmin_init,
> #Bottom Generate Globals Decl
> #BEGIN CONST
> array_const_0D0,
> array_const_1,
> #END CONST
> array_log,
> array_last_rel_error,
> array_pole,
> array_type_pole,
> array_norms,
> array_y_init,
> array_1st_rel_error,
> array_y,
> array_x,
> array_m1,
> array_tmp0,
> array_tmp1,
> array_y_higher_work2,
> array_real_pole,
> array_y_higher,
> array_y_set_initial,
> array_poles,
> array_complex_pole,
> array_y_higher_work,
> glob_last;
>
> local clock_sec, opt_clock_sec, clock_sec1, expect_sec, left_sec, percent_done, total_clock_sec;
> #TOP PROGRESS REPORT
> clock_sec1 := elapsed_time_seconds();
> total_clock_sec := convfloat(clock_sec1) - convfloat(glob_orig_start_sec);
> glob_clock_sec := convfloat(clock_sec1) - convfloat(glob_clock_start_sec);
> left_sec := convfloat(glob_max_sec) + convfloat(glob_orig_start_sec) - convfloat(clock_sec1);
> expect_sec := comp_expect_sec(convfloat(x_end),convfloat(x_start),convfloat(array_x[1]) + convfloat(glob_h) ,convfloat( clock_sec1) - convfloat(glob_orig_start_sec));
> opt_clock_sec := convfloat( clock_sec1) - convfloat(glob_optimal_clock_start_sec);
> glob_optimal_expect_sec := comp_expect_sec(convfloat(x_end),convfloat(x_start),convfloat(array_x[1]) +convfloat( glob_h) ,convfloat( opt_clock_sec));
> percent_done := comp_percent(convfloat(x_end),convfloat(x_start),convfloat(array_x[1]) + convfloat(glob_h));
> glob_percent_done := percent_done;
> omniout_str_noeol(INFO,"Total Elapsed Time ");
> omniout_timestr(convfloat(total_clock_sec));
> omniout_str_noeol(INFO,"Elapsed Time(since restart) ");
> omniout_timestr(convfloat(glob_clock_sec));
> if convfloat(percent_done) < convfloat(100.0) then # if number 1
> omniout_str_noeol(INFO,"Expected Time Remaining ");
> omniout_timestr(convfloat(expect_sec));
> omniout_str_noeol(INFO,"Optimized Time Remaining ");
> omniout_timestr(convfloat(glob_optimal_expect_sec));
> fi;# end if 1
> ;
> omniout_str_noeol(INFO,"Time to Timeout ");
> omniout_timestr(convfloat(left_sec));
> omniout_float(INFO, "Percent Done ",33,percent_done,4,"%");
> #BOTTOM PROGRESS REPORT
> # End Function number 5
> end;
prog_report := proc(x_start, x_end)
local clock_sec, opt_clock_sec, clock_sec1, expect_sec, left_sec,
percent_done, total_clock_sec;
global glob_max_terms, DEBUGMASSIVE, glob_iolevel, INFO, DEBUGL, ALWAYS,
glob_normmax, glob_max_trunc_err, glob_look_poles, glob_clock_sec,
glob_almost_1, glob_warned, glob_no_eqs, glob_max_iter, glob_log10_relerr,
sec_in_min, djd_debug2, glob_dump, glob_warned2, glob_small_float,
glob_display_flag, glob_log10normmin, glob_log10relerr, glob_optimal_start,
glob_abserr, glob_dump_analytic, glob_large_float, centuries_in_millinium,
days_in_year, glob_iter, glob_unchanged_h_cnt, glob_hmax, glob_initial_pass,
glob_hmin, glob_h, glob_reached_optimal_h, glob_not_yet_finished,
glob_max_minutes, glob_orig_start_sec, glob_max_rel_trunc_err,
glob_log10_abserr, glob_optimal_done, min_in_hour, glob_curr_iter_when_opt,
glob_start, glob_smallish_float, glob_not_yet_start_msg, hours_in_day,
djd_debug, glob_max_opt_iter, glob_html_log, glob_log10abserr, glob_max_sec,
glob_clock_start_sec, glob_optimal_expect_sec, glob_percent_done,
MAX_UNCHANGED, glob_current_iter, glob_optimal_clock_start_sec, glob_relerr,
glob_last_good_h, glob_disp_incr, years_in_century, glob_subiter_method,
glob_max_hours, glob_hmin_init, array_const_0D0, array_const_1, array_log,
array_last_rel_error, array_pole, array_type_pole, array_norms,
array_y_init, array_1st_rel_error, array_y, array_x, array_m1, array_tmp0,
array_tmp1, array_y_higher_work2, array_real_pole, array_y_higher,
array_y_set_initial, array_poles, array_complex_pole, array_y_higher_work,
glob_last;
clock_sec1 := elapsed_time_seconds();
total_clock_sec :=
convfloat(clock_sec1) - convfloat(glob_orig_start_sec);
glob_clock_sec :=
convfloat(clock_sec1) - convfloat(glob_clock_start_sec);
left_sec := convfloat(glob_max_sec) + convfloat(glob_orig_start_sec)
- convfloat(clock_sec1);
expect_sec := comp_expect_sec(convfloat(x_end), convfloat(x_start),
convfloat(array_x[1]) + convfloat(glob_h),
convfloat(clock_sec1) - convfloat(glob_orig_start_sec));
opt_clock_sec :=
convfloat(clock_sec1) - convfloat(glob_optimal_clock_start_sec);
glob_optimal_expect_sec := comp_expect_sec(convfloat(x_end),
convfloat(x_start), convfloat(array_x[1]) + convfloat(glob_h),
convfloat(opt_clock_sec));
percent_done := comp_percent(convfloat(x_end), convfloat(x_start),
convfloat(array_x[1]) + convfloat(glob_h));
glob_percent_done := percent_done;
omniout_str_noeol(INFO, "Total Elapsed Time ");
omniout_timestr(convfloat(total_clock_sec));
omniout_str_noeol(INFO, "Elapsed Time(since restart) ");
omniout_timestr(convfloat(glob_clock_sec));
if convfloat(percent_done) < convfloat(100.0) then
omniout_str_noeol(INFO, "Expected Time Remaining ");
omniout_timestr(convfloat(expect_sec));
omniout_str_noeol(INFO, "Optimized Time Remaining ");
omniout_timestr(convfloat(glob_optimal_expect_sec))
end if;
omniout_str_noeol(INFO, "Time to Timeout ");
omniout_timestr(convfloat(left_sec));
omniout_float(INFO, "Percent Done ", 33,
percent_done, 4, "%")
end proc
> # Begin Function number 6
> check_for_pole := proc()
> global
> glob_max_terms,
> DEBUGMASSIVE,
> glob_iolevel,
> INFO,
> DEBUGL,
> ALWAYS,
> #Top Generate Globals Decl
> glob_normmax,
> glob_max_trunc_err,
> glob_look_poles,
> glob_clock_sec,
> glob_almost_1,
> glob_warned,
> glob_no_eqs,
> glob_max_iter,
> glob_log10_relerr,
> sec_in_min,
> djd_debug2,
> glob_dump,
> glob_warned2,
> glob_small_float,
> glob_display_flag,
> glob_log10normmin,
> glob_log10relerr,
> glob_optimal_start,
> glob_abserr,
> glob_dump_analytic,
> glob_large_float,
> centuries_in_millinium,
> days_in_year,
> glob_iter,
> glob_unchanged_h_cnt,
> glob_hmax,
> glob_initial_pass,
> glob_hmin,
> glob_h,
> glob_reached_optimal_h,
> glob_not_yet_finished,
> glob_max_minutes,
> glob_orig_start_sec,
> glob_max_rel_trunc_err,
> glob_log10_abserr,
> glob_optimal_done,
> min_in_hour,
> glob_curr_iter_when_opt,
> glob_start,
> glob_smallish_float,
> glob_not_yet_start_msg,
> hours_in_day,
> djd_debug,
> glob_max_opt_iter,
> glob_html_log,
> glob_log10abserr,
> glob_max_sec,
> glob_clock_start_sec,
> glob_optimal_expect_sec,
> glob_percent_done,
> MAX_UNCHANGED,
> glob_current_iter,
> glob_optimal_clock_start_sec,
> glob_relerr,
> glob_last_good_h,
> glob_disp_incr,
> years_in_century,
> glob_subiter_method,
> glob_max_hours,
> glob_hmin_init,
> #Bottom Generate Globals Decl
> #BEGIN CONST
> array_const_0D0,
> array_const_1,
> #END CONST
> array_log,
> array_last_rel_error,
> array_pole,
> array_type_pole,
> array_norms,
> array_y_init,
> array_1st_rel_error,
> array_y,
> array_x,
> array_m1,
> array_tmp0,
> array_tmp1,
> array_y_higher_work2,
> array_real_pole,
> array_y_higher,
> array_y_set_initial,
> array_poles,
> array_complex_pole,
> array_y_higher_work,
> glob_last;
>
> local cnt, dr1, dr2, ds1, ds2, hdrc, m, n, nr1, nr2, ord_no, rad_c, rcs, rm0, rm1, rm2, rm3, rm4, found;
> #TOP CHECK FOR POLE
> #IN RADII REAL EQ = 1
> #Computes radius of convergence and r_order of pole from 3 adjacent Taylor series terms. EQUATUON NUMBER 1
> #Applies to pole of arbitrary r_order on the real axis,
> #Due to Prof. George Corliss.
> n := glob_max_terms;
> m := n - 1 - 1;
> while ((m >= 10) and ((abs(array_y_higher[1,m]) < glob_small_float) or (abs(array_y_higher[1,m-1]) < glob_small_float) or (abs(array_y_higher[1,m-2]) < glob_small_float ))) do # do number 2
> m := m - 1;
> od;# end do number 2
> ;
> if (m > 10) then # if number 1
> rm0 := array_y_higher[1,m]/array_y_higher[1,m-1];
> rm1 := array_y_higher[1,m-1]/array_y_higher[1,m-2];
> hdrc := convfloat(m-1)*rm0-convfloat(m-2)*rm1;
> if (abs(hdrc) > glob_small_float) then # if number 2
> rcs := glob_h/hdrc;
> ord_no := convfloat(m-1)*rm0/hdrc - convfloat(m) + 2.0;
> array_real_pole[1,1] := rcs;
> array_real_pole[1,2] := ord_no;
> else
> array_real_pole[1,1] := glob_large_float;
> array_real_pole[1,2] := glob_large_float;
> fi;# end if 2
> else
> array_real_pole[1,1] := glob_large_float;
> array_real_pole[1,2] := glob_large_float;
> fi;# end if 1
> ;
> #BOTTOM RADII REAL EQ = 1
> #TOP RADII COMPLEX EQ = 1
> #Computes radius of convergence for complex conjugate pair of poles.
> #from 6 adjacent Taylor series terms
> #Also computes r_order of poles.
> #Due to Manuel Prieto.
> #With a correction by Dennis J. Darland
> n := glob_max_terms - 1 - 1;
> cnt := 0;
> while ((cnt < 5) and (n >= 10)) do # do number 2
> if (abs(array_y_higher[1,n]) > glob_small_float) then # if number 1
> cnt := cnt + 1;
> else
> cnt := 0;
> fi;# end if 1
> ;
> n := n - 1;
> od;# end do number 2
> ;
> m := n + cnt;
> if (m <= 10) then # if number 1
> array_complex_pole[1,1] := glob_large_float;
> array_complex_pole[1,2] := glob_large_float;
> elif (abs(array_y_higher[1,m]) >= (glob_large_float)) or (abs(array_y_higher[1,m-1]) >=(glob_large_float)) or (abs(array_y_higher[1,m-2]) >= (glob_large_float)) or (abs(array_y_higher[1,m-3]) >= (glob_large_float)) or (abs(array_y_higher[1,m-4]) >= (glob_large_float)) or (abs(array_y_higher[1,m-5]) >= (glob_large_float)) then # if number 2
> array_complex_pole[1,1] := glob_large_float;
> array_complex_pole[1,2] := glob_large_float;
> else
> rm0 := (array_y_higher[1,m])/(array_y_higher[1,m-1]);
> rm1 := (array_y_higher[1,m-1])/(array_y_higher[1,m-2]);
> rm2 := (array_y_higher[1,m-2])/(array_y_higher[1,m-3]);
> rm3 := (array_y_higher[1,m-3])/(array_y_higher[1,m-4]);
> rm4 := (array_y_higher[1,m-4])/(array_y_higher[1,m-5]);
> nr1 := convfloat(m-1)*rm0 - 2.0*convfloat(m-2)*rm1 + convfloat(m-3)*rm2;
> nr2 := convfloat(m-2)*rm1 - 2.0*convfloat(m-3)*rm2 + convfloat(m-4)*rm3;
> dr1 := (-1.0)/rm1 + 2.0/rm2 - 1.0/rm3;
> dr2 := (-1.0)/rm2 + 2.0/rm3 - 1.0/rm4;
> ds1 := 3.0/rm1 - 8.0/rm2 + 5.0/rm3;
> ds2 := 3.0/rm2 - 8.0/rm3 + 5.0/rm4;
> if ((abs(nr1 * dr2 - nr2 * dr1) <= glob_small_float) or (abs(dr1) <= glob_small_float)) then # if number 3
> array_complex_pole[1,1] := glob_large_float;
> array_complex_pole[1,2] := glob_large_float;
> else
> if (abs(nr1*dr2 - nr2 * dr1) > glob_small_float) then # if number 4
> rcs := ((ds1*dr2 - ds2*dr1 +dr1*dr2)/(nr1*dr2 - nr2 * dr1));
> #(Manuels) rcs := (ds1*dr2 - ds2*dr1)/(nr1*dr2 - nr2 * dr1)
> ord_no := (rcs*nr1 - ds1)/(2.0*dr1) -convfloat(m)/2.0;
> if (abs(rcs) > glob_small_float) then # if number 5
> if (rcs > 0.0) then # if number 6
> rad_c := sqrt(rcs) * glob_h;
> else
> rad_c := glob_large_float;
> fi;# end if 6
> else
> rad_c := glob_large_float;
> ord_no := glob_large_float;
> fi;# end if 5
> else
> rad_c := glob_large_float;
> ord_no := glob_large_float;
> fi;# end if 4
> fi;# end if 3
> ;
> array_complex_pole[1,1] := rad_c;
> array_complex_pole[1,2] := ord_no;
> fi;# end if 2
> ;
> #BOTTOM RADII COMPLEX EQ = 1
> found := false;
> #TOP WHICH RADII EQ = 1
> if not found and ((array_real_pole[1,1] = glob_large_float) or (array_real_pole[1,2] = glob_large_float)) and ((array_complex_pole[1,1] <> glob_large_float) and (array_complex_pole[1,2] <> glob_large_float)) and ((array_complex_pole[1,1] > 0.0) and (array_complex_pole[1,2] > 0.0)) then # if number 2
> array_poles[1,1] := array_complex_pole[1,1];
> array_poles[1,2] := array_complex_pole[1,2];
> found := true;
> array_type_pole[1] := 2;
> if (glob_display_flag) then # if number 3
> omniout_str(ALWAYS,"Complex estimate of poles used");
> fi;# end if 3
> ;
> fi;# end if 2
> ;
> if not found and ((array_real_pole[1,1] <> glob_large_float) and (array_real_pole[1,2] <> glob_large_float) and (array_real_pole[1,1] > 0.0) and (array_real_pole[1,2] > 0.0) and ((array_complex_pole[1,1] = glob_large_float) or (array_complex_pole[1,2] = glob_large_float) or (array_complex_pole[1,1] <= 0.0 ) or (array_complex_pole[1,2] <= 0.0))) then # if number 2
> array_poles[1,1] := array_real_pole[1,1];
> array_poles[1,2] := array_real_pole[1,2];
> found := true;
> array_type_pole[1] := 1;
> if (glob_display_flag) then # if number 3
> omniout_str(ALWAYS,"Real estimate of pole used");
> fi;# end if 3
> ;
> fi;# end if 2
> ;
> if not found and (((array_real_pole[1,1] = glob_large_float) or (array_real_pole[1,2] = glob_large_float)) and ((array_complex_pole[1,1] = glob_large_float) or (array_complex_pole[1,2] = glob_large_float))) then # if number 2
> array_poles[1,1] := glob_large_float;
> array_poles[1,2] := glob_large_float;
> found := true;
> array_type_pole[1] := 3;
> if (glob_display_flag) then # if number 3
> omniout_str(ALWAYS,"NO POLE");
> fi;# end if 3
> ;
> fi;# end if 2
> ;
> if not found and ((array_real_pole[1,1] < array_complex_pole[1,1]) and (array_real_pole[1,1] > 0.0) and (array_real_pole[1,2] > 0.0)) then # if number 2
> array_poles[1,1] := array_real_pole[1,1];
> array_poles[1,2] := array_real_pole[1,2];
> found := true;
> array_type_pole[1] := 1;
> if (glob_display_flag) then # if number 3
> omniout_str(ALWAYS,"Real estimate of pole used");
> fi;# end if 3
> ;
> fi;# end if 2
> ;
> if not found and ((array_complex_pole[1,1] <> glob_large_float) and (array_complex_pole[1,2] <> glob_large_float) and (array_complex_pole[1,1] > 0.0) and (array_complex_pole[1,2] > 0.0)) then # if number 2
> array_poles[1,1] := array_complex_pole[1,1];
> array_poles[1,2] := array_complex_pole[1,2];
> array_type_pole[1] := 2;
> found := true;
> if (glob_display_flag) then # if number 3
> omniout_str(ALWAYS,"Complex estimate of poles used");
> fi;# end if 3
> ;
> fi;# end if 2
> ;
> if not found then # if number 2
> array_poles[1,1] := glob_large_float;
> array_poles[1,2] := glob_large_float;
> array_type_pole[1] := 3;
> if (glob_display_flag) then # if number 3
> omniout_str(ALWAYS,"NO POLE");
> fi;# end if 3
> ;
> fi;# end if 2
> ;
> #BOTTOM WHICH RADII EQ = 1
> array_pole[1] := glob_large_float;
> array_pole[2] := glob_large_float;
> #TOP WHICH RADIUS EQ = 1
> if array_pole[1] > array_poles[1,1] then # if number 2
> array_pole[1] := array_poles[1,1];
> array_pole[2] := array_poles[1,2];
> fi;# end if 2
> ;
> #BOTTOM WHICH RADIUS EQ = 1
> #BOTTOM CHECK FOR POLE
> display_pole();
> # End Function number 6
> end;
check_for_pole := proc()
local cnt, dr1, dr2, ds1, ds2, hdrc, m, n, nr1, nr2, ord_no, rad_c, rcs,
rm0, rm1, rm2, rm3, rm4, found;
global glob_max_terms, DEBUGMASSIVE, glob_iolevel, INFO, DEBUGL, ALWAYS,
glob_normmax, glob_max_trunc_err, glob_look_poles, glob_clock_sec,
glob_almost_1, glob_warned, glob_no_eqs, glob_max_iter, glob_log10_relerr,
sec_in_min, djd_debug2, glob_dump, glob_warned2, glob_small_float,
glob_display_flag, glob_log10normmin, glob_log10relerr, glob_optimal_start,
glob_abserr, glob_dump_analytic, glob_large_float, centuries_in_millinium,
days_in_year, glob_iter, glob_unchanged_h_cnt, glob_hmax, glob_initial_pass,
glob_hmin, glob_h, glob_reached_optimal_h, glob_not_yet_finished,
glob_max_minutes, glob_orig_start_sec, glob_max_rel_trunc_err,
glob_log10_abserr, glob_optimal_done, min_in_hour, glob_curr_iter_when_opt,
glob_start, glob_smallish_float, glob_not_yet_start_msg, hours_in_day,
djd_debug, glob_max_opt_iter, glob_html_log, glob_log10abserr, glob_max_sec,
glob_clock_start_sec, glob_optimal_expect_sec, glob_percent_done,
MAX_UNCHANGED, glob_current_iter, glob_optimal_clock_start_sec, glob_relerr,
glob_last_good_h, glob_disp_incr, years_in_century, glob_subiter_method,
glob_max_hours, glob_hmin_init, array_const_0D0, array_const_1, array_log,
array_last_rel_error, array_pole, array_type_pole, array_norms,
array_y_init, array_1st_rel_error, array_y, array_x, array_m1, array_tmp0,
array_tmp1, array_y_higher_work2, array_real_pole, array_y_higher,
array_y_set_initial, array_poles, array_complex_pole, array_y_higher_work,
glob_last;
n := glob_max_terms;
m := n - 2;
while 10 <= m and (abs(array_y_higher[1, m]) < glob_small_float or
abs(array_y_higher[1, m - 1]) < glob_small_float or
abs(array_y_higher[1, m - 2]) < glob_small_float) do m := m - 1
end do;
if 10 < m then
rm0 := array_y_higher[1, m]/array_y_higher[1, m - 1];
rm1 := array_y_higher[1, m - 1]/array_y_higher[1, m - 2];
hdrc := convfloat(m - 1)*rm0 - convfloat(m - 2)*rm1;
if glob_small_float < abs(hdrc) then
rcs := glob_h/hdrc;
ord_no := convfloat(m - 1)*rm0/hdrc - convfloat(m) + 2.0;
array_real_pole[1, 1] := rcs;
array_real_pole[1, 2] := ord_no
else
array_real_pole[1, 1] := glob_large_float;
array_real_pole[1, 2] := glob_large_float
end if
else
array_real_pole[1, 1] := glob_large_float;
array_real_pole[1, 2] := glob_large_float
end if;
n := glob_max_terms - 2;
cnt := 0;
while cnt < 5 and 10 <= n do
if glob_small_float < abs(array_y_higher[1, n]) then cnt := cnt + 1
else cnt := 0
end if;
n := n - 1
end do;
m := n + cnt;
if m <= 10 then
array_complex_pole[1, 1] := glob_large_float;
array_complex_pole[1, 2] := glob_large_float
elif glob_large_float <= abs(array_y_higher[1, m]) or
glob_large_float <= abs(array_y_higher[1, m - 1]) or
glob_large_float <= abs(array_y_higher[1, m - 2]) or
glob_large_float <= abs(array_y_higher[1, m - 3]) or
glob_large_float <= abs(array_y_higher[1, m - 4]) or
glob_large_float <= abs(array_y_higher[1, m - 5]) then
array_complex_pole[1, 1] := glob_large_float;
array_complex_pole[1, 2] := glob_large_float
else
rm0 := array_y_higher[1, m]/array_y_higher[1, m - 1];
rm1 := array_y_higher[1, m - 1]/array_y_higher[1, m - 2];
rm2 := array_y_higher[1, m - 2]/array_y_higher[1, m - 3];
rm3 := array_y_higher[1, m - 3]/array_y_higher[1, m - 4];
rm4 := array_y_higher[1, m - 4]/array_y_higher[1, m - 5];
nr1 := convfloat(m - 1)*rm0 - 2.0*convfloat(m - 2)*rm1
+ convfloat(m - 3)*rm2;
nr2 := convfloat(m - 2)*rm1 - 2.0*convfloat(m - 3)*rm2
+ convfloat(m - 4)*rm3;
dr1 := (-1)*(1.0)/rm1 + 2.0/rm2 - 1.0/rm3;
dr2 := (-1)*(1.0)/rm2 + 2.0/rm3 - 1.0/rm4;
ds1 := 3.0/rm1 - 8.0/rm2 + 5.0/rm3;
ds2 := 3.0/rm2 - 8.0/rm3 + 5.0/rm4;
if abs(nr1*dr2 - nr2*dr1) <= glob_small_float or
abs(dr1) <= glob_small_float then
array_complex_pole[1, 1] := glob_large_float;
array_complex_pole[1, 2] := glob_large_float
else
if glob_small_float < abs(nr1*dr2 - nr2*dr1) then
rcs := (ds1*dr2 - ds2*dr1 + dr1*dr2)/(nr1*dr2 - nr2*dr1);
ord_no := (rcs*nr1 - ds1)/(2.0*dr1) - convfloat(m)/2.0;
if glob_small_float < abs(rcs) then
if 0. < rcs then rad_c := sqrt(rcs)*glob_h
else rad_c := glob_large_float
end if
else rad_c := glob_large_float; ord_no := glob_large_float
end if
else rad_c := glob_large_float; ord_no := glob_large_float
end if
end if;
array_complex_pole[1, 1] := rad_c;
array_complex_pole[1, 2] := ord_no
end if;
found := false;
if not found and (array_real_pole[1, 1] = glob_large_float or
array_real_pole[1, 2] = glob_large_float) and
array_complex_pole[1, 1] <> glob_large_float and
array_complex_pole[1, 2] <> glob_large_float and
0. < array_complex_pole[1, 1] and 0. < array_complex_pole[1, 2] then
array_poles[1, 1] := array_complex_pole[1, 1];
array_poles[1, 2] := array_complex_pole[1, 2];
found := true;
array_type_pole[1] := 2;
if glob_display_flag then
omniout_str(ALWAYS, "Complex estimate of poles used")
end if
end if;
if not found and array_real_pole[1, 1] <> glob_large_float and
array_real_pole[1, 2] <> glob_large_float and
0. < array_real_pole[1, 1] and 0. < array_real_pole[1, 2] and (
array_complex_pole[1, 1] = glob_large_float or
array_complex_pole[1, 2] = glob_large_float or
array_complex_pole[1, 1] <= 0. or array_complex_pole[1, 2] <= 0.) then
array_poles[1, 1] := array_real_pole[1, 1];
array_poles[1, 2] := array_real_pole[1, 2];
found := true;
array_type_pole[1] := 1;
if glob_display_flag then
omniout_str(ALWAYS, "Real estimate of pole used")
end if
end if;
if not found and (array_real_pole[1, 1] = glob_large_float or
array_real_pole[1, 2] = glob_large_float) and (
array_complex_pole[1, 1] = glob_large_float or
array_complex_pole[1, 2] = glob_large_float) then
array_poles[1, 1] := glob_large_float;
array_poles[1, 2] := glob_large_float;
found := true;
array_type_pole[1] := 3;
if glob_display_flag then omniout_str(ALWAYS, "NO POLE") end if
end if;
if not found and array_real_pole[1, 1] < array_complex_pole[1, 1] and
0. < array_real_pole[1, 1] and 0. < array_real_pole[1, 2] then
array_poles[1, 1] := array_real_pole[1, 1];
array_poles[1, 2] := array_real_pole[1, 2];
found := true;
array_type_pole[1] := 1;
if glob_display_flag then
omniout_str(ALWAYS, "Real estimate of pole used")
end if
end if;
if not found and array_complex_pole[1, 1] <> glob_large_float and
array_complex_pole[1, 2] <> glob_large_float and
0. < array_complex_pole[1, 1] and 0. < array_complex_pole[1, 2] then
array_poles[1, 1] := array_complex_pole[1, 1];
array_poles[1, 2] := array_complex_pole[1, 2];
array_type_pole[1] := 2;
found := true;
if glob_display_flag then
omniout_str(ALWAYS, "Complex estimate of poles used")
end if
end if;
if not found then
array_poles[1, 1] := glob_large_float;
array_poles[1, 2] := glob_large_float;
array_type_pole[1] := 3;
if glob_display_flag then omniout_str(ALWAYS, "NO POLE") end if
end if;
array_pole[1] := glob_large_float;
array_pole[2] := glob_large_float;
if array_poles[1, 1] < array_pole[1] then
array_pole[1] := array_poles[1, 1];
array_pole[2] := array_poles[1, 2]
end if;
display_pole()
end proc
> # Begin Function number 7
> get_norms := proc()
> global
> glob_max_terms,
> DEBUGMASSIVE,
> glob_iolevel,
> INFO,
> DEBUGL,
> ALWAYS,
> #Top Generate Globals Decl
> glob_normmax,
> glob_max_trunc_err,
> glob_look_poles,
> glob_clock_sec,
> glob_almost_1,
> glob_warned,
> glob_no_eqs,
> glob_max_iter,
> glob_log10_relerr,
> sec_in_min,
> djd_debug2,
> glob_dump,
> glob_warned2,
> glob_small_float,
> glob_display_flag,
> glob_log10normmin,
> glob_log10relerr,
> glob_optimal_start,
> glob_abserr,
> glob_dump_analytic,
> glob_large_float,
> centuries_in_millinium,
> days_in_year,
> glob_iter,
> glob_unchanged_h_cnt,
> glob_hmax,
> glob_initial_pass,
> glob_hmin,
> glob_h,
> glob_reached_optimal_h,
> glob_not_yet_finished,
> glob_max_minutes,
> glob_orig_start_sec,
> glob_max_rel_trunc_err,
> glob_log10_abserr,
> glob_optimal_done,
> min_in_hour,
> glob_curr_iter_when_opt,
> glob_start,
> glob_smallish_float,
> glob_not_yet_start_msg,
> hours_in_day,
> djd_debug,
> glob_max_opt_iter,
> glob_html_log,
> glob_log10abserr,
> glob_max_sec,
> glob_clock_start_sec,
> glob_optimal_expect_sec,
> glob_percent_done,
> MAX_UNCHANGED,
> glob_current_iter,
> glob_optimal_clock_start_sec,
> glob_relerr,
> glob_last_good_h,
> glob_disp_incr,
> years_in_century,
> glob_subiter_method,
> glob_max_hours,
> glob_hmin_init,
> #Bottom Generate Globals Decl
> #BEGIN CONST
> array_const_0D0,
> array_const_1,
> #END CONST
> array_log,
> array_last_rel_error,
> array_pole,
> array_type_pole,
> array_norms,
> array_y_init,
> array_1st_rel_error,
> array_y,
> array_x,
> array_m1,
> array_tmp0,
> array_tmp1,
> array_y_higher_work2,
> array_real_pole,
> array_y_higher,
> array_y_set_initial,
> array_poles,
> array_complex_pole,
> array_y_higher_work,
> glob_last;
>
> local iii;
> if (not glob_initial_pass) then # if number 2
> set_z(array_norms,glob_max_terms+1);
> #TOP GET NORMS
> iii := 1;
> while (iii <= glob_max_terms) do # do number 2
> if (abs(array_y[iii]) > array_norms[iii]) then # if number 3
> array_norms[iii] := abs(array_y[iii]);
> fi;# end if 3
> ;
> iii := iii + 1;
> od;# end do number 2
> #GET NORMS
> ;
> fi;# end if 2
> ;
> # End Function number 7
> end;
get_norms := proc()
local iii;
global glob_max_terms, DEBUGMASSIVE, glob_iolevel, INFO, DEBUGL, ALWAYS,
glob_normmax, glob_max_trunc_err, glob_look_poles, glob_clock_sec,
glob_almost_1, glob_warned, glob_no_eqs, glob_max_iter, glob_log10_relerr,
sec_in_min, djd_debug2, glob_dump, glob_warned2, glob_small_float,
glob_display_flag, glob_log10normmin, glob_log10relerr, glob_optimal_start,
glob_abserr, glob_dump_analytic, glob_large_float, centuries_in_millinium,
days_in_year, glob_iter, glob_unchanged_h_cnt, glob_hmax, glob_initial_pass,
glob_hmin, glob_h, glob_reached_optimal_h, glob_not_yet_finished,
glob_max_minutes, glob_orig_start_sec, glob_max_rel_trunc_err,
glob_log10_abserr, glob_optimal_done, min_in_hour, glob_curr_iter_when_opt,
glob_start, glob_smallish_float, glob_not_yet_start_msg, hours_in_day,
djd_debug, glob_max_opt_iter, glob_html_log, glob_log10abserr, glob_max_sec,
glob_clock_start_sec, glob_optimal_expect_sec, glob_percent_done,
MAX_UNCHANGED, glob_current_iter, glob_optimal_clock_start_sec, glob_relerr,
glob_last_good_h, glob_disp_incr, years_in_century, glob_subiter_method,
glob_max_hours, glob_hmin_init, array_const_0D0, array_const_1, array_log,
array_last_rel_error, array_pole, array_type_pole, array_norms,
array_y_init, array_1st_rel_error, array_y, array_x, array_m1, array_tmp0,
array_tmp1, array_y_higher_work2, array_real_pole, array_y_higher,
array_y_set_initial, array_poles, array_complex_pole, array_y_higher_work,
glob_last;
if not glob_initial_pass then
set_z(array_norms, glob_max_terms + 1);
iii := 1;
while iii <= glob_max_terms do
if array_norms[iii] < abs(array_y[iii]) then
array_norms[iii] := abs(array_y[iii])
end if;
iii := iii + 1
end do
end if
end proc
> # Begin Function number 8
> atomall := proc()
> global
> glob_max_terms,
> DEBUGMASSIVE,
> glob_iolevel,
> INFO,
> DEBUGL,
> ALWAYS,
> #Top Generate Globals Decl
> glob_normmax,
> glob_max_trunc_err,
> glob_look_poles,
> glob_clock_sec,
> glob_almost_1,
> glob_warned,
> glob_no_eqs,
> glob_max_iter,
> glob_log10_relerr,
> sec_in_min,
> djd_debug2,
> glob_dump,
> glob_warned2,
> glob_small_float,
> glob_display_flag,
> glob_log10normmin,
> glob_log10relerr,
> glob_optimal_start,
> glob_abserr,
> glob_dump_analytic,
> glob_large_float,
> centuries_in_millinium,
> days_in_year,
> glob_iter,
> glob_unchanged_h_cnt,
> glob_hmax,
> glob_initial_pass,
> glob_hmin,
> glob_h,
> glob_reached_optimal_h,
> glob_not_yet_finished,
> glob_max_minutes,
> glob_orig_start_sec,
> glob_max_rel_trunc_err,
> glob_log10_abserr,
> glob_optimal_done,
> min_in_hour,
> glob_curr_iter_when_opt,
> glob_start,
> glob_smallish_float,
> glob_not_yet_start_msg,
> hours_in_day,
> djd_debug,
> glob_max_opt_iter,
> glob_html_log,
> glob_log10abserr,
> glob_max_sec,
> glob_clock_start_sec,
> glob_optimal_expect_sec,
> glob_percent_done,
> MAX_UNCHANGED,
> glob_current_iter,
> glob_optimal_clock_start_sec,
> glob_relerr,
> glob_last_good_h,
> glob_disp_incr,
> years_in_century,
> glob_subiter_method,
> glob_max_hours,
> glob_hmin_init,
> #Bottom Generate Globals Decl
> #BEGIN CONST
> array_const_0D0,
> array_const_1,
> #END CONST
> array_log,
> array_last_rel_error,
> array_pole,
> array_type_pole,
> array_norms,
> array_y_init,
> array_1st_rel_error,
> array_y,
> array_x,
> array_m1,
> array_tmp0,
> array_tmp1,
> array_y_higher_work2,
> array_real_pole,
> array_y_higher,
> array_y_set_initial,
> array_poles,
> array_complex_pole,
> array_y_higher_work,
> glob_last;
>
> local kkk, order_d, adj2, temporary, term;
> #TOP ATOMALL
> #END OUTFILE1
> #BEGIN ATOMHDR1
> #emit pre add $eq_no = 1 i = 1
> array_tmp1[1] := array_const_0D0[1] + array_x[1];
> #emit pre assign xxx $eq_no = 1 i = 1 $min_hdrs = 5
> if not array_y_set_initial[1,2] then # if number 1
> if (1 <= glob_max_terms) then # if number 2
> temporary := array_tmp1[1] * (glob_h ^ (1)) * factorial_3(0,1);
> array_y[2] := temporary;
> array_y_higher[1,2] := temporary;
> temporary := temporary / glob_h * (2.0);
> array_y_higher[2,1] := temporary
> ;
> fi;# end if 2
> ;
> fi;# end if 1
> ;
> kkk := 2;
> #END ATOMHDR1
> #BEGIN ATOMHDR2
> #emit pre add $eq_no = 1 i = 2
> array_tmp1[2] := array_const_0D0[2] + array_x[2];
> #emit pre assign xxx $eq_no = 1 i = 2 $min_hdrs = 5
> if not array_y_set_initial[1,3] then # if number 1
> if (2 <= glob_max_terms) then # if number 2
> temporary := array_tmp1[2] * (glob_h ^ (1)) * factorial_3(1,2);
> array_y[3] := temporary;
> array_y_higher[1,3] := temporary;
> temporary := temporary / glob_h * (2.0);
> array_y_higher[2,2] := temporary
> ;
> fi;# end if 2
> ;
> fi;# end if 1
> ;
> kkk := 3;
> #END ATOMHDR2
> #BEGIN ATOMHDR3
> #emit pre add $eq_no = 1 i = 3
> array_tmp1[3] := array_const_0D0[3] + array_x[3];
> #emit pre assign xxx $eq_no = 1 i = 3 $min_hdrs = 5
> if not array_y_set_initial[1,4] then # if number 1
> if (3 <= glob_max_terms) then # if number 2
> temporary := array_tmp1[3] * (glob_h ^ (1)) * factorial_3(2,3);
> array_y[4] := temporary;
> array_y_higher[1,4] := temporary;
> temporary := temporary / glob_h * (2.0);
> array_y_higher[2,3] := temporary
> ;
> fi;# end if 2
> ;
> fi;# end if 1
> ;
> kkk := 4;
> #END ATOMHDR3
> #BEGIN ATOMHDR4
> #emit pre add $eq_no = 1 i = 4
> array_tmp1[4] := array_const_0D0[4] + array_x[4];
> #emit pre assign xxx $eq_no = 1 i = 4 $min_hdrs = 5
> if not array_y_set_initial[1,5] then # if number 1
> if (4 <= glob_max_terms) then # if number 2
> temporary := array_tmp1[4] * (glob_h ^ (1)) * factorial_3(3,4);
> array_y[5] := temporary;
> array_y_higher[1,5] := temporary;
> temporary := temporary / glob_h * (2.0);
> array_y_higher[2,4] := temporary
> ;
> fi;# end if 2
> ;
> fi;# end if 1
> ;
> kkk := 5;
> #END ATOMHDR4
> #BEGIN ATOMHDR5
> #emit pre add $eq_no = 1 i = 5
> array_tmp1[5] := array_const_0D0[5] + array_x[5];
> #emit pre assign xxx $eq_no = 1 i = 5 $min_hdrs = 5
> if not array_y_set_initial[1,6] then # if number 1
> if (5 <= glob_max_terms) then # if number 2
> temporary := array_tmp1[5] * (glob_h ^ (1)) * factorial_3(4,5);
> array_y[6] := temporary;
> array_y_higher[1,6] := temporary;
> temporary := temporary / glob_h * (2.0);
> array_y_higher[2,5] := temporary
> ;
> fi;# end if 2
> ;
> fi;# end if 1
> ;
> kkk := 6;
> #END ATOMHDR5
> #BEGIN OUTFILE3
> #Top Atomall While Loop-- outfile3
> while (kkk <= glob_max_terms) do # do number 1
> #END OUTFILE3
> #BEGIN OUTFILE4
> #emit add $eq_no = 1
> array_tmp1[kkk] := array_const_0D0[kkk] + array_x[kkk];
> #emit assign $eq_no = 1
> order_d := 1;
> if (kkk + order_d + 1 <= glob_max_terms) then # if number 1
> if not array_y_set_initial[1,kkk + order_d] then # if number 2
> temporary := array_tmp1[kkk] * (glob_h ^ (order_d)) / factorial_3((kkk - 1),(kkk + order_d - 1));
> array_y[kkk + order_d] := temporary;
> array_y_higher[1,kkk + order_d] := temporary;
> term := kkk + order_d - 1;
> adj2 := 2;
> while (adj2 <= order_d + 1) and (term >= 1) do # do number 2
> temporary := temporary / glob_h * convfp(adj2);
> array_y_higher[adj2,term] := temporary;
> adj2 := adj2 + 1;
> term := term - 1;
> od;# end do number 2
> fi;# end if 2
> fi;# end if 1
> ;
> kkk := kkk + 1;
> od;# end do number 1
> ;
> #BOTTOM ATOMALL
> #END OUTFILE4
> #BEGIN OUTFILE5
> # End Function number 8
> end;
atomall := proc()
local kkk, order_d, adj2, temporary, term;
global glob_max_terms, DEBUGMASSIVE, glob_iolevel, INFO, DEBUGL, ALWAYS,
glob_normmax, glob_max_trunc_err, glob_look_poles, glob_clock_sec,
glob_almost_1, glob_warned, glob_no_eqs, glob_max_iter, glob_log10_relerr,
sec_in_min, djd_debug2, glob_dump, glob_warned2, glob_small_float,
glob_display_flag, glob_log10normmin, glob_log10relerr, glob_optimal_start,
glob_abserr, glob_dump_analytic, glob_large_float, centuries_in_millinium,
days_in_year, glob_iter, glob_unchanged_h_cnt, glob_hmax, glob_initial_pass,
glob_hmin, glob_h, glob_reached_optimal_h, glob_not_yet_finished,
glob_max_minutes, glob_orig_start_sec, glob_max_rel_trunc_err,
glob_log10_abserr, glob_optimal_done, min_in_hour, glob_curr_iter_when_opt,
glob_start, glob_smallish_float, glob_not_yet_start_msg, hours_in_day,
djd_debug, glob_max_opt_iter, glob_html_log, glob_log10abserr, glob_max_sec,
glob_clock_start_sec, glob_optimal_expect_sec, glob_percent_done,
MAX_UNCHANGED, glob_current_iter, glob_optimal_clock_start_sec, glob_relerr,
glob_last_good_h, glob_disp_incr, years_in_century, glob_subiter_method,
glob_max_hours, glob_hmin_init, array_const_0D0, array_const_1, array_log,
array_last_rel_error, array_pole, array_type_pole, array_norms,
array_y_init, array_1st_rel_error, array_y, array_x, array_m1, array_tmp0,
array_tmp1, array_y_higher_work2, array_real_pole, array_y_higher,
array_y_set_initial, array_poles, array_complex_pole, array_y_higher_work,
glob_last;
array_tmp1[1] := array_const_0D0[1] + array_x[1];
if not array_y_set_initial[1, 2] then
if 1 <= glob_max_terms then
temporary := array_tmp1[1]*glob_h*factorial_3(0, 1);
array_y[2] := temporary;
array_y_higher[1, 2] := temporary;
temporary := temporary*2.0/glob_h;
array_y_higher[2, 1] := temporary
end if
end if;
kkk := 2;
array_tmp1[2] := array_const_0D0[2] + array_x[2];
if not array_y_set_initial[1, 3] then
if 2 <= glob_max_terms then
temporary := array_tmp1[2]*glob_h*factorial_3(1, 2);
array_y[3] := temporary;
array_y_higher[1, 3] := temporary;
temporary := temporary*2.0/glob_h;
array_y_higher[2, 2] := temporary
end if
end if;
kkk := 3;
array_tmp1[3] := array_const_0D0[3] + array_x[3];
if not array_y_set_initial[1, 4] then
if 3 <= glob_max_terms then
temporary := array_tmp1[3]*glob_h*factorial_3(2, 3);
array_y[4] := temporary;
array_y_higher[1, 4] := temporary;
temporary := temporary*2.0/glob_h;
array_y_higher[2, 3] := temporary
end if
end if;
kkk := 4;
array_tmp1[4] := array_const_0D0[4] + array_x[4];
if not array_y_set_initial[1, 5] then
if 4 <= glob_max_terms then
temporary := array_tmp1[4]*glob_h*factorial_3(3, 4);
array_y[5] := temporary;
array_y_higher[1, 5] := temporary;
temporary := temporary*2.0/glob_h;
array_y_higher[2, 4] := temporary
end if
end if;
kkk := 5;
array_tmp1[5] := array_const_0D0[5] + array_x[5];
if not array_y_set_initial[1, 6] then
if 5 <= glob_max_terms then
temporary := array_tmp1[5]*glob_h*factorial_3(4, 5);
array_y[6] := temporary;
array_y_higher[1, 6] := temporary;
temporary := temporary*2.0/glob_h;
array_y_higher[2, 5] := temporary
end if
end if;
kkk := 6;
while kkk <= glob_max_terms do
array_tmp1[kkk] := array_const_0D0[kkk] + array_x[kkk];
order_d := 1;
if kkk + order_d + 1 <= glob_max_terms then
if not array_y_set_initial[1, kkk + order_d] then
temporary := array_tmp1[kkk]*glob_h^order_d/
factorial_3(kkk - 1, kkk + order_d - 1);
array_y[kkk + order_d] := temporary;
array_y_higher[1, kkk + order_d] := temporary;
term := kkk + order_d - 1;
adj2 := 2;
while adj2 <= order_d + 1 and 1 <= term do
temporary := temporary*convfp(adj2)/glob_h;
array_y_higher[adj2, term] := temporary;
adj2 := adj2 + 1;
term := term - 1
end do
end if
end if;
kkk := kkk + 1
end do
end proc
> #BEGIN ATS LIBRARY BLOCK
> omniout_str := proc(iolevel,str)
> global glob_iolevel;
> if (glob_iolevel >= iolevel) then
> printf("%s\n",str);
> fi;
> # End Function number 1
> end;
omniout_str := proc(iolevel, str)
global glob_iolevel;
if iolevel <= glob_iolevel then printf("%s\n", str) end if
end proc
> omniout_str_noeol := proc(iolevel,str)
> global glob_iolevel;
> if (glob_iolevel >= iolevel) then
> printf("%s",str);
> fi;
> # End Function number 1
> end;
omniout_str_noeol := proc(iolevel, str)
global glob_iolevel;
if iolevel <= glob_iolevel then printf("%s", str) end if
end proc
> omniout_labstr := proc(iolevel,label,str)
> global glob_iolevel;
> if (glob_iolevel >= iolevel) then
> print(label,str);
> fi;
> # End Function number 1
> end;
omniout_labstr := proc(iolevel, label, str)
global glob_iolevel;
if iolevel <= glob_iolevel then print(label, str) end if
end proc
> omniout_float := proc(iolevel,prelabel,prelen,value,vallen,postlabel)
> global glob_iolevel;
> if (glob_iolevel >= iolevel) then
> if vallen = 4 then
> printf("%-30s = %-42.4g %s \n",prelabel,value, postlabel);
> else
> printf("%-30s = %-42.32g %s \n",prelabel,value, postlabel);
> fi;
> fi;
> # End Function number 1
> end;
omniout_float := proc(iolevel, prelabel, prelen, value, vallen, postlabel)
global glob_iolevel;
if iolevel <= glob_iolevel then
if vallen = 4 then
printf("%-30s = %-42.4g %s \n", prelabel, value, postlabel)
else printf("%-30s = %-42.32g %s \n", prelabel, value, postlabel)
end if
end if
end proc
> omniout_int := proc(iolevel,prelabel,prelen,value,vallen,postlabel)
> global glob_iolevel;
> if (glob_iolevel >= iolevel) then
> if vallen = 5 then
> printf("%-30s = %-32d %s\n",prelabel,value, postlabel);
> else
> printf("%-30s = %-32d %s \n",prelabel,value, postlabel);
> fi;
> fi;
> # End Function number 1
> end;
omniout_int := proc(iolevel, prelabel, prelen, value, vallen, postlabel)
global glob_iolevel;
if iolevel <= glob_iolevel then
if vallen = 5 then
printf("%-30s = %-32d %s\n", prelabel, value, postlabel)
else printf("%-30s = %-32d %s \n", prelabel, value, postlabel)
end if
end if
end proc
> omniout_float_arr := proc(iolevel,prelabel,elemnt,prelen,value,vallen,postlabel)
> global glob_iolevel;
> if (glob_iolevel >= iolevel) then
> print(prelabel,"[",elemnt,"]",value, postlabel);
> fi;
> # End Function number 1
> end;
omniout_float_arr := proc(
iolevel, prelabel, elemnt, prelen, value, vallen, postlabel)
global glob_iolevel;
if iolevel <= glob_iolevel then
print(prelabel, "[", elemnt, "]", value, postlabel)
end if
end proc
> dump_series := proc(iolevel,dump_label,series_name,
> array_series,numb)
> global glob_iolevel;
> local i;
> if (glob_iolevel >= iolevel) then
> i := 1;
> while (i <= numb) do
> print(dump_label,series_name
> ,i,array_series[i]);
> i := i + 1;
> od;
> fi;
> # End Function number 1
> end;
dump_series := proc(iolevel, dump_label, series_name, array_series, numb)
local i;
global glob_iolevel;
if iolevel <= glob_iolevel then
i := 1;
while i <= numb do
print(dump_label, series_name, i, array_series[i]); i := i + 1
end do
end if
end proc
> dump_series_2 := proc(iolevel,dump_label,series_name2,
> array_series2,numb,subnum,array_x)
> global glob_iolevel;
> local i,sub,ts_term;
> if (glob_iolevel >= iolevel) then
> sub := 1;
> while (sub <= subnum) do
> i := 1;
> while (i <= numb) do
> print(dump_label,series_name2,sub,i,array_series2[sub,i]);
> od;
> sub := sub + 1;
> od;
> fi;
> # End Function number 1
> end;
dump_series_2 := proc(
iolevel, dump_label, series_name2, array_series2, numb, subnum, array_x)
local i, sub, ts_term;
global glob_iolevel;
if iolevel <= glob_iolevel then
sub := 1;
while sub <= subnum do
i := 1;
while i <= numb do print(dump_label, series_name2, sub, i,
array_series2[sub, i])
end do;
sub := sub + 1
end do
end if
end proc
> cs_info := proc(iolevel,str)
> global glob_iolevel,glob_correct_start_flag,glob_h,glob_reached_optimal_h;
> if (glob_iolevel >= iolevel) then
> print("cs_info " , str , " glob_correct_start_flag = " , glob_correct_start_flag , "glob_h := " , glob_h , "glob_reached_optimal_h := " , glob_reached_optimal_h)
> fi;
> # End Function number 1
> end;
cs_info := proc(iolevel, str)
global
glob_iolevel, glob_correct_start_flag, glob_h, glob_reached_optimal_h;
if iolevel <= glob_iolevel then print("cs_info ", str,
" glob_correct_start_flag = ", glob_correct_start_flag,
"glob_h := ", glob_h, "glob_reached_optimal_h := ",
glob_reached_optimal_h)
end if
end proc
> # Begin Function number 2
> logitem_time := proc(fd,secs_in)
> global centuries_in_millinium, days_in_year, hours_in_day, min_in_hour, sec_in_min, years_in_century;
> local cent_int, centuries, days, days_int, hours, hours_int, millinium_int, milliniums, minutes, minutes_int, sec_in_millinium, sec_int, seconds, secs, years, years_int;
> secs := (secs_in);
> if (secs > 0.0) then # if number 1
> sec_in_millinium := convfloat(sec_in_min * min_in_hour * hours_in_day * days_in_year * years_in_century * centuries_in_millinium);
> milliniums := convfloat(secs / sec_in_millinium);
> millinium_int := floor(milliniums);
> centuries := (milliniums - millinium_int)*centuries_in_millinium;
> cent_int := floor(centuries);
> years := (centuries - cent_int) * years_in_century;
> years_int := floor(years);
> days := (years - years_int) * days_in_year;
> days_int := floor(days);
> hours := (days - days_int) * hours_in_day;
> hours_int := floor(hours);
> minutes := (hours - hours_int) * min_in_hour;
> minutes_int := floor(minutes);
> seconds := (minutes - minutes_int) * sec_in_min;
> sec_int := floor(seconds);
> fprintf(fd,"
");
> if (millinium_int > 0) then # if number 2
> fprintf(fd,"%d Millinia %d Centuries %d Years %d Days %d Hours %d Minutes %d Seconds",millinium_int,cent_int,years_int,days_int,hours_int,minutes_int,sec_int);
> elif (cent_int > 0) then # if number 3
> fprintf(fd,"%d Centuries %d Years %d Days %d Hours %d Minutes %d Seconds",cent_int,years_int,days_int,hours_int,minutes_int,sec_int);
> elif (years_int > 0) then # if number 4
> fprintf(fd,"%d Years %d Days %d Hours %d Minutes %d Seconds",years_int,days_int,hours_int,minutes_int,sec_int);
> elif (days_int > 0) then # if number 5
> fprintf(fd,"%d Days %d Hours %d Minutes %d Seconds",days_int,hours_int,minutes_int,sec_int);
> elif (hours_int > 0) then # if number 6
> fprintf(fd,"%d Hours %d Minutes %d Seconds",hours_int,minutes_int,sec_int);
> elif (minutes_int > 0) then # if number 7
> fprintf(fd,"%d Minutes %d Seconds",minutes_int,sec_int);
> else
> fprintf(fd,"%d Seconds",sec_int);
> fi;# end if 7
> else
> fprintf(fd,"Unknown");
> fi;# end if 6
> fprintf(fd," | ");
> # End Function number 2
> end;
logitem_time := proc(fd, secs_in)
local cent_int, centuries, days, days_int, hours, hours_int, millinium_int,
milliniums, minutes, minutes_int, sec_in_millinium, sec_int, seconds, secs,
years, years_int;
global centuries_in_millinium, days_in_year, hours_in_day, min_in_hour,
sec_in_min, years_in_century;
secs := secs_in;
if 0. < secs then
sec_in_millinium := convfloat(sec_in_min*min_in_hour*hours_in_day*
days_in_year*years_in_century*centuries_in_millinium);
milliniums := convfloat(secs/sec_in_millinium);
millinium_int := floor(milliniums);
centuries := (milliniums - millinium_int)*centuries_in_millinium;
cent_int := floor(centuries);
years := (centuries - cent_int)*years_in_century;
years_int := floor(years);
days := (years - years_int)*days_in_year;
days_int := floor(days);
hours := (days - days_int)*hours_in_day;
hours_int := floor(hours);
minutes := (hours - hours_int)*min_in_hour;
minutes_int := floor(minutes);
seconds := (minutes - minutes_int)*sec_in_min;
sec_int := floor(seconds);
fprintf(fd, "");
if 0 < millinium_int then fprintf(fd, "%d Millinia %d Centuries %\
d Years %d Days %d Hours %d Minutes %d Seconds", millinium_int,
cent_int, years_int, days_int, hours_int, minutes_int, sec_int)
elif 0 < cent_int then fprintf(fd,
"%d Centuries %d Years %d Days %d Hours %d Minutes %d Seconds",
cent_int, years_int, days_int, hours_int, minutes_int, sec_int)
elif 0 < years_int then fprintf(fd,
"%d Years %d Days %d Hours %d Minutes %d Seconds", years_int,
days_int, hours_int, minutes_int, sec_int)
elif 0 < days_int then fprintf(fd,
"%d Days %d Hours %d Minutes %d Seconds", days_int, hours_int,
minutes_int, sec_int)
elif 0 < hours_int then fprintf(fd,
"%d Hours %d Minutes %d Seconds", hours_int, minutes_int,
sec_int)
elif 0 < minutes_int then
fprintf(fd, "%d Minutes %d Seconds", minutes_int, sec_int)
else fprintf(fd, "%d Seconds", sec_int)
end if
else fprintf(fd, "Unknown")
end if;
fprintf(fd, " | ")
end proc
> omniout_timestr := proc (secs_in)
> global centuries_in_millinium, days_in_year, hours_in_day, min_in_hour, sec_in_min, years_in_century;
> local cent_int, centuries, days, days_int, hours, hours_int, millinium_int, milliniums, minutes, minutes_int, sec_in_millinium, sec_int, seconds, secs, years, years_int;
> secs := convfloat(secs_in);
> if (secs > 0.0) then # if number 6
> sec_in_millinium := convfloat(sec_in_min * min_in_hour * hours_in_day * days_in_year * years_in_century * centuries_in_millinium);
> milliniums := convfloat(secs / sec_in_millinium);
> millinium_int := floor(milliniums);
> centuries := (milliniums - millinium_int)*centuries_in_millinium;
> cent_int := floor(centuries);
> years := (centuries - cent_int) * years_in_century;
> years_int := floor(years);
> days := (years - years_int) * days_in_year;
> days_int := floor(days);
> hours := (days - days_int) * hours_in_day;
> hours_int := floor(hours);
> minutes := (hours - hours_int) * min_in_hour;
> minutes_int := floor(minutes);
> seconds := (minutes - minutes_int) * sec_in_min;
> sec_int := floor(seconds);
>
> if (millinium_int > 0) then # if number 7
> printf(" = %d Millinia %d Centuries %d Years %d Days %d Hours %d Minutes %d Seconds\n",millinium_int,cent_int,years_int,days_int,hours_int,minutes_int,sec_int);
> elif (cent_int > 0) then # if number 8
> printf(" = %d Centuries %d Years %d Days %d Hours %d Minutes %d Seconds\n",cent_int,years_int,days_int,hours_int,minutes_int,sec_int);
> elif (years_int > 0) then # if number 9
> printf(" = %d Years %d Days %d Hours %d Minutes %d Seconds\n",years_int,days_int,hours_int,minutes_int,sec_int);
> elif (days_int > 0) then # if number 10
> printf(" = %d Days %d Hours %d Minutes %d Seconds\n",days_int,hours_int,minutes_int,sec_int);
> elif (hours_int > 0) then # if number 11
> printf(" = %d Hours %d Minutes %d Seconds\n",hours_int,minutes_int,sec_int);
> elif (minutes_int > 0) then # if number 12
> printf(" = %d Minutes %d Seconds\n",minutes_int,sec_int);
> else
> printf(" = %d Seconds\n",sec_int);
> fi;# end if 12
> else
> printf(" Unknown\n");
> fi;# end if 11
> # End Function number 2
> end;
omniout_timestr := proc(secs_in)
local cent_int, centuries, days, days_int, hours, hours_int, millinium_int,
milliniums, minutes, minutes_int, sec_in_millinium, sec_int, seconds, secs,
years, years_int;
global centuries_in_millinium, days_in_year, hours_in_day, min_in_hour,
sec_in_min, years_in_century;
secs := convfloat(secs_in);
if 0. < secs then
sec_in_millinium := convfloat(sec_in_min*min_in_hour*hours_in_day*
days_in_year*years_in_century*centuries_in_millinium);
milliniums := convfloat(secs/sec_in_millinium);
millinium_int := floor(milliniums);
centuries := (milliniums - millinium_int)*centuries_in_millinium;
cent_int := floor(centuries);
years := (centuries - cent_int)*years_in_century;
years_int := floor(years);
days := (years - years_int)*days_in_year;
days_int := floor(days);
hours := (days - days_int)*hours_in_day;
hours_int := floor(hours);
minutes := (hours - hours_int)*min_in_hour;
minutes_int := floor(minutes);
seconds := (minutes - minutes_int)*sec_in_min;
sec_int := floor(seconds);
if 0 < millinium_int then printf(" = %d Millinia %d Centuries %d\
Years %d Days %d Hours %d Minutes %d Seconds\n", millinium_int,
cent_int, years_int, days_int, hours_int, minutes_int, sec_int)
elif 0 < cent_int then printf(" = %d Centuries %d Years %d Days \
%d Hours %d Minutes %d Seconds\n", cent_int, years_int,
days_int, hours_int, minutes_int, sec_int)
elif 0 < years_int then printf(
" = %d Years %d Days %d Hours %d Minutes %d Seconds\n",
years_int, days_int, hours_int, minutes_int, sec_int)
elif 0 < days_int then printf(
" = %d Days %d Hours %d Minutes %d Seconds\n", days_int,
hours_int, minutes_int, sec_int)
elif 0 < hours_int then printf(
" = %d Hours %d Minutes %d Seconds\n", hours_int, minutes_int,
sec_int)
elif 0 < minutes_int then
printf(" = %d Minutes %d Seconds\n", minutes_int, sec_int)
else printf(" = %d Seconds\n", sec_int)
end if
else printf(" Unknown\n")
end if
end proc
>
> # Begin Function number 3
> ats := proc(
> mmm_ats,array_a,array_b,jjj_ats)
> local iii_ats, lll_ats,ma_ats, ret_ats;
> ret_ats := 0.0;
> if (jjj_ats <= mmm_ats) then # if number 11
> ma_ats := mmm_ats + 1;
> iii_ats := jjj_ats;
> while (iii_ats <= mmm_ats) do # do number 1
> lll_ats := ma_ats - iii_ats;
> ret_ats := ret_ats + array_a[iii_ats]*array_b[lll_ats];
> iii_ats := iii_ats + 1;
> od;# end do number 1
> fi;# end if 11
> ;
> ret_ats
> # End Function number 3
> end;
ats := proc(mmm_ats, array_a, array_b, jjj_ats)
local iii_ats, lll_ats, ma_ats, ret_ats;
ret_ats := 0.;
if jjj_ats <= mmm_ats then
ma_ats := mmm_ats + 1;
iii_ats := jjj_ats;
while iii_ats <= mmm_ats do
lll_ats := ma_ats - iii_ats;
ret_ats := ret_ats + array_a[iii_ats]*array_b[lll_ats];
iii_ats := iii_ats + 1
end do
end if;
ret_ats
end proc
>
> # Begin Function number 4
> att := proc(
> mmm_att,array_aa,array_bb,jjj_att)
> global glob_max_terms;
> local al_att, iii_att,lll_att, ma_att, ret_att;
> ret_att := 0.0;
> if (jjj_att <= mmm_att) then # if number 11
> ma_att := mmm_att + 2;
> iii_att := jjj_att;
> while (iii_att <= mmm_att) do # do number 1
> lll_att := ma_att - iii_att;
> al_att := (lll_att - 1);
> if (lll_att <= glob_max_terms) then # if number 12
> ret_att := ret_att + array_aa[iii_att]*array_bb[lll_att]* convfp(al_att);
> fi;# end if 12
> ;
> iii_att := iii_att + 1;
> od;# end do number 1
> ;
> ret_att := ret_att / convfp(mmm_att) ;
> fi;# end if 11
> ;
> ret_att;
> # End Function number 4
> end;
att := proc(mmm_att, array_aa, array_bb, jjj_att)
local al_att, iii_att, lll_att, ma_att, ret_att;
global glob_max_terms;
ret_att := 0.;
if jjj_att <= mmm_att then
ma_att := mmm_att + 2;
iii_att := jjj_att;
while iii_att <= mmm_att do
lll_att := ma_att - iii_att;
al_att := lll_att - 1;
if lll_att <= glob_max_terms then ret_att := ret_att
+ array_aa[iii_att]*array_bb[lll_att]*convfp(al_att)
end if;
iii_att := iii_att + 1
end do;
ret_att := ret_att/convfp(mmm_att)
end if;
ret_att
end proc
> # Begin Function number 5
> display_pole := proc()
> global ALWAYS,glob_display_flag, glob_large_float, array_pole;
> if ((array_pole[1] <> glob_large_float) and (array_pole[1] > 0.0) and (array_pole[2] <> glob_large_float) and (array_pole[2]> 0.0) and glob_display_flag) then # if number 11
> omniout_float(ALWAYS,"Radius of convergence ",4, array_pole[1],4," ");
> omniout_float(ALWAYS,"Order of pole ",4, array_pole[2],4," ");
> fi;# end if 11
> # End Function number 5
> end;
display_pole := proc()
global ALWAYS, glob_display_flag, glob_large_float, array_pole;
if array_pole[1] <> glob_large_float and 0. < array_pole[1] and
array_pole[2] <> glob_large_float and 0. < array_pole[2] and
glob_display_flag then
omniout_float(ALWAYS, "Radius of convergence ", 4,
array_pole[1], 4, " ");
omniout_float(ALWAYS, "Order of pole ", 4,
array_pole[2], 4, " ")
end if
end proc
> # Begin Function number 6
> logditto := proc(file)
> fprintf(file,"");
> fprintf(file,"ditto");
> fprintf(file," | ");
> # End Function number 6
> end;
logditto := proc(file)
fprintf(file, ""); fprintf(file, "ditto"); fprintf(file, " | ")
end proc
> # Begin Function number 7
> logitem_integer := proc(file,n)
> fprintf(file,"");
> fprintf(file,"%d",n);
> fprintf(file," | ");
> # End Function number 7
> end;
logitem_integer := proc(file, n)
fprintf(file, ""); fprintf(file, "%d", n); fprintf(file, " | ")
end proc
> # Begin Function number 8
> logitem_str := proc(file,str)
> fprintf(file,"");
> fprintf(file,str);
> fprintf(file," | ");
> # End Function number 8
> end;
logitem_str := proc(file, str)
fprintf(file, ""); fprintf(file, str); fprintf(file, " | ")
end proc
> # Begin Function number 9
> log_revs := proc(file,revs)
> fprintf(file,revs);
> # End Function number 9
> end;
log_revs := proc(file, revs) fprintf(file, revs) end proc
> # Begin Function number 10
> logitem_float := proc(file,x)
> fprintf(file,"");
> fprintf(file,"%g",x);
> fprintf(file," | ");
> # End Function number 10
> end;
logitem_float := proc(file, x)
fprintf(file, ""); fprintf(file, "%g", x); fprintf(file, " | ")
end proc
> # Begin Function number 11
> logitem_pole := proc(file,pole)
> fprintf(file,"");
> if pole = 0 then # if number 11
> fprintf(file,"NA");
> elif pole = 1 then # if number 12
> fprintf(file,"Real");
> elif pole = 2 then # if number 13
> fprintf(file,"Complex");
> else
> fprintf(file,"No Pole");
> fi;# end if 13
> fprintf(file," | ");
> # End Function number 11
> end;
logitem_pole := proc(file, pole)
fprintf(file, "");
if pole = 0 then fprintf(file, "NA")
elif pole = 1 then fprintf(file, "Real")
elif pole = 2 then fprintf(file, "Complex")
else fprintf(file, "No Pole")
end if;
fprintf(file, " | ")
end proc
> # Begin Function number 12
> logstart := proc(file)
> fprintf(file,"");
> # End Function number 12
> end;
logstart := proc(file) fprintf(file, "
") end proc
> # Begin Function number 13
> logend := proc(file)
> fprintf(file,"
\n");
> # End Function number 13
> end;
logend := proc(file) fprintf(file, "\n") end proc
> # Begin Function number 14
> chk_data := proc()
> global glob_max_iter,ALWAYS, glob_max_terms;
> local errflag;
> errflag := false;
>
> if ((glob_max_terms < 15) or (glob_max_terms > 512)) then # if number 13
> omniout_str(ALWAYS,"Illegal max_terms = -- Using 30");
> glob_max_terms := 30;
> fi;# end if 13
> ;
> if (glob_max_iter < 2) then # if number 13
> omniout_str(ALWAYS,"Illegal max_iter");
> errflag := true;
> fi;# end if 13
> ;
> if (errflag) then # if number 13
>
> quit;
> fi;# end if 13
> # End Function number 14
> end;
chk_data := proc()
local errflag;
global glob_max_iter, ALWAYS, glob_max_terms;
errflag := false;
if glob_max_terms < 15 or 512 < glob_max_terms then
omniout_str(ALWAYS, "Illegal max_terms = -- Using 30");
glob_max_terms := 30
end if;
if glob_max_iter < 2 then
omniout_str(ALWAYS, "Illegal max_iter"); errflag := true
end if;
if errflag then quit end if
end proc
>
> # Begin Function number 15
> comp_expect_sec := proc(t_end2,t_start2,t2,clock_sec)
> global glob_small_float;
> local ms2, rrr, sec_left, sub1, sub2;
> ;
> ms2 := clock_sec;
> sub1 := (t_end2-t_start2);
> sub2 := (t2-t_start2);
> if (sub1 = 0.0) then # if number 13
> sec_left := 0.0;
> else
> if (abs(sub2) > 0.0) then # if number 14
> rrr := (sub1/sub2);
> sec_left := rrr * ms2 - ms2;
> else
> sec_left := 0.0;
> fi;# end if 14
> fi;# end if 13
> ;
> sec_left;
> # End Function number 15
> end;
comp_expect_sec := proc(t_end2, t_start2, t2, clock_sec)
local ms2, rrr, sec_left, sub1, sub2;
global glob_small_float;
ms2 := clock_sec;
sub1 := t_end2 - t_start2;
sub2 := t2 - t_start2;
if sub1 = 0. then sec_left := 0.
else
if 0. < abs(sub2) then rrr := sub1/sub2; sec_left := rrr*ms2 - ms2
else sec_left := 0.
end if
end if;
sec_left
end proc
>
> # Begin Function number 16
> comp_percent := proc(t_end2,t_start2,t2)
> global glob_small_float;
> local rrr, sub1, sub2;
> sub1 := (t_end2-t_start2);
> sub2 := (t2-t_start2);
> if (abs(sub2) > glob_small_float) then # if number 13
> rrr := (100.0*sub2)/sub1;
> else
> rrr := 0.0;
> fi;# end if 13
> ;
> rrr
> # End Function number 16
> end;
comp_percent := proc(t_end2, t_start2, t2)
local rrr, sub1, sub2;
global glob_small_float;
sub1 := t_end2 - t_start2;
sub2 := t2 - t_start2;
if glob_small_float < abs(sub2) then rrr := 100.0*sub2/sub1
else rrr := 0.
end if;
rrr
end proc
>
> # Begin Function number 17
> factorial_1 := proc(nnn)
> nnn!;
>
> # End Function number 17
> end;
factorial_1 := proc(nnn) nnn! end proc
>
> # Begin Function number 18
> factorial_3 := proc(mmm2,nnn2)
> (mmm2!)/(nnn2!);
>
> # End Function number 18
> end;
factorial_3 := proc(mmm2, nnn2) mmm2!/nnn2! end proc
> # Begin Function number 19
> convfp := proc(mmm)
> (mmm);
>
> # End Function number 19
> end;
convfp := proc(mmm) mmm end proc
> # Begin Function number 20
> convfloat := proc(mmm)
> (mmm);
>
> # End Function number 20
> end;
convfloat := proc(mmm) mmm end proc
> elapsed_time_seconds := proc()
> time();
> end;
elapsed_time_seconds := proc() time() end proc
>
>
>
> #END ATS LIBRARY BLOCK
> #BEGIN USER DEF BLOCK
> #BEGIN USER DEF BLOCK
> exact_soln_y := proc(x)
> 2.0 + x*log(x)-x
> end;
exact_soln_y := proc(x) 2.0 + x*log(x) - x end proc
>
>
> #END USER DEF BLOCK
> #END USER DEF BLOCK
> #END OUTFILE5
> # Begin Function number 2
> mainprog := proc()
> #BEGIN OUTFIEMAIN
> local d1,d2,d3,d4,est_err_2,niii,done_once,
> term,ord,order_diff,term_no,html_log_file,
> rows,r_order,sub_iter,calc_term,iii,temp_sum,current_iter,
> x_start,x_end
> ,it, log10norm, max_terms, opt_iter, tmp;
> #Top Generate Globals Definition
> #Bottom Generate Globals Deninition
> global
> glob_max_terms,
> DEBUGMASSIVE,
> glob_iolevel,
> INFO,
> DEBUGL,
> ALWAYS,
> #Top Generate Globals Decl
> glob_normmax,
> glob_max_trunc_err,
> glob_look_poles,
> glob_clock_sec,
> glob_almost_1,
> glob_warned,
> glob_no_eqs,
> glob_max_iter,
> glob_log10_relerr,
> sec_in_min,
> djd_debug2,
> glob_dump,
> glob_warned2,
> glob_small_float,
> glob_display_flag,
> glob_log10normmin,
> glob_log10relerr,
> glob_optimal_start,
> glob_abserr,
> glob_dump_analytic,
> glob_large_float,
> centuries_in_millinium,
> days_in_year,
> glob_iter,
> glob_unchanged_h_cnt,
> glob_hmax,
> glob_initial_pass,
> glob_hmin,
> glob_h,
> glob_reached_optimal_h,
> glob_not_yet_finished,
> glob_max_minutes,
> glob_orig_start_sec,
> glob_max_rel_trunc_err,
> glob_log10_abserr,
> glob_optimal_done,
> min_in_hour,
> glob_curr_iter_when_opt,
> glob_start,
> glob_smallish_float,
> glob_not_yet_start_msg,
> hours_in_day,
> djd_debug,
> glob_max_opt_iter,
> glob_html_log,
> glob_log10abserr,
> glob_max_sec,
> glob_clock_start_sec,
> glob_optimal_expect_sec,
> glob_percent_done,
> MAX_UNCHANGED,
> glob_current_iter,
> glob_optimal_clock_start_sec,
> glob_relerr,
> glob_last_good_h,
> glob_disp_incr,
> years_in_century,
> glob_subiter_method,
> glob_max_hours,
> glob_hmin_init,
> #Bottom Generate Globals Decl
> #BEGIN CONST
> array_const_0D0,
> array_const_1,
> #END CONST
> array_log,
> array_last_rel_error,
> array_pole,
> array_type_pole,
> array_norms,
> array_y_init,
> array_1st_rel_error,
> array_y,
> array_x,
> array_m1,
> array_tmp0,
> array_tmp1,
> array_y_higher_work2,
> array_real_pole,
> array_y_higher,
> array_y_set_initial,
> array_poles,
> array_complex_pole,
> array_y_higher_work,
> glob_last;
> glob_last;
> ALWAYS := 1;
> INFO := 2;
> DEBUGL := 3;
> DEBUGMASSIVE := 4;
> glob_iolevel := INFO;
> glob_max_terms := 30;
> DEBUGMASSIVE := 4;
> glob_iolevel := 5;
> INFO := 2;
> DEBUGL := 3;
> ALWAYS := 1;
> glob_normmax := 0.0;
> glob_max_trunc_err := 0.1e-10;
> glob_look_poles := false;
> glob_clock_sec := 0.0;
> glob_almost_1 := 0.9990;
> glob_warned := false;
> glob_no_eqs := 0;
> glob_max_iter := 1000;
> glob_log10_relerr := 0.1e-10;
> sec_in_min := 60.0;
> djd_debug2 := true;
> glob_dump := false;
> glob_warned2 := false;
> glob_small_float := 0.1e-50;
> glob_display_flag := true;
> glob_log10normmin := 0.1;
> glob_log10relerr := 0.0;
> glob_optimal_start := 0.0;
> glob_abserr := 0.1e-10;
> glob_dump_analytic := false;
> glob_large_float := 9.0e100;
> centuries_in_millinium := 10.0;
> days_in_year := 365.0;
> glob_iter := 0;
> glob_unchanged_h_cnt := 0;
> glob_hmax := 1.0;
> glob_initial_pass := true;
> glob_hmin := 0.00000000001;
> glob_h := 0.1;
> glob_reached_optimal_h := false;
> glob_not_yet_finished := true;
> glob_max_minutes := 0.0;
> glob_orig_start_sec := 0.0;
> glob_max_rel_trunc_err := 0.1e-10;
> glob_log10_abserr := 0.1e-10;
> glob_optimal_done := false;
> min_in_hour := 60.0;
> glob_curr_iter_when_opt := 0;
> glob_start := 0;
> glob_smallish_float := 0.1e-100;
> glob_not_yet_start_msg := true;
> hours_in_day := 24.0;
> djd_debug := true;
> glob_max_opt_iter := 10;
> glob_html_log := true;
> glob_log10abserr := 0.0;
> glob_max_sec := 10000.0;
> glob_clock_start_sec := 0.0;
> glob_optimal_expect_sec := 0.1;
> glob_percent_done := 0.0;
> MAX_UNCHANGED := 10;
> glob_current_iter := 0;
> glob_optimal_clock_start_sec := 0.0;
> glob_relerr := 0.1e-10;
> glob_last_good_h := 0.1;
> glob_disp_incr := 0.1;
> years_in_century := 100.0;
> glob_subiter_method := 3;
> glob_max_hours := 0.0;
> glob_hmin_init := 0.001;
> #Write Set Defaults
> glob_orig_start_sec := elapsed_time_seconds();
> MAX_UNCHANGED := 10;
> glob_curr_iter_when_opt := 0;
> glob_display_flag := true;
> glob_no_eqs := 1;
> glob_iter := -1;
> opt_iter := -1;
> glob_max_iter := 50000;
> glob_max_hours := 0.0;
> glob_max_minutes := 15.0;
> omniout_str(ALWAYS,"##############ECHO OF PROBLEM#################");
> omniout_str(ALWAYS,"##############temp/logpostode.ode#################");
> omniout_str(ALWAYS,"diff ( y , x , 1 ) = log ( x ) ;");
> omniout_str(ALWAYS,"!");
> omniout_str(ALWAYS,"#BEGIN FIRST INPUT BLOCK");
> omniout_str(ALWAYS,"Digits := 32;");
> omniout_str(ALWAYS,"max_terms := 30;");
> omniout_str(ALWAYS,"!");
> omniout_str(ALWAYS,"#END FIRST INPUT BLOCK");
> omniout_str(ALWAYS,"#BEGIN SECOND INPUT BLOCK");
> omniout_str(ALWAYS,"x_start := 20.0;");
> omniout_str(ALWAYS,"x_end := 30.0 ;");
> omniout_str(ALWAYS,"array_y_init[0 + 1] := exact_soln_y(x_start);");
> omniout_str(ALWAYS,"glob_h := 0.00001 ;");
> omniout_str(ALWAYS,"glob_look_poles := true;");
> omniout_str(ALWAYS,"glob_max_iter := 20;");
> omniout_str(ALWAYS,"#END SECOND INPUT BLOCK");
> omniout_str(ALWAYS,"#BEGIN OVERRIDE BLOCK");
> omniout_str(ALWAYS,"glob_h := 0.0001 ;");
> omniout_str(ALWAYS,"glob_look_poles := true;");
> omniout_str(ALWAYS,"glob_max_iter := 100;");
> omniout_str(ALWAYS,"glob_max_minutes := 15;");
> omniout_str(ALWAYS,"#END OVERRIDE BLOCK");
> omniout_str(ALWAYS,"!");
> omniout_str(ALWAYS,"#BEGIN USER DEF BLOCK");
> omniout_str(ALWAYS,"exact_soln_y := proc(x)");
> omniout_str(ALWAYS,"2.0 + x*log(x)-x");
> omniout_str(ALWAYS,"end;");
> omniout_str(ALWAYS,"");
> omniout_str(ALWAYS,"");
> omniout_str(ALWAYS,"#END USER DEF BLOCK");
> omniout_str(ALWAYS,"#######END OF ECHO OF PROBLEM#################");
> glob_unchanged_h_cnt := 0;
> glob_warned := false;
> glob_warned2 := false;
> glob_small_float := 1.0e-200;
> glob_smallish_float := 1.0e-64;
> glob_large_float := 1.0e100;
> glob_almost_1 := 0.99;
> glob_log10_abserr := -8.0;
> glob_log10_relerr := -8.0;
> glob_hmax := 0.01;
> #BEGIN FIRST INPUT BLOCK
> #BEGIN FIRST INPUT BLOCK
> Digits := 32;
> max_terms := 30;
> #END FIRST INPUT BLOCK
> #START OF INITS AFTER INPUT BLOCK
> glob_max_terms := max_terms;
> glob_html_log := true;
> #END OF INITS AFTER INPUT BLOCK
> array_log:= Array(1..(max_terms + 1),[]);
> array_last_rel_error:= Array(1..(max_terms + 1),[]);
> array_pole:= Array(1..(max_terms + 1),[]);
> array_type_pole:= Array(1..(max_terms + 1),[]);
> array_norms:= Array(1..(max_terms + 1),[]);
> array_y_init:= Array(1..(max_terms + 1),[]);
> array_1st_rel_error:= Array(1..(max_terms + 1),[]);
> array_y:= Array(1..(max_terms + 1),[]);
> array_x:= Array(1..(max_terms + 1),[]);
> array_m1:= Array(1..(max_terms + 1),[]);
> array_tmp0:= Array(1..(max_terms + 1),[]);
> array_tmp1:= Array(1..(max_terms + 1),[]);
> array_y_higher_work2 := Array(1..(2+ 1) ,(1..max_terms+ 1),[]);
> array_real_pole := Array(1..(1+ 1) ,(1..3+ 1),[]);
> array_y_higher := Array(1..(2+ 1) ,(1..max_terms+ 1),[]);
> array_y_set_initial := Array(1..(2+ 1) ,(1..max_terms+ 1),[]);
> array_poles := Array(1..(1+ 1) ,(1..3+ 1),[]);
> array_complex_pole := Array(1..(1+ 1) ,(1..3+ 1),[]);
> array_y_higher_work := Array(1..(2+ 1) ,(1..max_terms+ 1),[]);
> term := 1;
> while term <= max_terms do # do number 2
> array_log[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> term := 1;
> while term <= max_terms do # do number 2
> array_last_rel_error[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> term := 1;
> while term <= max_terms do # do number 2
> array_pole[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> term := 1;
> while term <= max_terms do # do number 2
> array_type_pole[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> term := 1;
> while term <= max_terms do # do number 2
> array_norms[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> term := 1;
> while term <= max_terms do # do number 2
> array_y_init[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> term := 1;
> while term <= max_terms do # do number 2
> array_1st_rel_error[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> term := 1;
> while term <= max_terms do # do number 2
> array_y[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> term := 1;
> while term <= max_terms do # do number 2
> array_x[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> term := 1;
> while term <= max_terms do # do number 2
> array_m1[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> term := 1;
> while term <= max_terms do # do number 2
> array_tmp0[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> term := 1;
> while term <= max_terms do # do number 2
> array_tmp1[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> ord := 1;
> while ord <=2 do # do number 2
> term := 1;
> while term <= max_terms do # do number 3
> array_y_higher_work2[ord,term] := 0.0;
> term := term + 1;
> od;# end do number 3
> ;
> ord := ord + 1;
> od;# end do number 2
> ;
> ord := 1;
> while ord <=1 do # do number 2
> term := 1;
> while term <= 3 do # do number 3
> array_real_pole[ord,term] := 0.0;
> term := term + 1;
> od;# end do number 3
> ;
> ord := ord + 1;
> od;# end do number 2
> ;
> ord := 1;
> while ord <=2 do # do number 2
> term := 1;
> while term <= max_terms do # do number 3
> array_y_higher[ord,term] := 0.0;
> term := term + 1;
> od;# end do number 3
> ;
> ord := ord + 1;
> od;# end do number 2
> ;
> ord := 1;
> while ord <=2 do # do number 2
> term := 1;
> while term <= max_terms do # do number 3
> array_y_set_initial[ord,term] := 0.0;
> term := term + 1;
> od;# end do number 3
> ;
> ord := ord + 1;
> od;# end do number 2
> ;
> ord := 1;
> while ord <=1 do # do number 2
> term := 1;
> while term <= 3 do # do number 3
> array_poles[ord,term] := 0.0;
> term := term + 1;
> od;# end do number 3
> ;
> ord := ord + 1;
> od;# end do number 2
> ;
> ord := 1;
> while ord <=1 do # do number 2
> term := 1;
> while term <= 3 do # do number 3
> array_complex_pole[ord,term] := 0.0;
> term := term + 1;
> od;# end do number 3
> ;
> ord := ord + 1;
> od;# end do number 2
> ;
> ord := 1;
> while ord <=2 do # do number 2
> term := 1;
> while term <= max_terms do # do number 3
> array_y_higher_work[ord,term] := 0.0;
> term := term + 1;
> od;# end do number 3
> ;
> ord := ord + 1;
> od;# end do number 2
> ;
> #BEGIN ARRAYS DEFINED AND INITIALIZATED
> array_log := Array(1..(max_terms+1 + 1),[]);
> term := 1;
> while term <= max_terms + 1 do # do number 2
> array_log[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> array_x := Array(1..(max_terms+1 + 1),[]);
> term := 1;
> while term <= max_terms + 1 do # do number 2
> array_x[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> array_y := Array(1..(max_terms+1 + 1),[]);
> term := 1;
> while term <= max_terms + 1 do # do number 2
> array_y[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> array_tmp1 := Array(1..(max_terms+1 + 1),[]);
> term := 1;
> while term <= max_terms + 1 do # do number 2
> array_tmp1[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> array_tmp0 := Array(1..(max_terms+1 + 1),[]);
> term := 1;
> while term <= max_terms + 1 do # do number 2
> array_tmp0[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> array_const_0D0 := Array(1..(max_terms+1 + 1),[]);
> term := 1;
> while term <= max_terms + 1 do # do number 2
> array_const_0D0[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> array_const_0D0[1] := 0.0;
> array_const_1 := Array(1..(max_terms+1 + 1),[]);
> term := 1;
> while term <= max_terms + 1 do # do number 2
> array_const_1[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> array_const_1[1] := 1;
> array_m1 := Array(1..(max_terms+1 + 1),[]);
> term := 1;
> while term <= max_terms do # do number 2
> array_m1[term] := 0.0;
> term := term + 1;
> od;# end do number 2
> ;
> array_m1[1] := -1.0;
> #END ARRAYS DEFINED AND INITIALIZATED
> #TOP SECOND INPUT BLOCK
> #BEGIN SECOND INPUT BLOCK
> #END FIRST INPUT BLOCK
> #BEGIN SECOND INPUT BLOCK
> x_start := 20.0;
> x_end := 30.0 ;
> array_y_init[0 + 1] := exact_soln_y(x_start);
> glob_h := 0.00001 ;
> glob_look_poles := true;
> glob_max_iter := 20;
> #END SECOND INPUT BLOCK
> #BEGIN OVERRIDE BLOCK
> glob_h := 0.0001 ;
> glob_look_poles := true;
> glob_max_iter := 100;
> glob_max_minutes := 15;
> #END OVERRIDE BLOCK
> #END SECOND INPUT BLOCK
> #BEGIN INITS AFTER SECOND INPUT BLOCK
> glob_last_good_h := glob_h;
> glob_max_terms := max_terms;
> glob_max_sec := convfloat(60.0) * convfloat(glob_max_minutes) + convfloat(3600.0) * convfloat(glob_max_hours);
> glob_abserr := 10.0 ^ (glob_log10_abserr);
> glob_relerr := 10.0 ^ (glob_log10_relerr);
> chk_data();
> #AFTER INITS AFTER SECOND INPUT BLOCK
> array_y_set_initial[1,1] := true;
> array_y_set_initial[1,2] := false;
> array_y_set_initial[1,3] := false;
> array_y_set_initial[1,4] := false;
> array_y_set_initial[1,5] := false;
> array_y_set_initial[1,6] := false;
> array_y_set_initial[1,7] := false;
> array_y_set_initial[1,8] := false;
> array_y_set_initial[1,9] := false;
> array_y_set_initial[1,10] := false;
> array_y_set_initial[1,11] := false;
> array_y_set_initial[1,12] := false;
> array_y_set_initial[1,13] := false;
> array_y_set_initial[1,14] := false;
> array_y_set_initial[1,15] := false;
> array_y_set_initial[1,16] := false;
> array_y_set_initial[1,17] := false;
> array_y_set_initial[1,18] := false;
> array_y_set_initial[1,19] := false;
> array_y_set_initial[1,20] := false;
> array_y_set_initial[1,21] := false;
> array_y_set_initial[1,22] := false;
> array_y_set_initial[1,23] := false;
> array_y_set_initial[1,24] := false;
> array_y_set_initial[1,25] := false;
> array_y_set_initial[1,26] := false;
> array_y_set_initial[1,27] := false;
> array_y_set_initial[1,28] := false;
> array_y_set_initial[1,29] := false;
> array_y_set_initial[1,30] := false;
> if glob_html_log then # if number 2
> html_log_file := fopen("html/entry.html",WRITE,TEXT);
> fi;# end if 2
> ;
> #BEGIN SOLUTION CODE
> omniout_str(ALWAYS,"START of Soultion");
> #Start Series -- INITIALIZE FOR SOLUTION
> array_x[1] := x_start;
> array_x[2] := glob_h;
> order_diff := 1;
> #Start Series array_y
> term_no := 1;
> while (term_no <= order_diff) do # do number 2
> array_y[term_no] := array_y_init[term_no] * glob_h ^ (term_no - 1) / factorial_1(term_no - 1);
> term_no := term_no + 1;
> od;# end do number 2
> ;
> rows := order_diff;
> r_order := 1;
> while (r_order <= rows) do # do number 2
> term_no := 1;
> while (term_no <= (rows - r_order + 1)) do # do number 3
> it := term_no + r_order - 1;
> array_y_higher[r_order,term_no] := array_y_init[it]* (glob_h ^ (term_no - 1)) / ((factorial_1(term_no - 1)));
> term_no := term_no + 1;
> od;# end do number 3
> ;
> r_order := r_order + 1;
> od;# end do number 2
> ;
> current_iter := 1;
> glob_clock_start_sec := elapsed_time_seconds();
> start_array_y();
> if (abs(array_y_higher[1,1]) > glob_small_float) then # if number 2
> tmp := abs(array_y_higher[1,1]);
> log10norm := (log10(tmp));
> if (log10norm < glob_log10normmin) then # if number 3
> glob_log10normmin := log10norm;
> fi;# end if 3
> fi;# end if 2
> ;
> display_alot(current_iter)
> ;
> glob_clock_sec := elapsed_time_seconds();
> glob_current_iter := 0;
> glob_iter := 0;
> omniout_str(DEBUGL," ");
> glob_reached_optimal_h := true;
> glob_optimal_clock_start_sec := elapsed_time_seconds();
> while ((glob_current_iter < glob_max_iter) and (array_x[1] <= x_end ) and ((convfloat(glob_clock_sec) - convfloat(glob_orig_start_sec)) < convfloat(glob_max_sec))) do # do number 2
> #left paren 0001C
> omniout_str(INFO," ");
> omniout_str(INFO,"TOP MAIN SOLVE Loop");
> glob_iter := glob_iter + 1;
> glob_clock_sec := elapsed_time_seconds();
> glob_current_iter := glob_current_iter + 1;
> atomall();
> if (glob_look_poles) then # if number 2
> #left paren 0004C
> check_for_pole();
> fi;# end if 2
> ;#was right paren 0004C
> array_x[1] := array_x[1] + glob_h;
> array_x[2] := glob_h;
> #Jump Series array_y
> order_diff := 1;
> #START PART 1 SUM AND ADJUST
> #START SUM AND ADJUST EQ =1
> #sum_and_adjust array_y
> #BEFORE ADJUST SUBSERIES EQ =1
> ord := 2;
> calc_term := 1;
> #adjust_subseriesarray_y
> iii := glob_max_terms;
> while (iii >= calc_term) do # do number 3
> array_y_higher_work[2,iii] := array_y_higher[2,iii] / (glob_h ^ (calc_term - 1)) / factorial_3(iii - calc_term , iii - 1);
> iii := iii - 1;
> od;# end do number 3
> ;
> #AFTER ADJUST SUBSERIES EQ =1
> #BEFORE SUM SUBSERIES EQ =1
> temp_sum := 0.0;
> ord := 2;
> calc_term := 1;
> #sum_subseriesarray_y
> iii := glob_max_terms;
> while (iii >= calc_term) do # do number 3
> temp_sum := temp_sum + array_y_higher_work[ord,iii];
> iii := iii - 1;
> od;# end do number 3
> ;
> array_y_higher_work2[ord,calc_term] := temp_sum * (glob_h ^ (calc_term - 1)) / (convfp(calc_term - 1)!);
> #AFTER SUM SUBSERIES EQ =1
> #BEFORE ADJUST SUBSERIES EQ =1
> ord := 1;
> calc_term := 2;
> #adjust_subseriesarray_y
> iii := glob_max_terms;
> while (iii >= calc_term) do # do number 3
> array_y_higher_work[1,iii] := array_y_higher[1,iii] / (glob_h ^ (calc_term - 1)) / factorial_3(iii - calc_term , iii - 1);
> iii := iii - 1;
> od;# end do number 3
> ;
> #AFTER ADJUST SUBSERIES EQ =1
> #BEFORE SUM SUBSERIES EQ =1
> temp_sum := 0.0;
> ord := 1;
> calc_term := 2;
> #sum_subseriesarray_y
> iii := glob_max_terms;
> while (iii >= calc_term) do # do number 3
> temp_sum := temp_sum + array_y_higher_work[ord,iii];
> iii := iii - 1;
> od;# end do number 3
> ;
> array_y_higher_work2[ord,calc_term] := temp_sum * (glob_h ^ (calc_term - 1)) / (convfp(calc_term - 1)!);
> #AFTER SUM SUBSERIES EQ =1
> #BEFORE ADJUST SUBSERIES EQ =1
> ord := 1;
> calc_term := 1;
> #adjust_subseriesarray_y
> iii := glob_max_terms;
> while (iii >= calc_term) do # do number 3
> array_y_higher_work[1,iii] := array_y_higher[1,iii] / (glob_h ^ (calc_term - 1)) / factorial_3(iii - calc_term , iii - 1);
> iii := iii - 1;
> od;# end do number 3
> ;
> #AFTER ADJUST SUBSERIES EQ =1
> #BEFORE SUM SUBSERIES EQ =1
> temp_sum := 0.0;
> ord := 1;
> calc_term := 1;
> #sum_subseriesarray_y
> iii := glob_max_terms;
> while (iii >= calc_term) do # do number 3
> temp_sum := temp_sum + array_y_higher_work[ord,iii];
> iii := iii - 1;
> od;# end do number 3
> ;
> array_y_higher_work2[ord,calc_term] := temp_sum * (glob_h ^ (calc_term - 1)) / (convfp(calc_term - 1)!);
> #AFTER SUM SUBSERIES EQ =1
> #END SUM AND ADJUST EQ =1
> #END PART 1
> #START PART 2 MOVE TERMS to REGULAR Array
> term_no := glob_max_terms;
> while (term_no >= 1) do # do number 3
> array_y[term_no] := array_y_higher_work2[1,term_no];
> ord := 1;
> while ord <= order_diff do # do number 4
> array_y_higher[ord,term_no] := array_y_higher_work2[ord,term_no];
> ord := ord + 1;
> od;# end do number 4
> ;
> term_no := term_no - 1;
> od;# end do number 3
> ;
> #END PART 2 HEVE MOVED TERMS to REGULAR Array
> display_alot(current_iter)
> ;
> od;# end do number 2
> ;#right paren 0001C
> omniout_str(ALWAYS,"Finished!");
> if (glob_iter >= glob_max_iter) then # if number 2
> omniout_str(ALWAYS,"Maximum Iterations Reached before Solution Completed!")
> fi;# end if 2
> ;
> if (elapsed_time_seconds() - convfloat(glob_orig_start_sec) >= convfloat(glob_max_sec )) then # if number 2
> omniout_str(ALWAYS,"Maximum Time Reached before Solution Completed!")
> fi;# end if 2
> ;
> glob_clock_sec := elapsed_time_seconds();
> omniout_str(INFO,"diff ( y , x , 1 ) = log ( x ) ;");
> omniout_int(INFO,"Iterations ",32,glob_iter,4," ")
> ;
> prog_report(x_start,x_end);
> if glob_html_log then # if number 2
> logstart(html_log_file);
> logitem_str(html_log_file,"2012-06-13T01:45:19-05:00")
> ;
> logitem_str(html_log_file,"Maple")
> ;
> logitem_str(html_log_file,"log")
> ;
> logitem_str(html_log_file,"diff ( y , x , 1 ) = log ( x ) ;")
> ;
> logitem_float(html_log_file,x_start)
> ;
> logitem_float(html_log_file,x_end)
> ;
> logitem_float(html_log_file,array_x[1])
> ;
> logitem_float(html_log_file,glob_h)
> ;
> logitem_integer(html_log_file,Digits)
> ;
> ;
> logitem_integer(html_log_file,glob_max_terms)
> ;
> logitem_float(html_log_file,array_1st_rel_error[1])
> ;
> logitem_float(html_log_file,array_last_rel_error[1])
> ;
> logitem_integer(html_log_file,glob_iter)
> ;
> logitem_pole(html_log_file,array_type_pole[1])
> ;
> if array_type_pole[1] = 1 or array_type_pole[1] = 2 then # if number 3
> logitem_float(html_log_file,array_pole[1])
> ;
> logitem_float(html_log_file,array_pole[2])
> ;
> 0;
> else
> logitem_str(html_log_file,"NA")
> ;
> logitem_str(html_log_file,"NA")
> ;
> 0;
> fi;# end if 3
> ;
> logitem_time(html_log_file,convfloat(glob_clock_sec))
> ;
> if glob_percent_done < 100.0 then # if number 3
> logitem_time(html_log_file,convfloat(glob_optimal_expect_sec))
> ;
> 0
> else
> logitem_str(html_log_file,"Done")
> ;
> 0
> fi;# end if 3
> ;
> log_revs(html_log_file," 090 | ")
> ;
> logitem_str(html_log_file,"log diffeq.mxt")
> ;
> logitem_str(html_log_file,"log maple results")
> ;
> logitem_str(html_log_file,"Test of revised logic - mostly affecting systems of eqs")
> ;
> logend(html_log_file)
> ;
> ;
> fi;# end if 2
> ;
> if glob_html_log then # if number 2
> fclose(html_log_file);
> fi;# end if 2
> ;
> ;;
> #END OUTFILEMAIN
> # End Function number 8
> end;
mainprog := proc()
local d1, d2, d3, d4, est_err_2, niii, done_once, term, ord, order_diff,
term_no, html_log_file, rows, r_order, sub_iter, calc_term, iii, temp_sum,
current_iter, x_start, x_end, it, log10norm, max_terms, opt_iter, tmp;
global glob_max_terms, DEBUGMASSIVE, glob_iolevel, INFO, DEBUGL, ALWAYS,
glob_normmax, glob_max_trunc_err, glob_look_poles, glob_clock_sec,
glob_almost_1, glob_warned, glob_no_eqs, glob_max_iter, glob_log10_relerr,
sec_in_min, djd_debug2, glob_dump, glob_warned2, glob_small_float,
glob_display_flag, glob_log10normmin, glob_log10relerr, glob_optimal_start,
glob_abserr, glob_dump_analytic, glob_large_float, centuries_in_millinium,
days_in_year, glob_iter, glob_unchanged_h_cnt, glob_hmax, glob_initial_pass,
glob_hmin, glob_h, glob_reached_optimal_h, glob_not_yet_finished,
glob_max_minutes, glob_orig_start_sec, glob_max_rel_trunc_err,
glob_log10_abserr, glob_optimal_done, min_in_hour, glob_curr_iter_when_opt,
glob_start, glob_smallish_float, glob_not_yet_start_msg, hours_in_day,
djd_debug, glob_max_opt_iter, glob_html_log, glob_log10abserr, glob_max_sec,
glob_clock_start_sec, glob_optimal_expect_sec, glob_percent_done,
MAX_UNCHANGED, glob_current_iter, glob_optimal_clock_start_sec, glob_relerr,
glob_last_good_h, glob_disp_incr, years_in_century, glob_subiter_method,
glob_max_hours, glob_hmin_init, array_const_0D0, array_const_1, array_log,
array_last_rel_error, array_pole, array_type_pole, array_norms,
array_y_init, array_1st_rel_error, array_y, array_x, array_m1, array_tmp0,
array_tmp1, array_y_higher_work2, array_real_pole, array_y_higher,
array_y_set_initial, array_poles, array_complex_pole, array_y_higher_work,
glob_last;
glob_last;
ALWAYS := 1;
INFO := 2;
DEBUGL := 3;
DEBUGMASSIVE := 4;
glob_iolevel := INFO;
glob_max_terms := 30;
DEBUGMASSIVE := 4;
glob_iolevel := 5;
INFO := 2;
DEBUGL := 3;
ALWAYS := 1;
glob_normmax := 0.;
glob_max_trunc_err := 0.1*10^(-10);
glob_look_poles := false;
glob_clock_sec := 0.;
glob_almost_1 := 0.9990;
glob_warned := false;
glob_no_eqs := 0;
glob_max_iter := 1000;
glob_log10_relerr := 0.1*10^(-10);
sec_in_min := 60.0;
djd_debug2 := true;
glob_dump := false;
glob_warned2 := false;
glob_small_float := 0.1*10^(-50);
glob_display_flag := true;
glob_log10normmin := 0.1;
glob_log10relerr := 0.;
glob_optimal_start := 0.;
glob_abserr := 0.1*10^(-10);
glob_dump_analytic := false;
glob_large_float := 0.90*10^101;
centuries_in_millinium := 10.0;
days_in_year := 365.0;
glob_iter := 0;
glob_unchanged_h_cnt := 0;
glob_hmax := 1.0;
glob_initial_pass := true;
glob_hmin := 0.1*10^(-10);
glob_h := 0.1;
glob_reached_optimal_h := false;
glob_not_yet_finished := true;
glob_max_minutes := 0.;
glob_orig_start_sec := 0.;
glob_max_rel_trunc_err := 0.1*10^(-10);
glob_log10_abserr := 0.1*10^(-10);
glob_optimal_done := false;
min_in_hour := 60.0;
glob_curr_iter_when_opt := 0;
glob_start := 0;
glob_smallish_float := 0.1*10^(-100);
glob_not_yet_start_msg := true;
hours_in_day := 24.0;
djd_debug := true;
glob_max_opt_iter := 10;
glob_html_log := true;
glob_log10abserr := 0.;
glob_max_sec := 10000.0;
glob_clock_start_sec := 0.;
glob_optimal_expect_sec := 0.1;
glob_percent_done := 0.;
MAX_UNCHANGED := 10;
glob_current_iter := 0;
glob_optimal_clock_start_sec := 0.;
glob_relerr := 0.1*10^(-10);
glob_last_good_h := 0.1;
glob_disp_incr := 0.1;
years_in_century := 100.0;
glob_subiter_method := 3;
glob_max_hours := 0.;
glob_hmin_init := 0.001;
glob_orig_start_sec := elapsed_time_seconds();
MAX_UNCHANGED := 10;
glob_curr_iter_when_opt := 0;
glob_display_flag := true;
glob_no_eqs := 1;
glob_iter := -1;
opt_iter := -1;
glob_max_iter := 50000;
glob_max_hours := 0.;
glob_max_minutes := 15.0;
omniout_str(ALWAYS, "##############ECHO OF PROBLEM#################");
omniout_str(ALWAYS,
"##############temp/logpostode.ode#################");
omniout_str(ALWAYS, "diff ( y , x , 1 ) = log ( x ) ;");
omniout_str(ALWAYS, "!");
omniout_str(ALWAYS, "#BEGIN FIRST INPUT BLOCK");
omniout_str(ALWAYS, "Digits := 32;");
omniout_str(ALWAYS, "max_terms := 30;");
omniout_str(ALWAYS, "!");
omniout_str(ALWAYS, "#END FIRST INPUT BLOCK");
omniout_str(ALWAYS, "#BEGIN SECOND INPUT BLOCK");
omniout_str(ALWAYS, "x_start := 20.0;");
omniout_str(ALWAYS, "x_end := 30.0 ;");
omniout_str(ALWAYS, "array_y_init[0 + 1] := exact_soln_y(x_start);");
omniout_str(ALWAYS, "glob_h := 0.00001 ;");
omniout_str(ALWAYS, "glob_look_poles := true;");
omniout_str(ALWAYS, "glob_max_iter := 20;");
omniout_str(ALWAYS, "#END SECOND INPUT BLOCK");
omniout_str(ALWAYS, "#BEGIN OVERRIDE BLOCK");
omniout_str(ALWAYS, "glob_h := 0.0001 ;");
omniout_str(ALWAYS, "glob_look_poles := true;");
omniout_str(ALWAYS, "glob_max_iter := 100;");
omniout_str(ALWAYS, "glob_max_minutes := 15;");
omniout_str(ALWAYS, "#END OVERRIDE BLOCK");
omniout_str(ALWAYS, "!");
omniout_str(ALWAYS, "#BEGIN USER DEF BLOCK");
omniout_str(ALWAYS, "exact_soln_y := proc(x)");
omniout_str(ALWAYS, "2.0 +\tx*log(x)-x");
omniout_str(ALWAYS, "end;");
omniout_str(ALWAYS, "");
omniout_str(ALWAYS, "");
omniout_str(ALWAYS, "#END USER DEF BLOCK");
omniout_str(ALWAYS, "#######END OF ECHO OF PROBLEM#################");
glob_unchanged_h_cnt := 0;
glob_warned := false;
glob_warned2 := false;
glob_small_float := 0.10*10^(-199);
glob_smallish_float := 0.10*10^(-63);
glob_large_float := 0.10*10^101;
glob_almost_1 := 0.99;
glob_log10_abserr := -8.0;
glob_log10_relerr := -8.0;
glob_hmax := 0.01;
Digits := 32;
max_terms := 30;
glob_max_terms := max_terms;
glob_html_log := true;
array_log := Array(1 .. max_terms + 1, []);
array_last_rel_error := Array(1 .. max_terms + 1, []);
array_pole := Array(1 .. max_terms + 1, []);
array_type_pole := Array(1 .. max_terms + 1, []);
array_norms := Array(1 .. max_terms + 1, []);
array_y_init := Array(1 .. max_terms + 1, []);
array_1st_rel_error := Array(1 .. max_terms + 1, []);
array_y := Array(1 .. max_terms + 1, []);
array_x := Array(1 .. max_terms + 1, []);
array_m1 := Array(1 .. max_terms + 1, []);
array_tmp0 := Array(1 .. max_terms + 1, []);
array_tmp1 := Array(1 .. max_terms + 1, []);
array_y_higher_work2 := Array(1 .. 3, 1 .. max_terms + 1, []);
array_real_pole := Array(1 .. 2, 1 .. 4, []);
array_y_higher := Array(1 .. 3, 1 .. max_terms + 1, []);
array_y_set_initial := Array(1 .. 3, 1 .. max_terms + 1, []);
array_poles := Array(1 .. 2, 1 .. 4, []);
array_complex_pole := Array(1 .. 2, 1 .. 4, []);
array_y_higher_work := Array(1 .. 3, 1 .. max_terms + 1, []);
term := 1;
while term <= max_terms do array_log[term] := 0.; term := term + 1
end do;
term := 1;
while term <= max_terms do
array_last_rel_error[term] := 0.; term := term + 1
end do;
term := 1;
while term <= max_terms do array_pole[term] := 0.; term := term + 1
end do;
term := 1;
while term <= max_terms do
array_type_pole[term] := 0.; term := term + 1
end do;
term := 1;
while term <= max_terms do array_norms[term] := 0.; term := term + 1
end do;
term := 1;
while term <= max_terms do array_y_init[term] := 0.; term := term + 1
end do;
term := 1;
while term <= max_terms do
array_1st_rel_error[term] := 0.; term := term + 1
end do;
term := 1;
while term <= max_terms do array_y[term] := 0.; term := term + 1 end do
;
term := 1;
while term <= max_terms do array_x[term] := 0.; term := term + 1 end do
;
term := 1;
while term <= max_terms do array_m1[term] := 0.; term := term + 1
end do;
term := 1;
while term <= max_terms do array_tmp0[term] := 0.; term := term + 1
end do;
term := 1;
while term <= max_terms do array_tmp1[term] := 0.; term := term + 1
end do;
ord := 1;
while ord <= 2 do
term := 1;
while term <= max_terms do
array_y_higher_work2[ord, term] := 0.; term := term + 1
end do;
ord := ord + 1
end do;
ord := 1;
while ord <= 1 do
term := 1;
while term <= 3 do
array_real_pole[ord, term] := 0.; term := term + 1
end do;
ord := ord + 1
end do;
ord := 1;
while ord <= 2 do
term := 1;
while term <= max_terms do
array_y_higher[ord, term] := 0.; term := term + 1
end do;
ord := ord + 1
end do;
ord := 1;
while ord <= 2 do
term := 1;
while term <= max_terms do
array_y_set_initial[ord, term] := 0.; term := term + 1
end do;
ord := ord + 1
end do;
ord := 1;
while ord <= 1 do
term := 1;
while term <= 3 do array_poles[ord, term] := 0.; term := term + 1
end do;
ord := ord + 1
end do;
ord := 1;
while ord <= 1 do
term := 1;
while term <= 3 do
array_complex_pole[ord, term] := 0.; term := term + 1
end do;
ord := ord + 1
end do;
ord := 1;
while ord <= 2 do
term := 1;
while term <= max_terms do
array_y_higher_work[ord, term] := 0.; term := term + 1
end do;
ord := ord + 1
end do;
array_log := Array(1 .. max_terms + 2, []);
term := 1;
while term <= max_terms + 1 do array_log[term] := 0.; term := term + 1
end do;
array_x := Array(1 .. max_terms + 2, []);
term := 1;
while term <= max_terms + 1 do array_x[term] := 0.; term := term + 1
end do;
array_y := Array(1 .. max_terms + 2, []);
term := 1;
while term <= max_terms + 1 do array_y[term] := 0.; term := term + 1
end do;
array_tmp1 := Array(1 .. max_terms + 2, []);
term := 1;
while term <= max_terms + 1 do array_tmp1[term] := 0.; term := term + 1
end do;
array_tmp0 := Array(1 .. max_terms + 2, []);
term := 1;
while term <= max_terms + 1 do array_tmp0[term] := 0.; term := term + 1
end do;
array_const_0D0 := Array(1 .. max_terms + 2, []);
term := 1;
while term <= max_terms + 1 do
array_const_0D0[term] := 0.; term := term + 1
end do;
array_const_0D0[1] := 0.;
array_const_1 := Array(1 .. max_terms + 2, []);
term := 1;
while term <= max_terms + 1 do
array_const_1[term] := 0.; term := term + 1
end do;
array_const_1[1] := 1;
array_m1 := Array(1 .. max_terms + 2, []);
term := 1;
while term <= max_terms do array_m1[term] := 0.; term := term + 1
end do;
array_m1[1] := -1.0;
x_start := 20.0;
x_end := 30.0;
array_y_init[1] := exact_soln_y(x_start);
glob_h := 0.00001;
glob_look_poles := true;
glob_max_iter := 20;
glob_h := 0.0001;
glob_look_poles := true;
glob_max_iter := 100;
glob_max_minutes := 15;
glob_last_good_h := glob_h;
glob_max_terms := max_terms;
glob_max_sec := convfloat(60.0)*convfloat(glob_max_minutes)
+ convfloat(3600.0)*convfloat(glob_max_hours);
glob_abserr := 10.0^glob_log10_abserr;
glob_relerr := 10.0^glob_log10_relerr;
chk_data();
array_y_set_initial[1, 1] := true;
array_y_set_initial[1, 2] := false;
array_y_set_initial[1, 3] := false;
array_y_set_initial[1, 4] := false;
array_y_set_initial[1, 5] := false;
array_y_set_initial[1, 6] := false;
array_y_set_initial[1, 7] := false;
array_y_set_initial[1, 8] := false;
array_y_set_initial[1, 9] := false;
array_y_set_initial[1, 10] := false;
array_y_set_initial[1, 11] := false;
array_y_set_initial[1, 12] := false;
array_y_set_initial[1, 13] := false;
array_y_set_initial[1, 14] := false;
array_y_set_initial[1, 15] := false;
array_y_set_initial[1, 16] := false;
array_y_set_initial[1, 17] := false;
array_y_set_initial[1, 18] := false;
array_y_set_initial[1, 19] := false;
array_y_set_initial[1, 20] := false;
array_y_set_initial[1, 21] := false;
array_y_set_initial[1, 22] := false;
array_y_set_initial[1, 23] := false;
array_y_set_initial[1, 24] := false;
array_y_set_initial[1, 25] := false;
array_y_set_initial[1, 26] := false;
array_y_set_initial[1, 27] := false;
array_y_set_initial[1, 28] := false;
array_y_set_initial[1, 29] := false;
array_y_set_initial[1, 30] := false;
if glob_html_log then
html_log_file := fopen("html/entry.html", WRITE, TEXT)
end if;
omniout_str(ALWAYS, "START of Soultion");
array_x[1] := x_start;
array_x[2] := glob_h;
order_diff := 1;
term_no := 1;
while term_no <= order_diff do
array_y[term_no] := array_y_init[term_no]*glob_h^(term_no - 1)/
factorial_1(term_no - 1);
term_no := term_no + 1
end do;
rows := order_diff;
r_order := 1;
while r_order <= rows do
term_no := 1;
while term_no <= rows - r_order + 1 do
it := term_no + r_order - 1;
array_y_higher[r_order, term_no] := array_y_init[it]*
glob_h^(term_no - 1)/factorial_1(term_no - 1);
term_no := term_no + 1
end do;
r_order := r_order + 1
end do;
current_iter := 1;
glob_clock_start_sec := elapsed_time_seconds();
start_array_y();
if glob_small_float < abs(array_y_higher[1, 1]) then
tmp := abs(array_y_higher[1, 1]);
log10norm := log10(tmp);
if log10norm < glob_log10normmin then
glob_log10normmin := log10norm
end if
end if;
display_alot(current_iter);
glob_clock_sec := elapsed_time_seconds();
glob_current_iter := 0;
glob_iter := 0;
omniout_str(DEBUGL, " ");
glob_reached_optimal_h := true;
glob_optimal_clock_start_sec := elapsed_time_seconds();
while glob_current_iter < glob_max_iter and array_x[1] <= x_end and
convfloat(glob_clock_sec) - convfloat(glob_orig_start_sec) <
convfloat(glob_max_sec) do
omniout_str(INFO, " ");
omniout_str(INFO, "TOP MAIN SOLVE Loop");
glob_iter := glob_iter + 1;
glob_clock_sec := elapsed_time_seconds();
glob_current_iter := glob_current_iter + 1;
atomall();
if glob_look_poles then check_for_pole() end if;
array_x[1] := array_x[1] + glob_h;
array_x[2] := glob_h;
order_diff := 1;
ord := 2;
calc_term := 1;
iii := glob_max_terms;
while calc_term <= iii do
array_y_higher_work[2, iii] := array_y_higher[2, iii]/(
glob_h^(calc_term - 1)*
factorial_3(iii - calc_term, iii - 1));
iii := iii - 1
end do;
temp_sum := 0.;
ord := 2;
calc_term := 1;
iii := glob_max_terms;
while calc_term <= iii do
temp_sum := temp_sum + array_y_higher_work[ord, iii];
iii := iii - 1
end do;
array_y_higher_work2[ord, calc_term] :=
temp_sum*glob_h^(calc_term - 1)/convfp(calc_term - 1)!;
ord := 1;
calc_term := 2;
iii := glob_max_terms;
while calc_term <= iii do
array_y_higher_work[1, iii] := array_y_higher[1, iii]/(
glob_h^(calc_term - 1)*
factorial_3(iii - calc_term, iii - 1));
iii := iii - 1
end do;
temp_sum := 0.;
ord := 1;
calc_term := 2;
iii := glob_max_terms;
while calc_term <= iii do
temp_sum := temp_sum + array_y_higher_work[ord, iii];
iii := iii - 1
end do;
array_y_higher_work2[ord, calc_term] :=
temp_sum*glob_h^(calc_term - 1)/convfp(calc_term - 1)!;
ord := 1;
calc_term := 1;
iii := glob_max_terms;
while calc_term <= iii do
array_y_higher_work[1, iii] := array_y_higher[1, iii]/(
glob_h^(calc_term - 1)*
factorial_3(iii - calc_term, iii - 1));
iii := iii - 1
end do;
temp_sum := 0.;
ord := 1;
calc_term := 1;
iii := glob_max_terms;
while calc_term <= iii do
temp_sum := temp_sum + array_y_higher_work[ord, iii];
iii := iii - 1
end do;
array_y_higher_work2[ord, calc_term] :=
temp_sum*glob_h^(calc_term - 1)/convfp(calc_term - 1)!;
term_no := glob_max_terms;
while 1 <= term_no do
array_y[term_no] := array_y_higher_work2[1, term_no];
ord := 1;
while ord <= order_diff do
array_y_higher[ord, term_no] :=
array_y_higher_work2[ord, term_no];
ord := ord + 1
end do;
term_no := term_no - 1
end do;
display_alot(current_iter)
end do;
omniout_str(ALWAYS, "Finished!");
if glob_max_iter <= glob_iter then omniout_str(ALWAYS,
"Maximum Iterations Reached before Solution Completed!")
end if;
if convfloat(glob_max_sec) <=
elapsed_time_seconds() - convfloat(glob_orig_start_sec) then
omniout_str(ALWAYS,
"Maximum Time Reached before Solution Completed!")
end if;
glob_clock_sec := elapsed_time_seconds();
omniout_str(INFO, "diff ( y , x , 1 ) = log ( x ) ;");
omniout_int(INFO, "Iterations ", 32, glob_iter, 4,
" ");
prog_report(x_start, x_end);
if glob_html_log then
logstart(html_log_file);
logitem_str(html_log_file, "2012-06-13T01:45:19-05:00");
logitem_str(html_log_file, "Maple");
logitem_str(html_log_file, "log");
logitem_str(html_log_file, "diff ( y , x , 1 ) = log ( x ) ;");
logitem_float(html_log_file, x_start);
logitem_float(html_log_file, x_end);
logitem_float(html_log_file, array_x[1]);
logitem_float(html_log_file, glob_h);
logitem_integer(html_log_file, Digits);
logitem_integer(html_log_file, glob_max_terms);
logitem_float(html_log_file, array_1st_rel_error[1]);
logitem_float(html_log_file, array_last_rel_error[1]);
logitem_integer(html_log_file, glob_iter);
logitem_pole(html_log_file, array_type_pole[1]);
if array_type_pole[1] = 1 or array_type_pole[1] = 2 then
logitem_float(html_log_file, array_pole[1]);
logitem_float(html_log_file, array_pole[2]);
0
else
logitem_str(html_log_file, "NA");
logitem_str(html_log_file, "NA");
0
end if;
logitem_time(html_log_file, convfloat(glob_clock_sec));
if glob_percent_done < 100.0 then
logitem_time(html_log_file, convfloat(glob_optimal_expect_sec))
;
0
else logitem_str(html_log_file, "Done"); 0
end if;
log_revs(html_log_file, " 090 | ");
logitem_str(html_log_file,
"log diffeq.mxt");
logitem_str(html_log_file,
"log maple results");
logitem_str(html_log_file,
"Test of revised logic - mostly affecting systems of eqs");
logend(html_log_file)
end if;
if glob_html_log then fclose(html_log_file) end if
end proc
> mainprog();
##############ECHO OF PROBLEM#################
##############temp/logpostode.ode#################
diff ( y , x , 1 ) = log ( x ) ;
!
#BEGIN FIRST INPUT BLOCK
Digits := 32;
max_terms := 30;
!
#END FIRST INPUT BLOCK
#BEGIN SECOND INPUT BLOCK
x_start := 20.0;
x_end := 30.0 ;
array_y_init[0 + 1] := exact_soln_y(x_start);
glob_h := 0.00001 ;
glob_look_poles := true;
glob_max_iter := 20;
#END SECOND INPUT BLOCK
#BEGIN OVERRIDE BLOCK
glob_h := 0.0001 ;
glob_look_poles := true;
glob_max_iter := 100;
glob_max_minutes := 15;
#END OVERRIDE BLOCK
!
#BEGIN USER DEF BLOCK
exact_soln_y := proc(x)
2.0 + x*log(x)-x
end;
#END USER DEF BLOCK
#######END OF ECHO OF PROBLEM#################
START of Soultion
x[1] = 20
y[1] (analytic) = 41.91464547107981986870447152285
y[1] (numeric) = 41.91464547107981986870447152285
absolute error = 0
relative error = 0 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0001
y[1] (analytic) = 41.914945044557174851138190042083
y[1] (numeric) = 41.91664547607981986870447152285
absolute error = 0.001700431522645017566281480767
relative error = 0.0040568621069105409152649068674258 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0002
y[1] (analytic) = 41.9152446185345273335864918009
y[1] (numeric) = 41.91864549107981986870447152285
absolute error = 0.00340087254529253511797972195
relative error = 0.008113688888716878042835808993665 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0003
y[1] (analytic) = 41.915544193011874816086876330555
y[1] (numeric) = 41.92064551607981986870447152285
absolute error = 0.005101323067945052617595192295
relative error = 0.012170480346037213134071192293617 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0004
y[1] (analytic) = 41.915843767989214798701842412323
y[1] (numeric) = 41.92264555107981986870447152285
absolute error = 0.006801783090605070002629110527
relative error = 0.016227236479489733703476741986763 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0005
y[1] (analytic) = 41.91614334346654478151888770251
y[1] (numeric) = 41.92464559607981986870447152285
absolute error = 0.00850225261327508718558382034
relative error = 0.02028395728969261302910808552488 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0006
y[1] (analytic) = 41.916442919443862264650508357482
y[1] (numeric) = 41.92664565107981986870447152285
absolute error = 0.010202731635957604053963165368
relative error = 0.024340642777264010152973522022504 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0007
y[1] (analytic) = 41.916742495921164748234198658704
y[1] (numeric) = 41.92864571607981986870447152285
absolute error = 0.011903220158655120470272864146
relative error = 0.028397292942822069881436738212135 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0008
y[1] (analytic) = 41.917042072898449732432450637775
y[1] (numeric) = 41.93064579107981986870447152285
absolute error = 0.013603718181370136272020885075
relative error = 0.032453907786984922785619510958093 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0009
y[1] (analytic) = 41.917341650375714717432753701479
y[1] (numeric) = 41.93264587607981986870447152285
absolute error = 0.015304225704105151271717821371
relative error = 0.036510487310370685201804396281842 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.001
y[1] (analytic) = 41.917641228352957203447594256844
y[1] (numeric) = 41.93464597107981986870447152285
absolute error = 0.017004742726862665256877266006
relative error = 0.040567031513597459231837404918373 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0011
y[1] (analytic) = 41.917940806830174690714455336197
y[1] (numeric) = 41.93664607607981986870447152285
absolute error = 0.018705269249645177990016186653
relative error = 0.044623540397283332743530664432816 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0012
y[1] (analytic) = 41.918240385807364679495816222244
y[1] (numeric) = 41.93864619107981986870447152285
absolute error = 0.020405805272455189208655300606
relative error = 0.048680013962046379371065067828575 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0013
y[1] (analytic) = 41.918539965284524670079152073152
y[1] (numeric) = 41.94064631607981986870447152285
absolute error = 0.022106350795295198625319449698
relative error = 0.052736452208504658515392908702407 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0014
y[1] (analytic) = 41.91883954526165216277693354762
y[1] (numeric) = 41.94264645107981986870447152285
absolute error = 0.02380690581816770592753797523
relative error = 0.056792855137276215344640502977994 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0015
y[1] (analytic) = 41.919139125738744657926626429987
y[1] (numeric) = 41.94464659607981986870447152285
absolute error = 0.025507470341075210777845092863
relative error = 0.060849222748979080794510797103945 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0016
y[1] (analytic) = 41.919438706715799655890691255325
y[1] (numeric) = 41.94664675107981986870447152285
absolute error = 0.027208044364020212813780267525
relative error = 0.064905555044231271568685962840884 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0017
y[1] (analytic) = 41.919738288192814657056582934556
y[1] (numeric) = 41.94864691607981986870447152285
absolute error = 0.028908627887005211647888588294
relative error = 0.068961852023650790139229978545032 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0018
y[1] (analytic) = 41.92003787016978716183675037956
y[1] (numeric) = 41.95064709107981986870447152285
absolute error = 0.03060922091003270686772114329
relative error = 0.073018113687855624746991197027591 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0019
y[1] (analytic) = 41.920337452646714670668636128299
y[1] (numeric) = 41.95264727607981986870447152285
absolute error = 0.032309823433105198035835394551
relative error = 0.077074340037463749402004899930753 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.002
y[1] (analytic) = 41.920637035623594684014675969956
y[1] (numeric) = 41.95464747107981986870447152285
absolute error = 0.034010435456225184689795552894
relative error = 0.081130531073093123883895838623257 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0021
y[1] (analytic) = 41.920936619100424702362298570066
y[1] (numeric) = 41.95664767607981986870447152285
absolute error = 0.035711056979395166342172952784
relative error = 0.085186686795361693742280761670906 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0022
y[1] (analytic) = 41.921236203077202226223925095667
y[1] (numeric) = 41.95864789107981986870447152285
absolute error = 0.037411688002617642480546427183
relative error = 0.089242807204887390297170928815722 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0023
y[1] (analytic) = 41.921535787553924756136968840447
y[1] (numeric) = 41.96064811607981986870447152285
absolute error = 0.039112328525895112567502682403
relative error = 0.093298892302288130639374611521559 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0024
y[1] (analytic) = 41.921835372530589792663834849918
y[1] (numeric) = 41.96264835107981986870447152285
absolute error = 0.040812978549230076040636672932
relative error = 0.097354942088181817630899580012671 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0025
y[1] (analytic) = 41.92213495800719483639191954657
y[1] (numeric) = 41.96464859607981986870447152285
absolute error = 0.04251363807262503231255197628
relative error = 0.10141095656318633990535557691798 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0026
y[1] (analytic) = 41.922434543983737387933610355055
y[1] (numeric) = 41.96664885107981986870447152285
absolute error = 0.044214307096082480770861167795
relative error = 0.10546693572791957186835677740216 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0027
y[1] (analytic) = 41.922734130460214947926285327371
y[1] (numeric) = 41.96864911607981986870447152285
absolute error = 0.045914985619604920778186195479
relative error = 0.10952287958299937369792423585574 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0028
y[1] (analytic) = 41.923033717436625017032312768053
y[1] (numeric) = 41.97064939107981986870447152285
absolute error = 0.047615673643194851672158754797
relative error = 0.11357878812904359134488831912791 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0029
y[1] (analytic) = 41.923333304912965095939050859364
y[1] (numeric) = 41.97264967607981986870447152285
absolute error = 0.049316371166854772765420663486
relative error = 0.11763466136667005653329112631945 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.003
y[1] (analytic) = 41.923632892889232685358847286516
y[1] (numeric) = 41.97464997107981986870447152285
absolute error = 0.051017078190587183345624236334
relative error = 0.12169049929649658676078889506449 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0031
y[1] (analytic) = 41.923932481365425286029038862868
y[1] (numeric) = 41.97665027607981986870447152285
absolute error = 0.052717794714394582675432659982
relative error = 0.12574630191914098529905439442822 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0032
y[1] (analytic) = 41.92423207034154039871195115516
y[1] (numeric) = 41.97865059107981986870447152285
absolute error = 0.05441852073827946999252036769
relative error = 0.1298020692352210411941793042803 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0033
y[1] (analytic) = 41.924531659817575524194898108733
y[1] (numeric) = 41.98065091607981986870447152285
absolute error = 0.056119256262244344509573414117
relative error = 0.13385780124535452926707658126368 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0034
y[1] (analytic) = 41.92483124979352816329018167277
y[1] (numeric) = 41.98265125107981986870447152285
absolute error = 0.05782000128629170541428985008
relative error = 0.137913497950159210113882811276 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0035
y[1] (analytic) = 41.925130840269395816835091425533
y[1] (numeric) = 41.98465159607981986870447152285
absolute error = 0.059520755810424051869380097317
relative error = 0.14196915935025283010636054852354 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0036
y[1] (analytic) = 41.925430431245175985691904199626
y[1] (numeric) = 41.98665195107981986870447152285
absolute error = 0.061221519834643883012567323224
relative error = 0.14602478544625312139230064107684 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0037
y[1] (analytic) = 41.925730022720866170747883707244
y[1] (numeric) = 41.98865231607981986870447152285
absolute error = 0.062922293358953697956587815606
relative error = 0.15008037623877780189592454302382 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0038
y[1] (analytic) = 41.926029614696463872915280165439
y[1] (numeric) = 41.99065269107981986870447152285
absolute error = 0.064623076383355995789191357411
relative error = 0.15413593172844457531828661314707 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0039
y[1] (analytic) = 41.9263292071719665931313299214
y[1] (numeric) = 41.99265307607981986870447152285
absolute error = 0.06632386890785327557314160145
relative error = 0.15819145191587113113767640013286 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.004
y[1] (analytic) = 41.926628800147371832358255077728
y[1] (numeric) = 41.99465347107981986870447152285
absolute error = 0.068024670932448036346216445122
relative error = 0.16224693680167514461002091435777 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0041
y[1] (analytic) = 41.926928393622677091583263117731
y[1] (numeric) = 41.99665387607981986870447152285
absolute error = 0.069725482457142777121208405119
relative error = 0.16630238638647427676928688619389 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0042
y[1] (analytic) = 41.92722798759787987181854653071
y[1] (numeric) = 41.99865429107981986870447152285
absolute error = 0.07142630348193999688592499214
relative error = 0.17035780067088617442788301090216 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0043
y[1] (analytic) = 41.927527582072977674101282437275
y[1] (numeric) = 42.00065471607981986870447152285
absolute error = 0.073127134006842194603189085575
relative error = 0.17441317965552847017706218002142 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0044
y[1] (analytic) = 41.927827177047967999493632214646
y[1] (numeric) = 42.00265515107981986870447152285
absolute error = 0.074827974031851869210839308204
relative error = 0.17846852334101878238732369936104 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0045
y[1] (analytic) = 41.928126772522848349082741121978
y[1] (numeric) = 42.00465559607981986870447152285
absolute error = 0.076528823556971519621730400872
relative error = 0.1825238317279747152088154935045 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0046
y[1] (analytic) = 41.928426368497616223980737925683
y[1] (numeric) = 42.00665605107981986870447152285
absolute error = 0.078229682582203644723733597167
relative error = 0.18657910481701385857173629688903 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0047
y[1] (analytic) = 41.928725964972269125324734524765
y[1] (numeric) = 42.00865651607981986870447152285
absolute error = 0.079930551107550743379736998085
relative error = 0.19063434260875378818673783142352 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
memory used=3.8MB, alloc=2.7MB, time=0.19
x[1] = 20.0048
y[1] (analytic) = 41.929025561946804554276825576165
y[1] (numeric) = 42.01065699107981986870447152285
absolute error = 0.081631429133015314427645946685
relative error = 0.19468954510381206554532697065235 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0049
y[1] (analytic) = 41.929325159421220012024088120097
y[1] (numeric) = 42.01265747607981986870447152285
absolute error = 0.083332316658599856680383402753
relative error = 0.1987447123028062379202678905112 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.005
y[1] (analytic) = 41.929624757395512999778581205422
y[1] (numeric) = 42.01465797107981986870447152285
absolute error = 0.085033213684306868925890317428
relative error = 0.20279984420635383836598420656291 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0051
y[1] (analytic) = 41.929924355869681018777345514999
y[1] (numeric) = 42.01665847607981986870447152285
absolute error = 0.086734120210138849927126007851
relative error = 0.20685494081507238571896109785973 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0052
y[1] (analytic) = 41.930223954843721570282402991057
y[1] (numeric) = 42.01865899107981986870447152285
absolute error = 0.088435036236098298422068531793
relative error = 0.21091000212957938459814741732734 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0053
y[1] (analytic) = 41.930523554317632155580756460581
y[1] (numeric) = 42.02065951607981986870447152285
absolute error = 0.090135961762187713123715062269
relative error = 0.21496502815049232540535778868785 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0054
y[1] (analytic) = 41.930823154291410275984389260687
y[1] (numeric) = 42.02266005107981986870447152285
absolute error = 0.091836896788409592720082262163
relative error = 0.2190200188784286843256746899821 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0055
y[1] (analytic) = 41.931122754765053432830264864025
y[1] (numeric) = 42.02466059607981986870447152285
absolute error = 0.093537841314766435874206658825
relative error = 0.22307497431400592332785052359854 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0056
y[1] (analytic) = 41.931422355738559127480326504175
y[1] (numeric) = 42.02666115107981986870447152285
absolute error = 0.095238795341260741224145018675
relative error = 0.22712989445784149016470967289278 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0057
y[1] (analytic) = 41.931721957211924861321496801057
y[1] (numeric) = 42.02866171607981986870447152285
absolute error = 0.096939758867895007382974721793
relative error = 0.23118477931055281837355054534832 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0058
y[1] (analytic) = 41.932021559185148135765677386349
y[1] (numeric) = 42.03066229107981986870447152285
absolute error = 0.098640731894671732938794136501
relative error = 0.23523962887275732727654760229315 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0059
y[1] (analytic) = 41.932321161658226452249748528903
y[1] (numeric) = 42.03266287607981986870447152285
absolute error = 0.100341714421593416454722993947
relative error = 0.23929444314507242198115337519668 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.006
y[1] (analytic) = 41.932620764631157312235568760188
y[1] (numeric) = 42.03466347107981986870447152285
absolute error = 0.102042706448662556468902762662
relative error = 0.24334922212811549338050046847825 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0061
y[1] (analytic) = 41.932920368103938217209974499715
y[1] (numeric) = 42.03666407607981986870447152285
absolute error = 0.103743707975881651494497023135
relative error = 0.24740396582250391815380354893532 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0062
y[1] (analytic) = 41.933219972076566668684779680495
y[1] (numeric) = 42.03866469107981986870447152285
absolute error = 0.105444719003253200019691842355
relative error = 0.25145867422885505876676132166975 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0063
y[1] (analytic) = 41.933519576549040168196775374481
y[1] (numeric) = 42.04066531607981986870447152285
absolute error = 0.107145739530779700507696148369
relative error = 0.25551334734778626347195849263015 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0064
y[1] (analytic) = 41.933819181521356217307729418041
y[1] (numeric) = 42.04266595107981986870447152285
absolute error = 0.108846769558463651396742104809
relative error = 0.25956798517991486630926771765815 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0065
y[1] (analytic) = 41.934118786993512317604386037418
y[1] (numeric) = 42.04466659607981986870447152285
absolute error = 0.110547809086307551100085485432
relative error = 0.26362258772585818710625153814446 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0066
y[1] (analytic) = 41.934418392965505970698465474205
y[1] (numeric) = 42.04666725107981986870447152285
absolute error = 0.112248858114313898006006048645
relative error = 0.26767715498623353147856430322831 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0067
y[1] (analytic) = 41.934717999437334678226663610834
y[1] (numeric) = 42.04866791607981986870447152285
absolute error = 0.113949916642485190477807912016
relative error = 0.27173168696165819083035407854305 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0068
y[1] (analytic) = 41.935017606408995941850651596064
y[1] (numeric) = 42.05066859107981986870447152285
absolute error = 0.115650984670823926853819926786
relative error = 0.27578618365274944235466454154445 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0069
y[1] (analytic) = 41.935317213880487263257075470484
y[1] (numeric) = 42.05266927607981986870447152285
absolute error = 0.117352062199332605447396052366
relative error = 0.2798406450601245490338368633838 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.007
y[1] (analytic) = 41.935616821851806144157555792004
y[1] (numeric) = 42.05466997107981986870447152285
absolute error = 0.119053149228013724546915730846
relative error = 0.28389507118440075963991157739108 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0071
y[1] (analytic) = 41.935916430322950086288687261387
y[1] (numeric) = 42.05667067607981986870447152285
absolute error = 0.120754245756869782415784261463
relative error = 0.28794946202619530873503043404174 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0072
y[1] (analytic) = 41.936216039293916591412038347761
y[1] (numeric) = 42.05867139107981986870447152285
absolute error = 0.122455351785903277292433175089
relative error = 0.29200381758612541667183824255373 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0073
y[1] (analytic) = 41.936515648764703161314150914146
y[1] (numeric) = 42.06067211607981986870447152285
absolute error = 0.124156467315116707390320608704
relative error = 0.2960581378648082895938846990314 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0074
y[1] (analytic) = 41.936815258735307297806539842989
y[1] (numeric) = 42.06267285107981986870447152285
absolute error = 0.125857592344512570897931679861
relative error = 0.30011242286286111943602620117363 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0075
y[1] (analytic) = 41.937114869205726502725692661717
y[1] (numeric) = 42.06467359607981986870447152285
absolute error = 0.127558726874093365978778861133
relative error = 0.30416667258090108392482764952281 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0076
y[1] (analytic) = 41.93741448017595827793306916827
y[1] (numeric) = 42.06667435107981986870447152285
absolute error = 0.12925987090386159077140235458
relative error = 0.30822088701954534657896423534591 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0077
y[1] (analytic) = 41.937714091646000125315101056683
y[1] (numeric) = 42.06867511607981986870447152285
absolute error = 0.130961024433819743389370466167
relative error = 0.31227506617941105670962321498341 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0078
y[1] (analytic) = 41.93801370361584954678319154263
y[1] (numeric) = 42.07067589107981986870447152285
absolute error = 0.13266218746397032192127998022
relative error = 0.31632921006111534942090567087435 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0079
y[1] (analytic) = 41.938313316085504044273714989002
y[1] (numeric) = 42.07267667607981986870447152285
absolute error = 0.134363359994315824430756533848
relative error = 0.32038331866527534561022825908614 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.008
y[1] (analytic) = 41.938612929054961119748016531504
y[1] (numeric) = 42.07467747107981986870447152285
absolute error = 0.136064542024858748956454991346
relative error = 0.32443739199250815196872494338528 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0081
y[1] (analytic) = 41.938912542524218275192411704219
y[1] (numeric) = 42.07667827607981986870447152285
absolute error = 0.137765733555601593512059818631
relative error = 0.32849143004343086098164871597396 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0082
y[1] (analytic) = 41.93921215649327301261818606522
y[1] (numeric) = 42.07867909107981986870447152285
absolute error = 0.13946693458654685608628545763
relative error = 0.33254543281866055092877330469938 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0083
y[1] (analytic) = 41.939511770962122834061594822168
y[1] (numeric) = 42.08067991607981986870447152285
absolute error = 0.141168145117697034642876700682
relative error = 0.33659940031881428588479486688455 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0084
y[1] (analytic) = 41.939811385930765241583862457927
y[1] (numeric) = 42.08268075107981986870447152285
absolute error = 0.142869365149054627120609064923
relative error = 0.34065333254450911571973366970687 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0085
y[1] (analytic) = 41.940111001399197737271182356168
y[1] (numeric) = 42.08468159607981986870447152285
absolute error = 0.144570594680622131433289166682
relative error = 0.34470722949636207609933575719211 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0086
y[1] (analytic) = 41.940410617367417823234716427015
y[1] (numeric) = 42.08668245107981986870447152285
absolute error = 0.146271833712402045469755095835
relative error = 0.34876109117499018848547460369748 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0087
y[1] (analytic) = 41.940710233835423001610594732663
y[1] (numeric) = 42.08868331607981986870447152285
absolute error = 0.147973082244396867093876790187
relative error = 0.3528149175810104601365527540517 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0088
y[1] (analytic) = 41.941009850803210774559915113023
y[1] (numeric) = 42.09068419107981986870447152285
absolute error = 0.149674340276609094144556409827
relative error = 0.35686870871503988410790345022106 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0089
y[1] (analytic) = 41.941309468270778644268742811371
y[1] (numeric) = 42.09268507607981986870447152285
absolute error = 0.151375607809041224435728711479
relative error = 0.36092246457769543925219224455705 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.009
y[1] (analytic) = 41.941609086238124112948110100007
y[1] (numeric) = 42.09468597107981986870447152285
absolute error = 0.153076884841695755756361422843
relative error = 0.36497618516959409021981859961167 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0091
y[1] (analytic) = 41.941908704705244682834015905909
y[1] (numeric) = 42.09668687607981986870447152285
absolute error = 0.154778171374575185870455616941
relative error = 0.3690298704913527874593174745568 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0092
y[1] (analytic) = 41.94220832367213785618742543641
y[1] (numeric) = 42.09868779107981986870447152285
absolute error = 0.15647946740768201251704608644
relative error = 0.37308352054358846721776089814122 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0093
y[1] (analytic) = 41.942507943138801135294269804872
y[1] (numeric) = 42.10068871607981986870447152285
absolute error = 0.158180772941018733410201717978
relative error = 0.37713713532691805154115952824799 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0094
y[1] (analytic) = 41.942807563105232022465445656377
y[1] (numeric) = 42.10268965107981986870447152285
absolute error = 0.159882087974587846239025866473
relative error = 0.3811907148419584482748641980048 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0095
y[1] (analytic) = 41.943107183571428020036814793421
y[1] (numeric) = 42.10469059607981986870447152285
absolute error = 0.161583412508391848667656729429
relative error = 0.38524425908932655106396744848137 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0096
y[1] (analytic) = 41.9434068045373866303692038016
y[1] (numeric) = 42.10669155107981986870447152285
absolute error = 0.16328474654243323833526772125
relative error = 0.38929776806963923935370504800071 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0097
y[1] (analytic) = 41.943706426003105355848403675338
y[1] (numeric) = 42.10869251607981986870447152285
absolute error = 0.164986090076714512856067847512
relative error = 0.39335124178351337838985749794512 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0098
y[1] (analytic) = 41.944006047968581698885169443584
y[1] (numeric) = 42.11069349107981986870447152285
absolute error = 0.166687443111238169819302079266
relative error = 0.39740468023156581921915152523208 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.0099
y[1] (analytic) = 41.944305670433813161915219795551
y[1] (numeric) = 42.11269447607981986870447152285
absolute error = 0.168388805646006706789251727299
relative error = 0.40145808341441339868966156128599 %
h = 0.0001
TOP MAIN SOLVE Loop
NO POLE
x[1] = 20.01
y[1] (analytic) = 41.944605293398797247399236706435
y[1] (numeric) = 42.11469547107981986870447152285
absolute error = 0.170090177681022621305234816415
relative error = 0.40551145133267293945121120765445 %
h = 0.0001
Finished!
Maximum Iterations Reached before Solution Completed!
diff ( y , x , 1 ) = log ( x ) ;
Iterations = 100
Total Elapsed Time = 0 Seconds
Elapsed Time(since restart) = 0 Seconds
Expected Time Remaining = 5 Minutes 14 Seconds
Optimized Time Remaining = 5 Minutes 9 Seconds
Time to Timeout = 14 Minutes 59 Seconds
Percent Done = 0.101 %
> quit
memory used=6.8MB, alloc=2.9MB, time=0.36