|\^/| 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 > > display_alot := proc(iter) > global > glob_iolevel, > DEBUGMASSIVE, > glob_max_terms, > INFO, > ALWAYS, > DEBUGL, #Top Generate Globals Decl > glob_max_minutes, > glob_iter, > glob_unchanged_h_cnt, > glob_max_opt_iter, > glob_log10normmin, > glob_normmax, > glob_look_poles, > glob_log10relerr, > glob_start, > glob_max_sec, > glob_small_float, > glob_optimal_clock_start_sec, > glob_dump_analytic, > glob_large_float, > glob_percent_done, > glob_max_rel_trunc_err, > glob_log10_abserr, > days_in_year, > sec_in_min, > glob_log10abserr, > glob_curr_iter_when_opt, > glob_orig_start_sec, > glob_max_trunc_err, > glob_relerr, > glob_last_good_h, > glob_not_yet_start_msg, > djd_debug2, > glob_dump, > glob_html_log, > MAX_UNCHANGED, > glob_warned, > glob_optimal_start, > glob_hmin, > glob_disp_incr, > glob_not_yet_finished, > glob_hmin_init, > glob_optimal_done, > centuries_in_millinium, > hours_in_day, > min_in_hour, > glob_max_iter, > glob_log10_relerr, > glob_reached_optimal_h, > glob_clock_start_sec, > glob_smallish_float, > glob_no_eqs, > glob_max_order, > glob_abserr, > glob_current_iter, > glob_warned2, > glob_almost_1, > years_in_century, > glob_display_flag, > djd_debug, > glob_optimal_expect_sec, > glob_max_hours, > glob_hmax, > glob_h, > glob_initial_pass, > glob_clock_sec, #Bottom Generate Globals Decl #BEGIN CONST > array_const_1, > array_const_0D0, #END CONST > array_x, > array_1st_rel_error, > array_norms, > array_tmp4_g, > array_m1, > array_y2, > array_y1, > array_last_rel_error, > array_y1_init, > array_tmp0, > array_tmp1, > array_tmp2, > array_tmp3, > array_tmp4, > array_type_pole, > array_pole, > array_y2_init, > array_y1_higher_work, > array_y2_higher, > array_y1_higher_work2, > array_poles, > array_y1_higher, > array_y2_higher_work2, > array_y2_higher_work, > array_complex_pole, > array_real_pole, > glob_last; > > local abserr, analytic_val_y, ind_var, numeric_val, relerr, term_no; #TOP DISPLAY ALOT > if (iter >= 0) then > ind_var := array_x[1]; > omniout_float(ALWAYS,"x[1] ",33,ind_var,20," "); > analytic_val_y := exact_soln_y2(ind_var); > omniout_float(ALWAYS,"y2[1] (analytic) ",33,analytic_val_y,20," "); > term_no := 1; > numeric_val := array_y2[term_no]; > abserr := abs(numeric_val - analytic_val_y); > omniout_float(ALWAYS,"y2[1] (numeric) ",33,numeric_val,20," "); > if (abs(analytic_val_y) <> 0.0) then > relerr := abserr*100.0/abs(analytic_val_y); > else > relerr := -1.0 ; > fi;; > if glob_iter = 1 then > array_1st_rel_error[1] := relerr; > else > array_last_rel_error[1] := relerr; > fi;; > omniout_float(ALWAYS,"absolute error ",4,abserr,20," "); > omniout_float(ALWAYS,"relative error ",4,relerr,20,"%"); > omniout_float(ALWAYS,"h ",4,glob_h,20," "); > ; > analytic_val_y := exact_soln_y1(ind_var); > omniout_float(ALWAYS,"y1[1] (analytic) ",33,analytic_val_y,20," "); > term_no := 1; > numeric_val := array_y1[term_no]; > abserr := abs(numeric_val - analytic_val_y); > omniout_float(ALWAYS,"y1[1] (numeric) ",33,numeric_val,20," "); > if (abs(analytic_val_y) <> 0.0) then > relerr := abserr*100.0/abs(analytic_val_y); > else > relerr := -1.0 ; > fi;; > if glob_iter = 1 then > array_1st_rel_error[2] := relerr; > else > array_last_rel_error[2] := relerr; > fi;; > 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; display_alot := proc(iter) local abserr, analytic_val_y, ind_var, numeric_val, relerr, term_no; global glob_iolevel, DEBUGMASSIVE, glob_max_terms, INFO, ALWAYS, DEBUGL, glob_max_minutes, glob_iter, glob_unchanged_h_cnt, glob_max_opt_iter, glob_log10normmin, glob_normmax, glob_look_poles, glob_log10relerr, glob_start, glob_max_sec, glob_small_float, glob_optimal_clock_start_sec, glob_dump_analytic, glob_large_float, glob_percent_done, glob_max_rel_trunc_err, glob_log10_abserr, days_in_year, sec_in_min, glob_log10abserr, glob_curr_iter_when_opt, glob_orig_start_sec, glob_max_trunc_err, glob_relerr, glob_last_good_h, glob_not_yet_start_msg, djd_debug2, glob_dump, glob_html_log, MAX_UNCHANGED, glob_warned, glob_optimal_start, glob_hmin, glob_disp_incr, glob_not_yet_finished, glob_hmin_init, glob_optimal_done, centuries_in_millinium, hours_in_day, min_in_hour, glob_max_iter, glob_log10_relerr, glob_reached_optimal_h, glob_clock_start_sec, glob_smallish_float, glob_no_eqs, glob_max_order, glob_abserr, glob_current_iter, glob_warned2, glob_almost_1, years_in_century, glob_display_flag, djd_debug, glob_optimal_expect_sec, glob_max_hours, glob_hmax, glob_h, glob_initial_pass, glob_clock_sec, array_const_1, array_const_0D0, array_x, array_1st_rel_error, array_norms, array_tmp4_g, array_m1, array_y2, array_y1, array_last_rel_error, array_y1_init, array_tmp0, array_tmp1, array_tmp2, array_tmp3, array_tmp4, array_type_pole, array_pole, array_y2_init, array_y1_higher_work, array_y2_higher, array_y1_higher_work2, array_poles, array_y1_higher, array_y2_higher_work2, array_y2_higher_work, array_complex_pole, array_real_pole, 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_y2(ind_var); omniout_float(ALWAYS, "y2[1] (analytic) ", 33, analytic_val_y, 20, " "); term_no := 1; numeric_val := array_y2[term_no]; abserr := abs(numeric_val - analytic_val_y); omniout_float(ALWAYS, "y2[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, " "); analytic_val_y := exact_soln_y1(ind_var); omniout_float(ALWAYS, "y1[1] (analytic) ", 33, analytic_val_y, 20, " "); term_no := 1; numeric_val := array_y1[term_no]; abserr := abs(numeric_val - analytic_val_y); omniout_float(ALWAYS, "y1[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[2] := relerr else array_last_rel_error[2] := 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 > adjust_for_pole := proc(h_param) > global > glob_iolevel, > DEBUGMASSIVE, > glob_max_terms, > INFO, > ALWAYS, > DEBUGL, #Top Generate Globals Decl > glob_max_minutes, > glob_iter, > glob_unchanged_h_cnt, > glob_max_opt_iter, > glob_log10normmin, > glob_normmax, > glob_look_poles, > glob_log10relerr, > glob_start, > glob_max_sec, > glob_small_float, > glob_optimal_clock_start_sec, > glob_dump_analytic, > glob_large_float, > glob_percent_done, > glob_max_rel_trunc_err, > glob_log10_abserr, > days_in_year, > sec_in_min, > glob_log10abserr, > glob_curr_iter_when_opt, > glob_orig_start_sec, > glob_max_trunc_err, > glob_relerr, > glob_last_good_h, > glob_not_yet_start_msg, > djd_debug2, > glob_dump, > glob_html_log, > MAX_UNCHANGED, > glob_warned, > glob_optimal_start, > glob_hmin, > glob_disp_incr, > glob_not_yet_finished, > glob_hmin_init, > glob_optimal_done, > centuries_in_millinium, > hours_in_day, > min_in_hour, > glob_max_iter, > glob_log10_relerr, > glob_reached_optimal_h, > glob_clock_start_sec, > glob_smallish_float, > glob_no_eqs, > glob_max_order, > glob_abserr, > glob_current_iter, > glob_warned2, > glob_almost_1, > years_in_century, > glob_display_flag, > djd_debug, > glob_optimal_expect_sec, > glob_max_hours, > glob_hmax, > glob_h, > glob_initial_pass, > glob_clock_sec, #Bottom Generate Globals Decl #BEGIN CONST > array_const_1, > array_const_0D0, #END CONST > array_x, > array_1st_rel_error, > array_norms, > array_tmp4_g, > array_m1, > array_y2, > array_y1, > array_last_rel_error, > array_y1_init, > array_tmp0, > array_tmp1, > array_tmp2, > array_tmp3, > array_tmp4, > array_type_pole, > array_pole, > array_y2_init, > array_y1_higher_work, > array_y2_higher, > array_y1_higher_work2, > array_poles, > array_y1_higher, > array_y2_higher_work2, > array_y2_higher_work, > array_complex_pole, > array_real_pole, > glob_last; > > local hnew, sz2, tmp; #TOP ADJUST FOR POLE > > hnew := h_param; > glob_normmax := glob_small_float; > if (abs(array_y2_higher[1,1]) > glob_small_float) then > tmp := abs(array_y2_higher[1,1]); > if (tmp < glob_normmax) then > glob_normmax := tmp; > fi; > fi;; > if (abs(array_y1_higher[1,1]) > glob_small_float) then > tmp := abs(array_y1_higher[1,1]); > if (tmp < glob_normmax) then > glob_normmax := tmp; > fi; > fi;; > if (glob_look_poles and (abs(array_pole[1]) > glob_small_float) 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); > fi; > fi;; > 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]; > fi;; > hnew := sz2; > #END block #BOTTOM ADJUST FOR POLE > end; adjust_for_pole := proc(h_param) local hnew, sz2, tmp; global glob_iolevel, DEBUGMASSIVE, glob_max_terms, INFO, ALWAYS, DEBUGL, glob_max_minutes, glob_iter, glob_unchanged_h_cnt, glob_max_opt_iter, glob_log10normmin, glob_normmax, glob_look_poles, glob_log10relerr, glob_start, glob_max_sec, glob_small_float, glob_optimal_clock_start_sec, glob_dump_analytic, glob_large_float, glob_percent_done, glob_max_rel_trunc_err, glob_log10_abserr, days_in_year, sec_in_min, glob_log10abserr, glob_curr_iter_when_opt, glob_orig_start_sec, glob_max_trunc_err, glob_relerr, glob_last_good_h, glob_not_yet_start_msg, djd_debug2, glob_dump, glob_html_log, MAX_UNCHANGED, glob_warned, glob_optimal_start, glob_hmin, glob_disp_incr, glob_not_yet_finished, glob_hmin_init, glob_optimal_done, centuries_in_millinium, hours_in_day, min_in_hour, glob_max_iter, glob_log10_relerr, glob_reached_optimal_h, glob_clock_start_sec, glob_smallish_float, glob_no_eqs, glob_max_order, glob_abserr, glob_current_iter, glob_warned2, glob_almost_1, years_in_century, glob_display_flag, djd_debug, glob_optimal_expect_sec, glob_max_hours, glob_hmax, glob_h, glob_initial_pass, glob_clock_sec, array_const_1, array_const_0D0, array_x, array_1st_rel_error, array_norms, array_tmp4_g, array_m1, array_y2, array_y1, array_last_rel_error, array_y1_init, array_tmp0, array_tmp1, array_tmp2, array_tmp3, array_tmp4, array_type_pole, array_pole, array_y2_init, array_y1_higher_work, array_y2_higher, array_y1_higher_work2, array_poles, array_y1_higher, array_y2_higher_work2, array_y2_higher_work, array_complex_pole, array_real_pole, glob_last; hnew := h_param; glob_normmax := glob_small_float; if glob_small_float < abs(array_y2_higher[1, 1]) then tmp := abs(array_y2_higher[1, 1]); if tmp < glob_normmax then glob_normmax := tmp end if end if; if glob_small_float < abs(array_y1_higher[1, 1]) then tmp := abs(array_y1_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 > prog_report := proc(x_start,x_end) > global > glob_iolevel, > DEBUGMASSIVE, > glob_max_terms, > INFO, > ALWAYS, > DEBUGL, #Top Generate Globals Decl > glob_max_minutes, > glob_iter, > glob_unchanged_h_cnt, > glob_max_opt_iter, > glob_log10normmin, > glob_normmax, > glob_look_poles, > glob_log10relerr, > glob_start, > glob_max_sec, > glob_small_float, > glob_optimal_clock_start_sec, > glob_dump_analytic, > glob_large_float, > glob_percent_done, > glob_max_rel_trunc_err, > glob_log10_abserr, > days_in_year, > sec_in_min, > glob_log10abserr, > glob_curr_iter_when_opt, > glob_orig_start_sec, > glob_max_trunc_err, > glob_relerr, > glob_last_good_h, > glob_not_yet_start_msg, > djd_debug2, > glob_dump, > glob_html_log, > MAX_UNCHANGED, > glob_warned, > glob_optimal_start, > glob_hmin, > glob_disp_incr, > glob_not_yet_finished, > glob_hmin_init, > glob_optimal_done, > centuries_in_millinium, > hours_in_day, > min_in_hour, > glob_max_iter, > glob_log10_relerr, > glob_reached_optimal_h, > glob_clock_start_sec, > glob_smallish_float, > glob_no_eqs, > glob_max_order, > glob_abserr, > glob_current_iter, > glob_warned2, > glob_almost_1, > years_in_century, > glob_display_flag, > djd_debug, > glob_optimal_expect_sec, > glob_max_hours, > glob_hmax, > glob_h, > glob_initial_pass, > glob_clock_sec, #Bottom Generate Globals Decl #BEGIN CONST > array_const_1, > array_const_0D0, #END CONST > array_x, > array_1st_rel_error, > array_norms, > array_tmp4_g, > array_m1, > array_y2, > array_y1, > array_last_rel_error, > array_y1_init, > array_tmp0, > array_tmp1, > array_tmp2, > array_tmp3, > array_tmp4, > array_type_pole, > array_pole, > array_y2_init, > array_y1_higher_work, > array_y2_higher, > array_y1_higher_work2, > array_poles, > array_y1_higher, > array_y2_higher_work2, > array_y2_higher_work, > array_complex_pole, > array_real_pole, > 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 > 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;; > 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; 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_iolevel, DEBUGMASSIVE, glob_max_terms, INFO, ALWAYS, DEBUGL, glob_max_minutes, glob_iter, glob_unchanged_h_cnt, glob_max_opt_iter, glob_log10normmin, glob_normmax, glob_look_poles, glob_log10relerr, glob_start, glob_max_sec, glob_small_float, glob_optimal_clock_start_sec, glob_dump_analytic, glob_large_float, glob_percent_done, glob_max_rel_trunc_err, glob_log10_abserr, days_in_year, sec_in_min, glob_log10abserr, glob_curr_iter_when_opt, glob_orig_start_sec, glob_max_trunc_err, glob_relerr, glob_last_good_h, glob_not_yet_start_msg, djd_debug2, glob_dump, glob_html_log, MAX_UNCHANGED, glob_warned, glob_optimal_start, glob_hmin, glob_disp_incr, glob_not_yet_finished, glob_hmin_init, glob_optimal_done, centuries_in_millinium, hours_in_day, min_in_hour, glob_max_iter, glob_log10_relerr, glob_reached_optimal_h, glob_clock_start_sec, glob_smallish_float, glob_no_eqs, glob_max_order, glob_abserr, glob_current_iter, glob_warned2, glob_almost_1, years_in_century, glob_display_flag, djd_debug, glob_optimal_expect_sec, glob_max_hours, glob_hmax, glob_h, glob_initial_pass, glob_clock_sec, array_const_1, array_const_0D0, array_x, array_1st_rel_error, array_norms, array_tmp4_g, array_m1, array_y2, array_y1, array_last_rel_error, array_y1_init, array_tmp0, array_tmp1, array_tmp2, array_tmp3, array_tmp4, array_type_pole, array_pole, array_y2_init, array_y1_higher_work, array_y2_higher, array_y1_higher_work2, array_poles, array_y1_higher, array_y2_higher_work2, array_y2_higher_work, array_complex_pole, array_real_pole, 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 > check_for_pole := proc() > global > glob_iolevel, > DEBUGMASSIVE, > glob_max_terms, > INFO, > ALWAYS, > DEBUGL, #Top Generate Globals Decl > glob_max_minutes, > glob_iter, > glob_unchanged_h_cnt, > glob_max_opt_iter, > glob_log10normmin, > glob_normmax, > glob_look_poles, > glob_log10relerr, > glob_start, > glob_max_sec, > glob_small_float, > glob_optimal_clock_start_sec, > glob_dump_analytic, > glob_large_float, > glob_percent_done, > glob_max_rel_trunc_err, > glob_log10_abserr, > days_in_year, > sec_in_min, > glob_log10abserr, > glob_curr_iter_when_opt, > glob_orig_start_sec, > glob_max_trunc_err, > glob_relerr, > glob_last_good_h, > glob_not_yet_start_msg, > djd_debug2, > glob_dump, > glob_html_log, > MAX_UNCHANGED, > glob_warned, > glob_optimal_start, > glob_hmin, > glob_disp_incr, > glob_not_yet_finished, > glob_hmin_init, > glob_optimal_done, > centuries_in_millinium, > hours_in_day, > min_in_hour, > glob_max_iter, > glob_log10_relerr, > glob_reached_optimal_h, > glob_clock_start_sec, > glob_smallish_float, > glob_no_eqs, > glob_max_order, > glob_abserr, > glob_current_iter, > glob_warned2, > glob_almost_1, > years_in_century, > glob_display_flag, > djd_debug, > glob_optimal_expect_sec, > glob_max_hours, > glob_hmax, > glob_h, > glob_initial_pass, > glob_clock_sec, #Bottom Generate Globals Decl #BEGIN CONST > array_const_1, > array_const_0D0, #END CONST > array_x, > array_1st_rel_error, > array_norms, > array_tmp4_g, > array_m1, > array_y2, > array_y1, > array_last_rel_error, > array_y1_init, > array_tmp0, > array_tmp1, > array_tmp2, > array_tmp3, > array_tmp4, > array_type_pole, > array_pole, > array_y2_init, > array_y1_higher_work, > array_y2_higher, > array_y1_higher_work2, > array_poles, > array_y1_higher, > array_y2_higher_work2, > array_y2_higher_work, > array_complex_pole, > array_real_pole, > 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_y2_higher[1,m]) < glob_small_float) or (abs(array_y2_higher[1,m-1]) < glob_small_float) or (abs(array_y2_higher[1,m-2]) < glob_small_float ))) do > m := m - 1; > od;; > if (m > 10) then > rm0 := array_y2_higher[1,m]/array_y2_higher[1,m-1]; > rm1 := array_y2_higher[1,m-1]/array_y2_higher[1,m-2]; > hdrc := convfloat(m-1)*rm0-convfloat(m-2)*rm1; > if (abs(hdrc) > glob_small_float) 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; > fi; > else > array_real_pole[1,1] := glob_large_float; > array_real_pole[1,2] := glob_large_float; > fi;; #BOTTOM RADII REAL EQ = 1 #IN RADII REAL EQ = 2 #Computes radius of convergence and r_order of pole from 3 adjacent Taylor series terms. EQUATUON NUMBER 2 #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_y1_higher[1,m]) < glob_small_float) or (abs(array_y1_higher[1,m-1]) < glob_small_float) or (abs(array_y1_higher[1,m-2]) < glob_small_float ))) do > m := m - 1; > od;; > if (m > 10) then > rm0 := array_y1_higher[1,m]/array_y1_higher[1,m-1]; > rm1 := array_y1_higher[1,m-1]/array_y1_higher[1,m-2]; > hdrc := convfloat(m-1)*rm0-convfloat(m-2)*rm1; > if (abs(hdrc) > glob_small_float) then > rcs := glob_h/hdrc; > ord_no := convfloat(m-1)*rm0/hdrc - convfloat(m) + 2.0; > array_real_pole[2,1] := rcs; > array_real_pole[2,2] := ord_no; > else > array_real_pole[2,1] := glob_large_float; > array_real_pole[2,2] := glob_large_float; > fi; > else > array_real_pole[2,1] := glob_large_float; > array_real_pole[2,2] := glob_large_float; > fi;; #BOTTOM RADII REAL EQ = 2 #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 > if (abs(array_y2_higher[1,n]) > glob_small_float) then > cnt := cnt + 1; > else > cnt := 0; > fi;; > n := n - 1; > od;; > m := n + cnt; > if (m <= 10) then > array_complex_pole[1,1] := glob_large_float; > array_complex_pole[1,2] := glob_large_float; > elif (abs(array_y2_higher[1,m]) >= (glob_large_float)) or (abs(array_y2_higher[1,m-1]) >=(glob_large_float)) or (abs(array_y2_higher[1,m-2]) >= (glob_large_float)) or (abs(array_y2_higher[1,m-3]) >= (glob_large_float)) or (abs(array_y2_higher[1,m-4]) >= (glob_large_float)) or (abs(array_y2_higher[1,m-5]) >= (glob_large_float)) then > array_complex_pole[1,1] := glob_large_float; > array_complex_pole[1,2] := glob_large_float; > else > rm0 := (array_y2_higher[1,m])/(array_y2_higher[1,m-1]); > rm1 := (array_y2_higher[1,m-1])/(array_y2_higher[1,m-2]); > rm2 := (array_y2_higher[1,m-2])/(array_y2_higher[1,m-3]); > rm3 := (array_y2_higher[1,m-3])/(array_y2_higher[1,m-4]); > rm4 := (array_y2_higher[1,m-4])/(array_y2_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 > 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 > 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 (rcs > 0.0) then > rad_c := sqrt(rcs) * glob_h; > else > rad_c := glob_large_float; > fi; > else > rad_c := glob_large_float; > ord_no := glob_large_float; > fi; > else > rad_c := glob_large_float; > ord_no := glob_large_float; > fi; > fi;; > array_complex_pole[1,1] := rad_c; > array_complex_pole[1,2] := ord_no; > fi;; #BOTTOM RADII COMPLEX EQ = 1 #TOP RADII COMPLEX EQ = 2 #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 > if (abs(array_y1_higher[1,n]) > glob_small_float) then > cnt := cnt + 1; > else > cnt := 0; > fi;; > n := n - 1; > od;; > m := n + cnt; > if (m <= 10) then > array_complex_pole[2,1] := glob_large_float; > array_complex_pole[2,2] := glob_large_float; > elif (abs(array_y1_higher[1,m]) >= (glob_large_float)) or (abs(array_y1_higher[1,m-1]) >=(glob_large_float)) or (abs(array_y1_higher[1,m-2]) >= (glob_large_float)) or (abs(array_y1_higher[1,m-3]) >= (glob_large_float)) or (abs(array_y1_higher[1,m-4]) >= (glob_large_float)) or (abs(array_y1_higher[1,m-5]) >= (glob_large_float)) then > array_complex_pole[2,1] := glob_large_float; > array_complex_pole[2,2] := glob_large_float; > else > rm0 := (array_y1_higher[1,m])/(array_y1_higher[1,m-1]); > rm1 := (array_y1_higher[1,m-1])/(array_y1_higher[1,m-2]); > rm2 := (array_y1_higher[1,m-2])/(array_y1_higher[1,m-3]); > rm3 := (array_y1_higher[1,m-3])/(array_y1_higher[1,m-4]); > rm4 := (array_y1_higher[1,m-4])/(array_y1_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 > array_complex_pole[2,1] := glob_large_float; > array_complex_pole[2,2] := glob_large_float; > else > if (abs(nr1*dr2 - nr2 * dr1) > glob_small_float) then > 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 (rcs > 0.0) then > rad_c := sqrt(rcs) * glob_h; > else > rad_c := glob_large_float; > fi; > else > rad_c := glob_large_float; > ord_no := glob_large_float; > fi; > else > rad_c := glob_large_float; > ord_no := glob_large_float; > fi; > fi;; > array_complex_pole[2,1] := rad_c; > array_complex_pole[2,2] := ord_no; > fi;; #BOTTOM RADII COMPLEX EQ = 2 > 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 > 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"); > fi;; > fi;; > 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 > 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"); > fi;; > fi;; > 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"); > fi;; > fi;; > 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 > 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"); > fi;; > fi;; > 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 > 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"); > fi;; > fi;; > 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"); > fi;; > fi;; #BOTTOM WHICH RADII EQ = 1 > found := false; #TOP WHICH RADII EQ = 2 > if not found and ((array_real_pole[2,1] = glob_large_float) or (array_real_pole[2,2] = glob_large_float)) and ((array_complex_pole[2,1] <> glob_large_float) and (array_complex_pole[2,2] <> glob_large_float)) and ((array_complex_pole[2,1] > 0.0) and (array_complex_pole[2,2] > 0.0)) then > array_poles[2,1] := array_complex_pole[2,1]; > array_poles[2,2] := array_complex_pole[2,2]; > found := true; > array_type_pole[2] := 2; > if (glob_display_flag) then > omniout_str(ALWAYS,"Complex estimate of poles used"); > fi;; > fi;; > if not found and ((array_real_pole[2,1] <> glob_large_float) and (array_real_pole[2,2] <> glob_large_float) and (array_real_pole[2,1] > 0.0) and (array_real_pole[2,2] > 0.0) and ((array_complex_pole[2,1] = glob_large_float) or (array_complex_pole[2,2] = glob_large_float) or (array_complex_pole[2,1] <= 0.0 ) or (array_complex_pole[2,2] <= 0.0))) then > array_poles[2,1] := array_real_pole[2,1]; > array_poles[2,2] := array_real_pole[2,2]; > found := true; > array_type_pole[2] := 1; > if (glob_display_flag) then > omniout_str(ALWAYS,"Real estimate of pole used"); > fi;; > fi;; > if not found and (((array_real_pole[2,1] = glob_large_float) or (array_real_pole[2,2] = glob_large_float)) and ((array_complex_pole[2,1] = glob_large_float) or (array_complex_pole[2,2] = glob_large_float))) then > array_poles[2,1] := glob_large_float; > array_poles[2,2] := glob_large_float; > found := true; > array_type_pole[2] := 3; > if (glob_display_flag) then > omniout_str(ALWAYS,"NO POLE"); > fi;; > fi;; > if not found and ((array_real_pole[2,1] < array_complex_pole[2,1]) and (array_real_pole[2,1] > 0.0) and (array_real_pole[2,2] > 0.0)) then > array_poles[2,1] := array_real_pole[2,1]; > array_poles[2,2] := array_real_pole[2,2]; > found := true; > array_type_pole[2] := 1; > if (glob_display_flag) then > omniout_str(ALWAYS,"Real estimate of pole used"); > fi;; > fi;; > if not found and ((array_complex_pole[2,1] <> glob_large_float) and (array_complex_pole[2,2] <> glob_large_float) and (array_complex_pole[2,1] > 0.0) and (array_complex_pole[2,2] > 0.0)) then > array_poles[2,1] := array_complex_pole[2,1]; > array_poles[2,2] := array_complex_pole[2,2]; > array_type_pole[2] := 2; > found := true; > if (glob_display_flag) then > omniout_str(ALWAYS,"Complex estimate of poles used"); > fi;; > fi;; > if not found then > array_poles[2,1] := glob_large_float; > array_poles[2,2] := glob_large_float; > array_type_pole[2] := 3; > if (glob_display_flag) then > omniout_str(ALWAYS,"NO POLE"); > fi;; > fi;; #BOTTOM WHICH RADII EQ = 2 > 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 > array_pole[1] := array_poles[1,1]; > array_pole[2] := array_poles[1,2]; > fi;; #BOTTOM WHICH RADIUS EQ = 1 #TOP WHICH RADIUS EQ = 2 > if array_pole[1] > array_poles[2,1] then > array_pole[1] := array_poles[2,1]; > array_pole[2] := array_poles[2,2]; > fi;; #BOTTOM WHICH RADIUS EQ = 2 #BOTTOM CHECK FOR POLE > display_pole(); > 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_iolevel, DEBUGMASSIVE, glob_max_terms, INFO, ALWAYS, DEBUGL, glob_max_minutes, glob_iter, glob_unchanged_h_cnt, glob_max_opt_iter, glob_log10normmin, glob_normmax, glob_look_poles, glob_log10relerr, glob_start, glob_max_sec, glob_small_float, glob_optimal_clock_start_sec, glob_dump_analytic, glob_large_float, glob_percent_done, glob_max_rel_trunc_err, glob_log10_abserr, days_in_year, sec_in_min, glob_log10abserr, glob_curr_iter_when_opt, glob_orig_start_sec, glob_max_trunc_err, glob_relerr, glob_last_good_h, glob_not_yet_start_msg, djd_debug2, glob_dump, glob_html_log, MAX_UNCHANGED, glob_warned, glob_optimal_start, glob_hmin, glob_disp_incr, glob_not_yet_finished, glob_hmin_init, glob_optimal_done, centuries_in_millinium, hours_in_day, min_in_hour, glob_max_iter, glob_log10_relerr, glob_reached_optimal_h, glob_clock_start_sec, glob_smallish_float, glob_no_eqs, glob_max_order, glob_abserr, glob_current_iter, glob_warned2, glob_almost_1, years_in_century, glob_display_flag, djd_debug, glob_optimal_expect_sec, glob_max_hours, glob_hmax, glob_h, glob_initial_pass, glob_clock_sec, array_const_1, array_const_0D0, array_x, array_1st_rel_error, array_norms, array_tmp4_g, array_m1, array_y2, array_y1, array_last_rel_error, array_y1_init, array_tmp0, array_tmp1, array_tmp2, array_tmp3, array_tmp4, array_type_pole, array_pole, array_y2_init, array_y1_higher_work, array_y2_higher, array_y1_higher_work2, array_poles, array_y1_higher, array_y2_higher_work2, array_y2_higher_work, array_complex_pole, array_real_pole, glob_last; n := glob_max_terms; m := n - 2; while 10 <= m and (abs(array_y2_higher[1, m]) < glob_small_float or abs(array_y2_higher[1, m - 1]) < glob_small_float or abs(array_y2_higher[1, m - 2]) < glob_small_float) do m := m - 1 end do; if 10 < m then rm0 := array_y2_higher[1, m]/array_y2_higher[1, m - 1]; rm1 := array_y2_higher[1, m - 1]/array_y2_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; m := n - 2; while 10 <= m and (abs(array_y1_higher[1, m]) < glob_small_float or abs(array_y1_higher[1, m - 1]) < glob_small_float or abs(array_y1_higher[1, m - 2]) < glob_small_float) do m := m - 1 end do; if 10 < m then rm0 := array_y1_higher[1, m]/array_y1_higher[1, m - 1]; rm1 := array_y1_higher[1, m - 1]/array_y1_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[2, 1] := rcs; array_real_pole[2, 2] := ord_no else array_real_pole[2, 1] := glob_large_float; array_real_pole[2, 2] := glob_large_float end if else array_real_pole[2, 1] := glob_large_float; array_real_pole[2, 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_y2_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_y2_higher[1, m]) or glob_large_float <= abs(array_y2_higher[1, m - 1]) or glob_large_float <= abs(array_y2_higher[1, m - 2]) or glob_large_float <= abs(array_y2_higher[1, m - 3]) or glob_large_float <= abs(array_y2_higher[1, m - 4]) or glob_large_float <= abs(array_y2_higher[1, m - 5]) then array_complex_pole[1, 1] := glob_large_float; array_complex_pole[1, 2] := glob_large_float else rm0 := array_y2_higher[1, m]/array_y2_higher[1, m - 1]; rm1 := array_y2_higher[1, m - 1]/array_y2_higher[1, m - 2]; rm2 := array_y2_higher[1, m - 2]/array_y2_higher[1, m - 3]; rm3 := array_y2_higher[1, m - 3]/array_y2_higher[1, m - 4]; rm4 := array_y2_higher[1, m - 4]/array_y2_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; n := glob_max_terms - 2; cnt := 0; while cnt < 5 and 10 <= n do if glob_small_float < abs(array_y1_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[2, 1] := glob_large_float; array_complex_pole[2, 2] := glob_large_float elif glob_large_float <= abs(array_y1_higher[1, m]) or glob_large_float <= abs(array_y1_higher[1, m - 1]) or glob_large_float <= abs(array_y1_higher[1, m - 2]) or glob_large_float <= abs(array_y1_higher[1, m - 3]) or glob_large_float <= abs(array_y1_higher[1, m - 4]) or glob_large_float <= abs(array_y1_higher[1, m - 5]) then array_complex_pole[2, 1] := glob_large_float; array_complex_pole[2, 2] := glob_large_float else rm0 := array_y1_higher[1, m]/array_y1_higher[1, m - 1]; rm1 := array_y1_higher[1, m - 1]/array_y1_higher[1, m - 2]; rm2 := array_y1_higher[1, m - 2]/array_y1_higher[1, m - 3]; rm3 := array_y1_higher[1, m - 3]/array_y1_higher[1, m - 4]; rm4 := array_y1_higher[1, m - 4]/array_y1_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[2, 1] := glob_large_float; array_complex_pole[2, 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[2, 1] := rad_c; array_complex_pole[2, 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; found := false; if not found and (array_real_pole[2, 1] = glob_large_float or array_real_pole[2, 2] = glob_large_float) and array_complex_pole[2, 1] <> glob_large_float and array_complex_pole[2, 2] <> glob_large_float and 0. < array_complex_pole[2, 1] and 0. < array_complex_pole[2, 2] then array_poles[2, 1] := array_complex_pole[2, 1]; array_poles[2, 2] := array_complex_pole[2, 2]; found := true; array_type_pole[2] := 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[2, 1] <> glob_large_float and array_real_pole[2, 2] <> glob_large_float and 0. < array_real_pole[2, 1] and 0. < array_real_pole[2, 2] and ( array_complex_pole[2, 1] = glob_large_float or array_complex_pole[2, 2] = glob_large_float or array_complex_pole[2, 1] <= 0. or array_complex_pole[2, 2] <= 0.) then array_poles[2, 1] := array_real_pole[2, 1]; array_poles[2, 2] := array_real_pole[2, 2]; found := true; array_type_pole[2] := 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[2, 1] = glob_large_float or array_real_pole[2, 2] = glob_large_float) and ( array_complex_pole[2, 1] = glob_large_float or array_complex_pole[2, 2] = glob_large_float) then array_poles[2, 1] := glob_large_float; array_poles[2, 2] := glob_large_float; found := true; array_type_pole[2] := 3; if glob_display_flag then omniout_str(ALWAYS, "NO POLE") end if end if; if not found and array_real_pole[2, 1] < array_complex_pole[2, 1] and 0. < array_real_pole[2, 1] and 0. < array_real_pole[2, 2] then array_poles[2, 1] := array_real_pole[2, 1]; array_poles[2, 2] := array_real_pole[2, 2]; found := true; array_type_pole[2] := 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[2, 1] <> glob_large_float and array_complex_pole[2, 2] <> glob_large_float and 0. < array_complex_pole[2, 1] and 0. < array_complex_pole[2, 2] then array_poles[2, 1] := array_complex_pole[2, 1]; array_poles[2, 2] := array_complex_pole[2, 2]; array_type_pole[2] := 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[2, 1] := glob_large_float; array_poles[2, 2] := glob_large_float; array_type_pole[2] := 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; if array_poles[2, 1] < array_pole[1] then array_pole[1] := array_poles[2, 1]; array_pole[2] := array_poles[2, 2] end if; display_pole() end proc > get_norms := proc() > global > glob_iolevel, > DEBUGMASSIVE, > glob_max_terms, > INFO, > ALWAYS, > DEBUGL, #Top Generate Globals Decl > glob_max_minutes, > glob_iter, > glob_unchanged_h_cnt, > glob_max_opt_iter, > glob_log10normmin, > glob_normmax, > glob_look_poles, > glob_log10relerr, > glob_start, > glob_max_sec, > glob_small_float, > glob_optimal_clock_start_sec, > glob_dump_analytic, > glob_large_float, > glob_percent_done, > glob_max_rel_trunc_err, > glob_log10_abserr, > days_in_year, > sec_in_min, > glob_log10abserr, > glob_curr_iter_when_opt, > glob_orig_start_sec, > glob_max_trunc_err, > glob_relerr, > glob_last_good_h, > glob_not_yet_start_msg, > djd_debug2, > glob_dump, > glob_html_log, > MAX_UNCHANGED, > glob_warned, > glob_optimal_start, > glob_hmin, > glob_disp_incr, > glob_not_yet_finished, > glob_hmin_init, > glob_optimal_done, > centuries_in_millinium, > hours_in_day, > min_in_hour, > glob_max_iter, > glob_log10_relerr, > glob_reached_optimal_h, > glob_clock_start_sec, > glob_smallish_float, > glob_no_eqs, > glob_max_order, > glob_abserr, > glob_current_iter, > glob_warned2, > glob_almost_1, > years_in_century, > glob_display_flag, > djd_debug, > glob_optimal_expect_sec, > glob_max_hours, > glob_hmax, > glob_h, > glob_initial_pass, > glob_clock_sec, #Bottom Generate Globals Decl #BEGIN CONST > array_const_1, > array_const_0D0, #END CONST > array_x, > array_1st_rel_error, > array_norms, > array_tmp4_g, > array_m1, > array_y2, > array_y1, > array_last_rel_error, > array_y1_init, > array_tmp0, > array_tmp1, > array_tmp2, > array_tmp3, > array_tmp4, > array_type_pole, > array_pole, > array_y2_init, > array_y1_higher_work, > array_y2_higher, > array_y1_higher_work2, > array_poles, > array_y1_higher, > array_y2_higher_work2, > array_y2_higher_work, > array_complex_pole, > array_real_pole, > glob_last; > > local iii; > if (not glob_initial_pass) then > set_z(array_norms,glob_max_terms+1); #TOP GET NORMS > iii := 1; > while (iii <= glob_max_terms) do > if (abs(array_y2[iii]) > array_norms[iii]) then > array_norms[iii] := abs(array_y2[iii]); > fi;; > iii := iii + 1; > od; > ; > iii := 1; > while (iii <= glob_max_terms) do > if (abs(array_y1[iii]) > array_norms[iii]) then > array_norms[iii] := abs(array_y1[iii]); > fi;; > iii := iii + 1; > od; #GET NORMS > ; > fi;; > end; get_norms := proc() local iii; global glob_iolevel, DEBUGMASSIVE, glob_max_terms, INFO, ALWAYS, DEBUGL, glob_max_minutes, glob_iter, glob_unchanged_h_cnt, glob_max_opt_iter, glob_log10normmin, glob_normmax, glob_look_poles, glob_log10relerr, glob_start, glob_max_sec, glob_small_float, glob_optimal_clock_start_sec, glob_dump_analytic, glob_large_float, glob_percent_done, glob_max_rel_trunc_err, glob_log10_abserr, days_in_year, sec_in_min, glob_log10abserr, glob_curr_iter_when_opt, glob_orig_start_sec, glob_max_trunc_err, glob_relerr, glob_last_good_h, glob_not_yet_start_msg, djd_debug2, glob_dump, glob_html_log, MAX_UNCHANGED, glob_warned, glob_optimal_start, glob_hmin, glob_disp_incr, glob_not_yet_finished, glob_hmin_init, glob_optimal_done, centuries_in_millinium, hours_in_day, min_in_hour, glob_max_iter, glob_log10_relerr, glob_reached_optimal_h, glob_clock_start_sec, glob_smallish_float, glob_no_eqs, glob_max_order, glob_abserr, glob_current_iter, glob_warned2, glob_almost_1, years_in_century, glob_display_flag, djd_debug, glob_optimal_expect_sec, glob_max_hours, glob_hmax, glob_h, glob_initial_pass, glob_clock_sec, array_const_1, array_const_0D0, array_x, array_1st_rel_error, array_norms, array_tmp4_g, array_m1, array_y2, array_y1, array_last_rel_error, array_y1_init, array_tmp0, array_tmp1, array_tmp2, array_tmp3, array_tmp4, array_type_pole, array_pole, array_y2_init, array_y1_higher_work, array_y2_higher, array_y1_higher_work2, array_poles, array_y1_higher, array_y2_higher_work2, array_y2_higher_work, array_complex_pole, array_real_pole, 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_y2[iii]) then array_norms[iii] := abs(array_y2[iii]) end if; iii := iii + 1 end do; iii := 1; while iii <= glob_max_terms do if array_norms[iii] < abs(array_y1[iii]) then array_norms[iii] := abs(array_y1[iii]) end if; iii := iii + 1 end do end if end proc > atomall := proc() > global > glob_iolevel, > DEBUGMASSIVE, > glob_max_terms, > INFO, > ALWAYS, > DEBUGL, #Top Generate Globals Decl > glob_max_minutes, > glob_iter, > glob_unchanged_h_cnt, > glob_max_opt_iter, > glob_log10normmin, > glob_normmax, > glob_look_poles, > glob_log10relerr, > glob_start, > glob_max_sec, > glob_small_float, > glob_optimal_clock_start_sec, > glob_dump_analytic, > glob_large_float, > glob_percent_done, > glob_max_rel_trunc_err, > glob_log10_abserr, > days_in_year, > sec_in_min, > glob_log10abserr, > glob_curr_iter_when_opt, > glob_orig_start_sec, > glob_max_trunc_err, > glob_relerr, > glob_last_good_h, > glob_not_yet_start_msg, > djd_debug2, > glob_dump, > glob_html_log, > MAX_UNCHANGED, > glob_warned, > glob_optimal_start, > glob_hmin, > glob_disp_incr, > glob_not_yet_finished, > glob_hmin_init, > glob_optimal_done, > centuries_in_millinium, > hours_in_day, > min_in_hour, > glob_max_iter, > glob_log10_relerr, > glob_reached_optimal_h, > glob_clock_start_sec, > glob_smallish_float, > glob_no_eqs, > glob_max_order, > glob_abserr, > glob_current_iter, > glob_warned2, > glob_almost_1, > years_in_century, > glob_display_flag, > djd_debug, > glob_optimal_expect_sec, > glob_max_hours, > glob_hmax, > glob_h, > glob_initial_pass, > glob_clock_sec, #Bottom Generate Globals Decl #BEGIN CONST > array_const_1, > array_const_0D0, #END CONST > array_x, > array_1st_rel_error, > array_norms, > array_tmp4_g, > array_m1, > array_y2, > array_y1, > array_last_rel_error, > array_y1_init, > array_tmp0, > array_tmp1, > array_tmp2, > array_tmp3, > array_tmp4, > array_type_pole, > array_pole, > array_y2_init, > array_y1_higher_work, > array_y2_higher, > array_y1_higher_work2, > array_poles, > array_y1_higher, > array_y2_higher_work2, > array_y2_higher_work, > array_complex_pole, > array_real_pole, > glob_last; > > local kkk, order_d, adj2, temporary, term; #TOP ATOMALL #END OUTFILE1 #BEGIN ATOMHDR1 #emit pre diff $eq_no = 1 i = 1 > array_tmp1[1] := array_y1_higher[2,1]; #emit pre add $eq_no = 1 i = 1 > array_tmp2[1] := array_const_0D0[1] + array_tmp1[1]; #emit pre assign xxx $eq_no = 1 i = 1 $min_hdrs = 5 > if (1 <= glob_max_terms) then > temporary := array_tmp2[1] * (glob_h ^ (1)) * factorial_3(0,1); > array_y2[2] := temporary; > array_y2_higher[1,2] := temporary; > temporary := temporary / glob_h * (2.0); > array_y2_higher[2,1] := temporary > ; > fi;; > kkk := 2; #emit pre sin $eq_no = 2 iii = 1 #emit pre sin 1 $eq_no = 2 > array_tmp4[1] := sin(array_x[1]); > array_tmp4_g[1] := cos(array_x[1]); #emit pre assign xxx $eq_no = 2 i = 1 $min_hdrs = 5 > if (1 <= glob_max_terms) then > temporary := array_tmp4[1] * (glob_h ^ (1)) * factorial_3(0,1); > array_y1[2] := temporary; > array_y1_higher[1,2] := temporary; > temporary := temporary / glob_h * (2.0); > array_y1_higher[2,1] := temporary > ; > fi;; > kkk := 2; #END ATOMHDR1 #BEGIN ATOMHDR2 #emit pre diff $eq_no = 1 i = 2 > array_tmp1[2] := array_y1_higher[2,2]; #emit pre add $eq_no = 1 i = 2 > array_tmp2[2] := array_const_0D0[2] + array_tmp1[2]; #emit pre assign xxx $eq_no = 1 i = 2 $min_hdrs = 5 > if (2 <= glob_max_terms) then > temporary := array_tmp2[2] * (glob_h ^ (1)) * factorial_3(1,2); > array_y2[3] := temporary; > array_y2_higher[1,3] := temporary; > temporary := temporary / glob_h * (2.0); > array_y2_higher[2,2] := temporary > ; > fi;; > kkk := 3; #emit pre sin $eq_no = 2 iii = 2 #emit pre sin 2 $eq_no = 2 > array_tmp4[2] := att(1,array_tmp4_g,array_x,1); > array_tmp4_g[2] := -att(1,array_tmp4,array_x,1); #emit pre assign xxx $eq_no = 2 i = 2 $min_hdrs = 5 > if (2 <= glob_max_terms) then > temporary := array_tmp4[2] * (glob_h ^ (1)) * factorial_3(1,2); > array_y1[3] := temporary; > array_y1_higher[1,3] := temporary; > temporary := temporary / glob_h * (2.0); > array_y1_higher[2,2] := temporary > ; > fi;; > kkk := 3; #END ATOMHDR2 #BEGIN ATOMHDR3 #emit pre diff $eq_no = 1 i = 3 > array_tmp1[3] := array_y1_higher[2,3]; #emit pre add $eq_no = 1 i = 3 > array_tmp2[3] := array_const_0D0[3] + array_tmp1[3]; #emit pre assign xxx $eq_no = 1 i = 3 $min_hdrs = 5 > if (3 <= glob_max_terms) then > temporary := array_tmp2[3] * (glob_h ^ (1)) * factorial_3(2,3); > array_y2[4] := temporary; > array_y2_higher[1,4] := temporary; > temporary := temporary / glob_h * (2.0); > array_y2_higher[2,3] := temporary > ; > fi;; > kkk := 4; #emit pre sin $eq_no = 2 iii = 3 #emit pre sin 3 $eq_no = 2 > array_tmp4[3] := att(2,array_tmp4_g,array_x,1); > array_tmp4_g[3] := -att(2,array_tmp4,array_x,1); #emit pre assign xxx $eq_no = 2 i = 3 $min_hdrs = 5 > if (3 <= glob_max_terms) then > temporary := array_tmp4[3] * (glob_h ^ (1)) * factorial_3(2,3); > array_y1[4] := temporary; > array_y1_higher[1,4] := temporary; > temporary := temporary / glob_h * (2.0); > array_y1_higher[2,3] := temporary > ; > fi;; > kkk := 4; #END ATOMHDR3 #BEGIN ATOMHDR4 #emit pre diff $eq_no = 1 i = 4 > array_tmp1[4] := array_y1_higher[2,4]; #emit pre add $eq_no = 1 i = 4 > array_tmp2[4] := array_const_0D0[4] + array_tmp1[4]; #emit pre assign xxx $eq_no = 1 i = 4 $min_hdrs = 5 > if (4 <= glob_max_terms) then > temporary := array_tmp2[4] * (glob_h ^ (1)) * factorial_3(3,4); > array_y2[5] := temporary; > array_y2_higher[1,5] := temporary; > temporary := temporary / glob_h * (2.0); > array_y2_higher[2,4] := temporary > ; > fi;; > kkk := 5; #emit pre sin $eq_no = 2 iii = 4 #emit pre sin 4 $eq_no = 2 > array_tmp4[4] := att(3,array_tmp4_g,array_x,1); > array_tmp4_g[4] := -att(3,array_tmp4,array_x,1); #emit pre assign xxx $eq_no = 2 i = 4 $min_hdrs = 5 > if (4 <= glob_max_terms) then > temporary := array_tmp4[4] * (glob_h ^ (1)) * factorial_3(3,4); > array_y1[5] := temporary; > array_y1_higher[1,5] := temporary; > temporary := temporary / glob_h * (2.0); > array_y1_higher[2,4] := temporary > ; > fi;; > kkk := 5; #END ATOMHDR4 #BEGIN ATOMHDR5 #emit pre diff $eq_no = 1 i = 5 > array_tmp1[5] := array_y1_higher[2,5]; #emit pre add $eq_no = 1 i = 5 > array_tmp2[5] := array_const_0D0[5] + array_tmp1[5]; #emit pre assign xxx $eq_no = 1 i = 5 $min_hdrs = 5 > if (5 <= glob_max_terms) then > temporary := array_tmp2[5] * (glob_h ^ (1)) * factorial_3(4,5); > array_y2[6] := temporary; > array_y2_higher[1,6] := temporary; > temporary := temporary / glob_h * (2.0); > array_y2_higher[2,5] := temporary > ; > fi;; > kkk := 6; #emit pre sin $eq_no = 2 iii = 5 #emit pre sin 5 $eq_no = 2 > array_tmp4[5] := att(4,array_tmp4_g,array_x,1); > array_tmp4_g[5] := -att(4,array_tmp4,array_x,1); #emit pre assign xxx $eq_no = 2 i = 5 $min_hdrs = 5 > if (5 <= glob_max_terms) then > temporary := array_tmp4[5] * (glob_h ^ (1)) * factorial_3(4,5); > array_y1[6] := temporary; > array_y1_higher[1,6] := temporary; > temporary := temporary / glob_h * (2.0); > array_y1_higher[2,5] := temporary > ; > fi;; > kkk := 6; #END ATOMHDR5 #BEGIN OUTFILE3 #Top Atomall While Loop-- outfile3 > while (kkk <= glob_max_terms) do #END OUTFILE3 #BEGIN OUTFILE4 #emit diff $eq_no = 1 > array_tmp1[kkk] := array_y1_higher[2,kkk]; #emit add $eq_no = 1 > array_tmp2[kkk] := array_const_0D0[kkk] + array_tmp1[kkk]; #emit assign $eq_no = 1 > order_d := 1; > if (kkk + order_d + 1 <= glob_max_terms) then > temporary := array_tmp2[kkk] * (glob_h ^ (order_d)) / factorial_3((kkk - 1),(kkk + order_d - 1)); > array_y2[kkk + order_d] := temporary; > array_y2_higher[1,kkk + order_d] := temporary; > term := kkk + order_d - 1; > adj2 := 2; > while (adj2 <= order_d + 1) and (term >= 1) do > temporary := temporary / glob_h * convfp(adj2); > array_y2_higher[adj2,term] := temporary; > adj2 := adj2 + 1; > term := term - 1; > od; > fi;; #emit sin $eq_no = 2 > array_tmp4[kkk] := att(kkk-1,array_tmp4_g,array_x,1); > array_tmp4_g[kkk] := -att(kkk-1,array_tmp4,array_x,1); #emit assign $eq_no = 2 > order_d := 1; > if (kkk + order_d + 1 <= glob_max_terms) then > temporary := array_tmp4[kkk] * (glob_h ^ (order_d)) / factorial_3((kkk - 1),(kkk + order_d - 1)); > array_y1[kkk + order_d] := temporary; > array_y1_higher[1,kkk + order_d] := temporary; > term := kkk + order_d - 1; > adj2 := 2; > while (adj2 <= order_d + 1) and (term >= 1) do > temporary := temporary / glob_h * convfp(adj2); > array_y1_higher[adj2,term] := temporary; > adj2 := adj2 + 1; > term := term - 1; > od; > fi;; > kkk := kkk + 1; > od;; #BOTTOM ATOMALL #END OUTFILE4 #BEGIN OUTFILE5 > end; atomall := proc() local kkk, order_d, adj2, temporary, term; global glob_iolevel, DEBUGMASSIVE, glob_max_terms, INFO, ALWAYS, DEBUGL, glob_max_minutes, glob_iter, glob_unchanged_h_cnt, glob_max_opt_iter, glob_log10normmin, glob_normmax, glob_look_poles, glob_log10relerr, glob_start, glob_max_sec, glob_small_float, glob_optimal_clock_start_sec, glob_dump_analytic, glob_large_float, glob_percent_done, glob_max_rel_trunc_err, glob_log10_abserr, days_in_year, sec_in_min, glob_log10abserr, glob_curr_iter_when_opt, glob_orig_start_sec, glob_max_trunc_err, glob_relerr, glob_last_good_h, glob_not_yet_start_msg, djd_debug2, glob_dump, glob_html_log, MAX_UNCHANGED, glob_warned, glob_optimal_start, glob_hmin, glob_disp_incr, glob_not_yet_finished, glob_hmin_init, glob_optimal_done, centuries_in_millinium, hours_in_day, min_in_hour, glob_max_iter, glob_log10_relerr, glob_reached_optimal_h, glob_clock_start_sec, glob_smallish_float, glob_no_eqs, glob_max_order, glob_abserr, glob_current_iter, glob_warned2, glob_almost_1, years_in_century, glob_display_flag, djd_debug, glob_optimal_expect_sec, glob_max_hours, glob_hmax, glob_h, glob_initial_pass, glob_clock_sec, array_const_1, array_const_0D0, array_x, array_1st_rel_error, array_norms, array_tmp4_g, array_m1, array_y2, array_y1, array_last_rel_error, array_y1_init, array_tmp0, array_tmp1, array_tmp2, array_tmp3, array_tmp4, array_type_pole, array_pole, array_y2_init, array_y1_higher_work, array_y2_higher, array_y1_higher_work2, array_poles, array_y1_higher, array_y2_higher_work2, array_y2_higher_work, array_complex_pole, array_real_pole, glob_last; array_tmp1[1] := array_y1_higher[2, 1]; array_tmp2[1] := array_const_0D0[1] + array_tmp1[1]; if 1 <= glob_max_terms then temporary := array_tmp2[1]*glob_h*factorial_3(0, 1); array_y2[2] := temporary; array_y2_higher[1, 2] := temporary; temporary := temporary*2.0/glob_h; array_y2_higher[2, 1] := temporary end if; kkk := 2; array_tmp4[1] := sin(array_x[1]); array_tmp4_g[1] := cos(array_x[1]); if 1 <= glob_max_terms then temporary := array_tmp4[1]*glob_h*factorial_3(0, 1); array_y1[2] := temporary; array_y1_higher[1, 2] := temporary; temporary := temporary*2.0/glob_h; array_y1_higher[2, 1] := temporary end if; kkk := 2; array_tmp1[2] := array_y1_higher[2, 2]; array_tmp2[2] := array_const_0D0[2] + array_tmp1[2]; if 2 <= glob_max_terms then temporary := array_tmp2[2]*glob_h*factorial_3(1, 2); array_y2[3] := temporary; array_y2_higher[1, 3] := temporary; temporary := temporary*2.0/glob_h; array_y2_higher[2, 2] := temporary end if; kkk := 3; array_tmp4[2] := att(1, array_tmp4_g, array_x, 1); array_tmp4_g[2] := -att(1, array_tmp4, array_x, 1); if 2 <= glob_max_terms then temporary := array_tmp4[2]*glob_h*factorial_3(1, 2); array_y1[3] := temporary; array_y1_higher[1, 3] := temporary; temporary := temporary*2.0/glob_h; array_y1_higher[2, 2] := temporary end if; kkk := 3; array_tmp1[3] := array_y1_higher[2, 3]; array_tmp2[3] := array_const_0D0[3] + array_tmp1[3]; if 3 <= glob_max_terms then temporary := array_tmp2[3]*glob_h*factorial_3(2, 3); array_y2[4] := temporary; array_y2_higher[1, 4] := temporary; temporary := temporary*2.0/glob_h; array_y2_higher[2, 3] := temporary end if; kkk := 4; array_tmp4[3] := att(2, array_tmp4_g, array_x, 1); array_tmp4_g[3] := -att(2, array_tmp4, array_x, 1); if 3 <= glob_max_terms then temporary := array_tmp4[3]*glob_h*factorial_3(2, 3); array_y1[4] := temporary; array_y1_higher[1, 4] := temporary; temporary := temporary*2.0/glob_h; array_y1_higher[2, 3] := temporary end if; kkk := 4; array_tmp1[4] := array_y1_higher[2, 4]; array_tmp2[4] := array_const_0D0[4] + array_tmp1[4]; if 4 <= glob_max_terms then temporary := array_tmp2[4]*glob_h*factorial_3(3, 4); array_y2[5] := temporary; array_y2_higher[1, 5] := temporary; temporary := temporary*2.0/glob_h; array_y2_higher[2, 4] := temporary end if; kkk := 5; array_tmp4[4] := att(3, array_tmp4_g, array_x, 1); array_tmp4_g[4] := -att(3, array_tmp4, array_x, 1); if 4 <= glob_max_terms then temporary := array_tmp4[4]*glob_h*factorial_3(3, 4); array_y1[5] := temporary; array_y1_higher[1, 5] := temporary; temporary := temporary*2.0/glob_h; array_y1_higher[2, 4] := temporary end if; kkk := 5; array_tmp1[5] := array_y1_higher[2, 5]; array_tmp2[5] := array_const_0D0[5] + array_tmp1[5]; if 5 <= glob_max_terms then temporary := array_tmp2[5]*glob_h*factorial_3(4, 5); array_y2[6] := temporary; array_y2_higher[1, 6] := temporary; temporary := temporary*2.0/glob_h; array_y2_higher[2, 5] := temporary end if; kkk := 6; array_tmp4[5] := att(4, array_tmp4_g, array_x, 1); array_tmp4_g[5] := -att(4, array_tmp4, array_x, 1); if 5 <= glob_max_terms then temporary := array_tmp4[5]*glob_h*factorial_3(4, 5); array_y1[6] := temporary; array_y1_higher[1, 6] := temporary; temporary := temporary*2.0/glob_h; array_y1_higher[2, 5] := temporary end if; kkk := 6; while kkk <= glob_max_terms do array_tmp1[kkk] := array_y1_higher[2, kkk]; array_tmp2[kkk] := array_const_0D0[kkk] + array_tmp1[kkk]; order_d := 1; if kkk + order_d + 1 <= glob_max_terms then temporary := array_tmp2[kkk]*glob_h^order_d/ factorial_3(kkk - 1, kkk + order_d - 1); array_y2[kkk + order_d] := temporary; array_y2_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_y2_higher[adj2, term] := temporary; adj2 := adj2 + 1; term := term - 1 end do end if; array_tmp4[kkk] := att(kkk - 1, array_tmp4_g, array_x, 1); array_tmp4_g[kkk] := -att(kkk - 1, array_tmp4, array_x, 1); order_d := 1; if kkk + order_d + 1 <= glob_max_terms then temporary := array_tmp4[kkk]*glob_h^order_d/ factorial_3(kkk - 1, kkk + order_d - 1); array_y1[kkk + order_d] := temporary; array_y1_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_y1_higher[adj2, term] := temporary; adj2 := adj2 + 1; term := term - 1 end do 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; 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; 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; 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; 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; 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; 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; 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; 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; 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 > 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 > 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 > 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 > 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 > 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 > fprintf(fd,"%d Days %d Hours %d Minutes %d Seconds",days_int,hours_int,minutes_int,sec_int); > elif (hours_int > 0) then > fprintf(fd,"%d Hours %d Minutes %d Seconds",hours_int,minutes_int,sec_int); > elif (minutes_int > 0) then > fprintf(fd,"%d Minutes %d Seconds",minutes_int,sec_int); > else > fprintf(fd,"%d Seconds",sec_int); > fi; > else > fprintf(fd,"Unknown"); > fi; > fprintf(fd,""); > 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 > 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 > 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 > 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 > 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 > printf(" = %d Days %d Hours %d Minutes %d Seconds\n",days_int,hours_int,minutes_int,sec_int); > elif (hours_int > 0) then > printf(" = %d Hours %d Minutes %d Seconds\n",hours_int,minutes_int,sec_int); > elif (minutes_int > 0) then > printf(" = %d Minutes %d Seconds\n",minutes_int,sec_int); > else > printf(" = %d Seconds\n",sec_int); > fi; > else > printf(" Unknown\n"); > fi; > 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 > > 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 > 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; > od; > fi;; > ret_ats > 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 > > 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 > 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); > fi;; > iii_att := iii_att + 1; > od;; > ret_att := ret_att / convfp(mmm_att) ; > fi;; > ret_att; > 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 > 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 > omniout_float(ALWAYS,"Radius of convergence ",4, array_pole[1],4," "); > omniout_float(ALWAYS,"Order of pole ",4, array_pole[2],4," "); > fi; > 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 > logditto := proc(file) > fprintf(file,""); > fprintf(file,"ditto"); > fprintf(file,""); > end; logditto := proc(file) fprintf(file, ""); fprintf(file, "ditto"); fprintf(file, "") end proc > logitem_integer := proc(file,n) > fprintf(file,""); > fprintf(file,"%d",n); > fprintf(file,""); > end; logitem_integer := proc(file, n) fprintf(file, ""); fprintf(file, "%d", n); fprintf(file, "") end proc > logitem_str := proc(file,str) > fprintf(file,""); > fprintf(file,str); > fprintf(file,""); > end; logitem_str := proc(file, str) fprintf(file, ""); fprintf(file, str); fprintf(file, "") end proc > log_revs := proc(file,revs) > fprintf(file,revs); > end; log_revs := proc(file, revs) fprintf(file, revs) end proc > logitem_float := proc(file,x) > fprintf(file,""); > fprintf(file,"%g",x); > fprintf(file,""); > end; logitem_float := proc(file, x) fprintf(file, ""); fprintf(file, "%g", x); fprintf(file, "") end proc > 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"); > fi; > fprintf(file,""); > 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 > logstart := proc(file) > fprintf(file,""); > end; logstart := proc(file) fprintf(file, "") end proc > logend := proc(file) > fprintf(file,"\n"); > end; logend := proc(file) fprintf(file, "\n") end proc > 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 > omniout_str(ALWAYS,"Illegal max_terms = -- Using 30"); > glob_max_terms := 30; > fi;; > if (glob_max_iter < 2) then > omniout_str(ALWAYS,"Illegal max_iter"); > errflag := true; > fi;; > if (errflag) then > > quit; > fi; > 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 > > 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 > sec_left := 0.0; > else > if (abs(sub2) > 0.0) then > rrr := (sub1/sub2); > sec_left := rrr * ms2 - ms2; > else > sec_left := 0.0; > fi; > fi;; > sec_left; > 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 > > 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 > rrr := (100.0*sub2)/sub1; > else > rrr := 0.0; > fi;; > rrr > 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 > > factorial_1 := proc(nnn) > nnn!; > > end; factorial_1 := proc(nnn) nnn! end proc > > factorial_3 := proc(mmm2,nnn2) > (mmm2!)/(nnn2!); > > end; factorial_3 := proc(mmm2, nnn2) mmm2!/nnn2! end proc > convfp := proc(mmm) > (mmm); > > end; convfp := proc(mmm) mmm end proc > convfloat := proc(mmm) > (mmm); > > 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 > exact_soln_y1 := proc(x) > -cos(x); > end; exact_soln_y1 := proc(x) -cos(x) end proc > exact_soln_y2 := proc(x) > -cos(x); > end; exact_soln_y2 := proc(x) -cos(x) end proc #END USER DEF BLOCK #END OUTFILE5 > 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_iolevel, > DEBUGMASSIVE, > glob_max_terms, > INFO, > ALWAYS, > DEBUGL, #Top Generate Globals Decl > glob_max_minutes, > glob_iter, > glob_unchanged_h_cnt, > glob_max_opt_iter, > glob_log10normmin, > glob_normmax, > glob_look_poles, > glob_log10relerr, > glob_start, > glob_max_sec, > glob_small_float, > glob_optimal_clock_start_sec, > glob_dump_analytic, > glob_large_float, > glob_percent_done, > glob_max_rel_trunc_err, > glob_log10_abserr, > days_in_year, > sec_in_min, > glob_log10abserr, > glob_curr_iter_when_opt, > glob_orig_start_sec, > glob_max_trunc_err, > glob_relerr, > glob_last_good_h, > glob_not_yet_start_msg, > djd_debug2, > glob_dump, > glob_html_log, > MAX_UNCHANGED, > glob_warned, > glob_optimal_start, > glob_hmin, > glob_disp_incr, > glob_not_yet_finished, > glob_hmin_init, > glob_optimal_done, > centuries_in_millinium, > hours_in_day, > min_in_hour, > glob_max_iter, > glob_log10_relerr, > glob_reached_optimal_h, > glob_clock_start_sec, > glob_smallish_float, > glob_no_eqs, > glob_max_order, > glob_abserr, > glob_current_iter, > glob_warned2, > glob_almost_1, > years_in_century, > glob_display_flag, > djd_debug, > glob_optimal_expect_sec, > glob_max_hours, > glob_hmax, > glob_h, > glob_initial_pass, > glob_clock_sec, #Bottom Generate Globals Decl #BEGIN CONST > array_const_1, > array_const_0D0, #END CONST > array_x, > array_1st_rel_error, > array_norms, > array_tmp4_g, > array_m1, > array_y2, > array_y1, > array_last_rel_error, > array_y1_init, > array_tmp0, > array_tmp1, > array_tmp2, > array_tmp3, > array_tmp4, > array_type_pole, > array_pole, > array_y2_init, > array_y1_higher_work, > array_y2_higher, > array_y1_higher_work2, > array_poles, > array_y1_higher, > array_y2_higher_work2, > array_y2_higher_work, > array_complex_pole, > array_real_pole, > glob_last; > glob_last; > ALWAYS := 1; > INFO := 2; > DEBUGL := 3; > DEBUGMASSIVE := 4; > glob_iolevel := INFO; > glob_iolevel := 5; > DEBUGMASSIVE := 4; > glob_max_terms := 30; > INFO := 2; > ALWAYS := 1; > DEBUGL := 3; > glob_max_minutes := 0.0; > glob_iter := 0; > glob_unchanged_h_cnt := 0; > glob_max_opt_iter := 10; > glob_log10normmin := 0.1; > glob_normmax := 0.0; > glob_look_poles := false; > glob_log10relerr := 0.0; > glob_start := 0; > glob_max_sec := 10000.0; > glob_small_float := 0.1e-50; > glob_optimal_clock_start_sec := 0.0; > glob_dump_analytic := false; > glob_large_float := 9.0e100; > glob_percent_done := 0.0; > glob_max_rel_trunc_err := 0.1e-10; > glob_log10_abserr := 0.1e-10; > days_in_year := 365.0; > sec_in_min := 60.0; > glob_log10abserr := 0.0; > glob_curr_iter_when_opt := 0; > glob_orig_start_sec := 0.0; > glob_max_trunc_err := 0.1e-10; > glob_relerr := 0.1e-10; > glob_last_good_h := 0.1; > glob_not_yet_start_msg := true; > djd_debug2 := true; > glob_dump := false; > glob_html_log := true; > MAX_UNCHANGED := 10; > glob_warned := false; > glob_optimal_start := 0.0; > glob_hmin := 0.00000000001; > glob_disp_incr := 0.1; > glob_not_yet_finished := true; > glob_hmin_init := 0.001; > glob_optimal_done := false; > centuries_in_millinium := 10.0; > hours_in_day := 24.0; > min_in_hour := 60.0; > glob_max_iter := 1000; > glob_log10_relerr := 0.1e-10; > glob_reached_optimal_h := false; > glob_clock_start_sec := 0.0; > glob_smallish_float := 0.1e-100; > glob_no_eqs := 0; > glob_max_order := 30; > glob_abserr := 0.1e-10; > glob_current_iter := 0; > glob_warned2 := false; > glob_almost_1 := 0.9990; > years_in_century := 100.0; > glob_display_flag := true; > djd_debug := true; > glob_optimal_expect_sec := 0.1; > glob_max_hours := 0.0; > glob_hmax := 1.0; > glob_h := 0.1; > glob_initial_pass := true; > glob_clock_sec := 0.0; #Write Set Defaults > glob_orig_start_sec := elapsed_time_seconds(); > MAX_UNCHANGED := 10; > glob_curr_iter_when_opt := 0; > glob_display_flag := true; > glob_max_order := 1; > glob_no_eqs := 2; > 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/mtest5.ode#################"); > omniout_str(ALWAYS,"diff ( y2 , x , 1 ) = diff ( y1, x , 1) ;"); > omniout_str(ALWAYS,"diff ( y1 , x , 1 ) = sin ( x ) ;"); > omniout_str(ALWAYS,"!"); > omniout_str(ALWAYS,"Digits := 32;"); > omniout_str(ALWAYS,"max_terms := 30;"); > omniout_str(ALWAYS,"!"); > omniout_str(ALWAYS,"x_start := 0.1;"); > omniout_str(ALWAYS,"x_end := 0.5;"); > omniout_str(ALWAYS,"array_y1_init[1] := exact_soln_y1(x_start);"); > omniout_str(ALWAYS,"array_y2_init[1] := exact_soln_y2(x_start);"); > omniout_str(ALWAYS,"glob_h := 0.00001 ;"); > omniout_str(ALWAYS,"glob_max_iter := 20;"); > omniout_str(ALWAYS,"!"); > omniout_str(ALWAYS,"exact_soln_y1 := proc(x) "); > omniout_str(ALWAYS," -cos(x);"); > omniout_str(ALWAYS,"end;"); > omniout_str(ALWAYS,"exact_soln_y2 := proc(x) "); > omniout_str(ALWAYS," -cos(x);"); > omniout_str(ALWAYS,"end;"); > 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 > 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_x:= Array(1..(max_terms + 1),[]); > array_1st_rel_error:= Array(1..(max_terms + 1),[]); > array_norms:= Array(1..(max_terms + 1),[]); > array_tmp4_g:= Array(1..(max_terms + 1),[]); > array_m1:= Array(1..(max_terms + 1),[]); > array_y2:= Array(1..(max_terms + 1),[]); > array_y1:= Array(1..(max_terms + 1),[]); > array_last_rel_error:= Array(1..(max_terms + 1),[]); > array_y1_init:= Array(1..(max_terms + 1),[]); > array_tmp0:= Array(1..(max_terms + 1),[]); > array_tmp1:= Array(1..(max_terms + 1),[]); > array_tmp2:= Array(1..(max_terms + 1),[]); > array_tmp3:= Array(1..(max_terms + 1),[]); > array_tmp4:= Array(1..(max_terms + 1),[]); > array_type_pole:= Array(1..(max_terms + 1),[]); > array_pole:= Array(1..(max_terms + 1),[]); > array_y2_init:= Array(1..(max_terms + 1),[]); > array_y1_higher_work := Array(1..(2+ 1) ,(1..max_terms+ 1),[]); > array_y2_higher := Array(1..(2+ 1) ,(1..max_terms+ 1),[]); > array_y1_higher_work2 := Array(1..(2+ 1) ,(1..max_terms+ 1),[]); > array_poles := Array(1..(2+ 1) ,(1..3+ 1),[]); > array_y1_higher := Array(1..(2+ 1) ,(1..max_terms+ 1),[]); > array_y2_higher_work2 := Array(1..(2+ 1) ,(1..max_terms+ 1),[]); > array_y2_higher_work := Array(1..(2+ 1) ,(1..max_terms+ 1),[]); > array_complex_pole := Array(1..(2+ 1) ,(1..3+ 1),[]); > array_real_pole := Array(1..(2+ 1) ,(1..3+ 1),[]); > term := 1; > while term <= max_terms do > array_x[term] := 0.0; > term := term + 1; > od;; > term := 1; > while term <= max_terms do > array_1st_rel_error[term] := 0.0; > term := term + 1; > od;; > term := 1; > while term <= max_terms do > array_norms[term] := 0.0; > term := term + 1; > od;; > term := 1; > while term <= max_terms do > array_tmp4_g[term] := 0.0; > term := term + 1; > od;; > term := 1; > while term <= max_terms do > array_m1[term] := 0.0; > term := term + 1; > od;; > term := 1; > while term <= max_terms do > array_y2[term] := 0.0; > term := term + 1; > od;; > term := 1; > while term <= max_terms do > array_y1[term] := 0.0; > term := term + 1; > od;; > term := 1; > while term <= max_terms do > array_last_rel_error[term] := 0.0; > term := term + 1; > od;; > term := 1; > while term <= max_terms do > array_y1_init[term] := 0.0; > term := term + 1; > od;; > term := 1; > while term <= max_terms do > array_tmp0[term] := 0.0; > term := term + 1; > od;; > term := 1; > while term <= max_terms do > array_tmp1[term] := 0.0; > term := term + 1; > od;; > term := 1; > while term <= max_terms do > array_tmp2[term] := 0.0; > term := term + 1; > od;; > term := 1; > while term <= max_terms do > array_tmp3[term] := 0.0; > term := term + 1; > od;; > term := 1; > while term <= max_terms do > array_tmp4[term] := 0.0; > term := term + 1; > od;; > term := 1; > while term <= max_terms do > array_type_pole[term] := 0.0; > term := term + 1; > od;; > term := 1; > while term <= max_terms do > array_pole[term] := 0.0; > term := term + 1; > od;; > term := 1; > while term <= max_terms do > array_y2_init[term] := 0.0; > term := term + 1; > od;; > ord := 1; > while ord <=2 do > term := 1; > while term <= max_terms do > array_y1_higher_work[ord,term] := 0.0; > term := term + 1; > od;; > ord := ord + 1; > od;; > ord := 1; > while ord <=2 do > term := 1; > while term <= max_terms do > array_y2_higher[ord,term] := 0.0; > term := term + 1; > od;; > ord := ord + 1; > od;; > ord := 1; > while ord <=2 do > term := 1; > while term <= max_terms do > array_y1_higher_work2[ord,term] := 0.0; > term := term + 1; > od;; > ord := ord + 1; > od;; > ord := 1; > while ord <=2 do > term := 1; > while term <= 3 do > array_poles[ord,term] := 0.0; > term := term + 1; > od;; > ord := ord + 1; > od;; > ord := 1; > while ord <=2 do > term := 1; > while term <= max_terms do > array_y1_higher[ord,term] := 0.0; > term := term + 1; > od;; > ord := ord + 1; > od;; > ord := 1; > while ord <=2 do > term := 1; > while term <= max_terms do > array_y2_higher_work2[ord,term] := 0.0; > term := term + 1; > od;; > ord := ord + 1; > od;; > ord := 1; > while ord <=2 do > term := 1; > while term <= max_terms do > array_y2_higher_work[ord,term] := 0.0; > term := term + 1; > od;; > ord := ord + 1; > od;; > ord := 1; > while ord <=2 do > term := 1; > while term <= 3 do > array_complex_pole[ord,term] := 0.0; > term := term + 1; > od;; > ord := ord + 1; > od;; > ord := 1; > while ord <=2 do > term := 1; > while term <= 3 do > array_real_pole[ord,term] := 0.0; > term := term + 1; > od;; > ord := ord + 1; > od;; #BEGIN ARRAYS DEFINED AND INITIALIZATED > array_x := Array(1..(max_terms+1 + 1),[]); > term := 1; > while term <= max_terms + 1 do > array_x[term] := 0.0; > term := term + 1; > od;; > array_tmp4_g := Array(1..(max_terms+1 + 1),[]); > term := 1; > while term <= max_terms + 1 do > array_tmp4_g[term] := 0.0; > term := term + 1; > od;; > array_y1 := Array(1..(max_terms+1 + 1),[]); > term := 1; > while term <= max_terms + 1 do > array_y1[term] := 0.0; > term := term + 1; > od;; > array_y2 := Array(1..(max_terms+1 + 1),[]); > term := 1; > while term <= max_terms + 1 do > array_y2[term] := 0.0; > term := term + 1; > od;; > array_tmp4 := Array(1..(max_terms+1 + 1),[]); > term := 1; > while term <= max_terms + 1 do > array_tmp4[term] := 0.0; > term := term + 1; > od;; > array_tmp3 := Array(1..(max_terms+1 + 1),[]); > term := 1; > while term <= max_terms + 1 do > array_tmp3[term] := 0.0; > term := term + 1; > od;; > array_tmp2 := Array(1..(max_terms+1 + 1),[]); > term := 1; > while term <= max_terms + 1 do > array_tmp2[term] := 0.0; > term := term + 1; > od;; > array_tmp1 := Array(1..(max_terms+1 + 1),[]); > term := 1; > while term <= max_terms + 1 do > array_tmp1[term] := 0.0; > term := term + 1; > od;; > array_tmp0 := Array(1..(max_terms+1 + 1),[]); > term := 1; > while term <= max_terms + 1 do > array_tmp0[term] := 0.0; > term := term + 1; > od;; > array_const_1 := Array(1..(max_terms+1 + 1),[]); > term := 1; > while term <= max_terms + 1 do > array_const_1[term] := 0.0; > term := term + 1; > od;; > array_const_1[1] := 1; > array_const_0D0 := Array(1..(max_terms+1 + 1),[]); > term := 1; > while term <= max_terms + 1 do > array_const_0D0[term] := 0.0; > term := term + 1; > od;; > array_const_0D0[1] := 0.0; > array_m1 := Array(1..(max_terms+1 + 1),[]); > term := 1; > while term <= max_terms do > array_m1[term] := 0.0; > term := term + 1; > od;; > array_m1[1] := -1.0; #END ARRAYS DEFINED AND INITIALIZATED #TOP SECOND INPUT BLOCK #BEGIN SECOND INPUT BLOCK > x_start := 0.1; > x_end := 0.5; > array_y1_init[1] := exact_soln_y1(x_start); > array_y2_init[1] := exact_soln_y2(x_start); > glob_h := 0.00001 ; > glob_max_iter := 20; #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 > if glob_html_log then > html_log_file := fopen("html/entry.html",WRITE,TEXT); > fi;; #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_y2 > term_no := 1; > while (term_no <= order_diff) do > array_y2[term_no] := array_y2_init[term_no] * glob_h ^ (term_no - 1) / factorial_1(term_no - 1); > term_no := term_no + 1; > od;; > 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_y2_higher[r_order,term_no] := array_y2_init[it]* (glob_h ^ (term_no - 1)) / ((factorial_1(term_no - 1))); > term_no := term_no + 1; > od;; > r_order := r_order + 1; > od; > ; > order_diff := 1; #Start Series array_y1 > term_no := 1; > while (term_no <= order_diff) do > array_y1[term_no] := array_y1_init[term_no] * glob_h ^ (term_no - 1) / factorial_1(term_no - 1); > term_no := term_no + 1; > od;; > 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_y1_higher[r_order,term_no] := array_y1_init[it]* (glob_h ^ (term_no - 1)) / ((factorial_1(term_no - 1))); > term_no := term_no + 1; > od;; > r_order := r_order + 1; > od; > ; > current_iter := 1; > glob_clock_start_sec := elapsed_time_seconds(); > start_array_y2(); > if (abs(array_y2_higher[1,1]) > glob_small_float) then > tmp := abs(array_y2_higher[1,1]); > log10norm := (log10(tmp)); > if (log10norm < glob_log10normmin) then > glob_log10normmin := log10norm; > fi; > fi;; > display_alot(current_iter) > ; > start_array_y1(); > if (abs(array_y1_higher[1,1]) > glob_small_float) then > tmp := abs(array_y1_higher[1,1]); > log10norm := (log10(tmp)); > if (log10norm < glob_log10normmin) then > glob_log10normmin := log10norm; > fi; > fi;; > 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 #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; > sub_iter := 1; > while sub_iter <= 2 do > atomall() > ; > sub_iter := sub_iter + 1; > od;; > if (glob_look_poles) then #left paren 0004C > check_for_pole(); > fi;;#was right paren 0004C > array_x[1] := array_x[1] + glob_h; > array_x[2] := glob_h; > order_diff := 1; #Jump Series array_y2 #START PART 1 SUM AND ADJUST #START SUM AND ADJUST EQ =1 #sum_and_adjust array_y2 > order_diff := 1; #BEFORE ADJUST SUBSERIES EQ =1 > order_diff := 1; > ord := 2; > calc_term := 1; #adjust_subseriesarray_y2 > iii := glob_max_terms; > while (iii >= calc_term) do > array_y2_higher_work[2,iii] := array_y2_higher[2,iii] / (glob_h ^ (calc_term - 1)) / factorial_3(iii - calc_term , iii - 1); > iii := iii - 1; > od;; #AFTER ADJUST SUBSERIES EQ =1 #BEFORE SUM SUBSERIES EQ =1 > order_diff := 1; > temp_sum := 0.0; > ord := 2; > calc_term := 1; #sum_subseriesarray_y2 > iii := glob_max_terms; > while (iii >= calc_term) do > temp_sum := temp_sum + array_y2_higher_work[ord,iii]; > iii := iii - 1; > od;; > array_y2_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 > order_diff := 1; > ord := 1; > calc_term := 2; #adjust_subseriesarray_y2 > iii := glob_max_terms; > while (iii >= calc_term) do > array_y2_higher_work[1,iii] := array_y2_higher[1,iii] / (glob_h ^ (calc_term - 1)) / factorial_3(iii - calc_term , iii - 1); > iii := iii - 1; > od;; #AFTER ADJUST SUBSERIES EQ =1 #BEFORE SUM SUBSERIES EQ =1 > order_diff := 1; > temp_sum := 0.0; > ord := 1; > calc_term := 2; #sum_subseriesarray_y2 > iii := glob_max_terms; > while (iii >= calc_term) do > temp_sum := temp_sum + array_y2_higher_work[ord,iii]; > iii := iii - 1; > od;; > array_y2_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 > order_diff := 1; > ord := 1; > calc_term := 1; #adjust_subseriesarray_y2 > iii := glob_max_terms; > while (iii >= calc_term) do > array_y2_higher_work[1,iii] := array_y2_higher[1,iii] / (glob_h ^ (calc_term - 1)) / factorial_3(iii - calc_term , iii - 1); > iii := iii - 1; > od;; #AFTER ADJUST SUBSERIES EQ =1 #BEFORE SUM SUBSERIES EQ =1 > order_diff := 1; > temp_sum := 0.0; > ord := 1; > calc_term := 1; #sum_subseriesarray_y2 > iii := glob_max_terms; > while (iii >= calc_term) do > temp_sum := temp_sum + array_y2_higher_work[ord,iii]; > iii := iii - 1; > od;; > array_y2_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 > array_y2[term_no] := array_y2_higher_work2[1,term_no]; > ord := 1; > while ord <= order_diff do > array_y2_higher[ord,term_no] := array_y2_higher_work2[ord,term_no]; > ord := ord + 1; > od;; > term_no := term_no - 1; > od;; #END PART 2 HEVE MOVED TERMS to REGULAR Array > order_diff := 1; #Jump Series array_y1 #START PART 1 SUM AND ADJUST #START SUM AND ADJUST EQ =2 #sum_and_adjust array_y1 > order_diff := 1; #BEFORE ADJUST SUBSERIES EQ =2 > order_diff := 1; > ord := 2; > calc_term := 1; #adjust_subseriesarray_y1 > iii := glob_max_terms; > while (iii >= calc_term) do > array_y1_higher_work[2,iii] := array_y1_higher[2,iii] / (glob_h ^ (calc_term - 1)) / factorial_3(iii - calc_term , iii - 1); > iii := iii - 1; > od;; #AFTER ADJUST SUBSERIES EQ =2 #BEFORE SUM SUBSERIES EQ =2 > order_diff := 1; > temp_sum := 0.0; > ord := 2; > calc_term := 1; #sum_subseriesarray_y1 > iii := glob_max_terms; > while (iii >= calc_term) do > temp_sum := temp_sum + array_y1_higher_work[ord,iii]; > iii := iii - 1; > od;; > array_y1_higher_work2[ord,calc_term] := temp_sum * (glob_h ^ (calc_term - 1)) / (convfp(calc_term - 1)!); #AFTER SUM SUBSERIES EQ =2 #BEFORE ADJUST SUBSERIES EQ =2 > order_diff := 1; > ord := 1; > calc_term := 2; #adjust_subseriesarray_y1 > iii := glob_max_terms; > while (iii >= calc_term) do > array_y1_higher_work[1,iii] := array_y1_higher[1,iii] / (glob_h ^ (calc_term - 1)) / factorial_3(iii - calc_term , iii - 1); > iii := iii - 1; > od;; #AFTER ADJUST SUBSERIES EQ =2 #BEFORE SUM SUBSERIES EQ =2 > order_diff := 1; > temp_sum := 0.0; > ord := 1; > calc_term := 2; #sum_subseriesarray_y1 > iii := glob_max_terms; > while (iii >= calc_term) do > temp_sum := temp_sum + array_y1_higher_work[ord,iii]; > iii := iii - 1; > od;; > array_y1_higher_work2[ord,calc_term] := temp_sum * (glob_h ^ (calc_term - 1)) / (convfp(calc_term - 1)!); #AFTER SUM SUBSERIES EQ =2 #BEFORE ADJUST SUBSERIES EQ =2 > order_diff := 1; > ord := 1; > calc_term := 1; #adjust_subseriesarray_y1 > iii := glob_max_terms; > while (iii >= calc_term) do > array_y1_higher_work[1,iii] := array_y1_higher[1,iii] / (glob_h ^ (calc_term - 1)) / factorial_3(iii - calc_term , iii - 1); > iii := iii - 1; > od;; #AFTER ADJUST SUBSERIES EQ =2 #BEFORE SUM SUBSERIES EQ =2 > order_diff := 1; > temp_sum := 0.0; > ord := 1; > calc_term := 1; #sum_subseriesarray_y1 > iii := glob_max_terms; > while (iii >= calc_term) do > temp_sum := temp_sum + array_y1_higher_work[ord,iii]; > iii := iii - 1; > od;; > array_y1_higher_work2[ord,calc_term] := temp_sum * (glob_h ^ (calc_term - 1)) / (convfp(calc_term - 1)!); #AFTER SUM SUBSERIES EQ =2 #END SUM AND ADJUST EQ =2 #END PART 1 #START PART 2 MOVE TERMS to REGULAR Array > term_no := glob_max_terms; > while (term_no >= 1) do > array_y1[term_no] := array_y1_higher_work2[1,term_no]; > ord := 1; > while ord <= order_diff do > array_y1_higher[ord,term_no] := array_y1_higher_work2[ord,term_no]; > ord := ord + 1; > od;; > term_no := term_no - 1; > od;; #END PART 2 HEVE MOVED TERMS to REGULAR Array > display_alot(current_iter) > ; > od;;#right paren 0001C > omniout_str(ALWAYS,"Finished!"); > if (glob_iter >= glob_max_iter) then > omniout_str(ALWAYS,"Maximum Iterations Reached before Solution Completed!") > fi;; > if (elapsed_time_seconds() - convfloat(glob_orig_start_sec) >= convfloat(glob_max_sec )) then > omniout_str(ALWAYS,"Maximum Time Reached before Solution Completed!") > fi;; > glob_clock_sec := elapsed_time_seconds(); > 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-05-26T17:36:03-05:00") > ; > logitem_str(html_log_file,"Maple") > ; > logitem_str(html_log_file,"mtest5") > ; > logitem_str(html_log_file,"diff ( y2 , x , 1 ) = diff ( y1, x , 1) ;") > ; > 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; > fi;; > 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 > fi;; > log_revs(html_log_file," 067 ") > ; > logitem_str(html_log_file,"Testing Systems of Equations") > ; > logend(html_log_file) > ; > logditto(html_log_file) > ; > logditto(html_log_file) > ; > logditto(html_log_file) > ; > logitem_str(html_log_file,"diff ( y1 , x , 1 ) = sin ( x ) ;") > ; > logditto(html_log_file) > ; > logditto(html_log_file) > ; > logditto(html_log_file) > ; > logditto(html_log_file) > ; > logditto(html_log_file) > ; > ; > logditto(html_log_file) > ; > logitem_float(html_log_file,array_1st_rel_error[2]) > ; > logitem_float(html_log_file,array_last_rel_error[2]) > ; > logditto(html_log_file) > ; > logitem_pole(html_log_file,array_type_pole[2]) > ; > if array_type_pole[2] = 1 or array_type_pole[2] = 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; > fi;; > logditto(html_log_file) > ; > if glob_percent_done < 100.0 then > logditto(html_log_file) > ; > 0 > else > logditto(html_log_file) > ; > 0 > fi;; > logditto(html_log_file); > ; > logditto(html_log_file) > ; > logend(html_log_file) > ; > ; > fi;; > if glob_html_log then > fclose(html_log_file); > fi; > ; > ;; #END OUTFILEMAIN > 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_iolevel, DEBUGMASSIVE, glob_max_terms, INFO, ALWAYS, DEBUGL, glob_max_minutes, glob_iter, glob_unchanged_h_cnt, glob_max_opt_iter, glob_log10normmin, glob_normmax, glob_look_poles, glob_log10relerr, glob_start, glob_max_sec, glob_small_float, glob_optimal_clock_start_sec, glob_dump_analytic, glob_large_float, glob_percent_done, glob_max_rel_trunc_err, glob_log10_abserr, days_in_year, sec_in_min, glob_log10abserr, glob_curr_iter_when_opt, glob_orig_start_sec, glob_max_trunc_err, glob_relerr, glob_last_good_h, glob_not_yet_start_msg, djd_debug2, glob_dump, glob_html_log, MAX_UNCHANGED, glob_warned, glob_optimal_start, glob_hmin, glob_disp_incr, glob_not_yet_finished, glob_hmin_init, glob_optimal_done, centuries_in_millinium, hours_in_day, min_in_hour, glob_max_iter, glob_log10_relerr, glob_reached_optimal_h, glob_clock_start_sec, glob_smallish_float, glob_no_eqs, glob_max_order, glob_abserr, glob_current_iter, glob_warned2, glob_almost_1, years_in_century, glob_display_flag, djd_debug, glob_optimal_expect_sec, glob_max_hours, glob_hmax, glob_h, glob_initial_pass, glob_clock_sec, array_const_1, array_const_0D0, array_x, array_1st_rel_error, array_norms, array_tmp4_g, array_m1, array_y2, array_y1, array_last_rel_error, array_y1_init, array_tmp0, array_tmp1, array_tmp2, array_tmp3, array_tmp4, array_type_pole, array_pole, array_y2_init, array_y1_higher_work, array_y2_higher, array_y1_higher_work2, array_poles, array_y1_higher, array_y2_higher_work2, array_y2_higher_work, array_complex_pole, array_real_pole, glob_last; glob_last; ALWAYS := 1; INFO := 2; DEBUGL := 3; DEBUGMASSIVE := 4; glob_iolevel := INFO; glob_iolevel := 5; DEBUGMASSIVE := 4; glob_max_terms := 30; INFO := 2; ALWAYS := 1; DEBUGL := 3; glob_max_minutes := 0.; glob_iter := 0; glob_unchanged_h_cnt := 0; glob_max_opt_iter := 10; glob_log10normmin := 0.1; glob_normmax := 0.; glob_look_poles := false; glob_log10relerr := 0.; glob_start := 0; glob_max_sec := 10000.0; glob_small_float := 0.1*10^(-50); glob_optimal_clock_start_sec := 0.; glob_dump_analytic := false; glob_large_float := 0.90*10^101; glob_percent_done := 0.; glob_max_rel_trunc_err := 0.1*10^(-10); glob_log10_abserr := 0.1*10^(-10); days_in_year := 365.0; sec_in_min := 60.0; glob_log10abserr := 0.; glob_curr_iter_when_opt := 0; glob_orig_start_sec := 0.; glob_max_trunc_err := 0.1*10^(-10); glob_relerr := 0.1*10^(-10); glob_last_good_h := 0.1; glob_not_yet_start_msg := true; djd_debug2 := true; glob_dump := false; glob_html_log := true; MAX_UNCHANGED := 10; glob_warned := false; glob_optimal_start := 0.; glob_hmin := 0.1*10^(-10); glob_disp_incr := 0.1; glob_not_yet_finished := true; glob_hmin_init := 0.001; glob_optimal_done := false; centuries_in_millinium := 10.0; hours_in_day := 24.0; min_in_hour := 60.0; glob_max_iter := 1000; glob_log10_relerr := 0.1*10^(-10); glob_reached_optimal_h := false; glob_clock_start_sec := 0.; glob_smallish_float := 0.1*10^(-100); glob_no_eqs := 0; glob_max_order := 30; glob_abserr := 0.1*10^(-10); glob_current_iter := 0; glob_warned2 := false; glob_almost_1 := 0.9990; years_in_century := 100.0; glob_display_flag := true; djd_debug := true; glob_optimal_expect_sec := 0.1; glob_max_hours := 0.; glob_hmax := 1.0; glob_h := 0.1; glob_initial_pass := true; glob_clock_sec := 0.; glob_orig_start_sec := elapsed_time_seconds(); MAX_UNCHANGED := 10; glob_curr_iter_when_opt := 0; glob_display_flag := true; glob_max_order := 1; glob_no_eqs := 2; 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/mtest5.ode#################"); omniout_str(ALWAYS, "diff ( y2 , x , 1 ) = diff ( y1, x , 1) ;"); omniout_str(ALWAYS, "diff ( y1 , x , 1 ) = sin ( x ) ;"); omniout_str(ALWAYS, "!"); omniout_str(ALWAYS, "Digits := 32;"); omniout_str(ALWAYS, "max_terms := 30;"); omniout_str(ALWAYS, "!"); omniout_str(ALWAYS, "x_start := 0.1;"); omniout_str(ALWAYS, "x_end := 0.5;"); omniout_str(ALWAYS, "array_y1_init[1] := exact_soln_y1(x_start);"); omniout_str(ALWAYS, "array_y2_init[1] := exact_soln_y2(x_start);"); omniout_str(ALWAYS, "glob_h := 0.00001 ;"); omniout_str(ALWAYS, "glob_max_iter := 20;"); omniout_str(ALWAYS, "!"); omniout_str(ALWAYS, "exact_soln_y1 := proc(x) "); omniout_str(ALWAYS, " -cos(x);"); omniout_str(ALWAYS, "end;"); omniout_str(ALWAYS, "exact_soln_y2 := proc(x) "); omniout_str(ALWAYS, " -cos(x);"); omniout_str(ALWAYS, "end;"); 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_x := Array(1 .. max_terms + 1, []); array_1st_rel_error := Array(1 .. max_terms + 1, []); array_norms := Array(1 .. max_terms + 1, []); array_tmp4_g := Array(1 .. max_terms + 1, []); array_m1 := Array(1 .. max_terms + 1, []); array_y2 := Array(1 .. max_terms + 1, []); array_y1 := Array(1 .. max_terms + 1, []); array_last_rel_error := Array(1 .. max_terms + 1, []); array_y1_init := Array(1 .. max_terms + 1, []); array_tmp0 := Array(1 .. max_terms + 1, []); array_tmp1 := Array(1 .. max_terms + 1, []); array_tmp2 := Array(1 .. max_terms + 1, []); array_tmp3 := Array(1 .. max_terms + 1, []); array_tmp4 := Array(1 .. max_terms + 1, []); array_type_pole := Array(1 .. max_terms + 1, []); array_pole := Array(1 .. max_terms + 1, []); array_y2_init := Array(1 .. max_terms + 1, []); array_y1_higher_work := Array(1 .. 3, 1 .. max_terms + 1, []); array_y2_higher := Array(1 .. 3, 1 .. max_terms + 1, []); array_y1_higher_work2 := Array(1 .. 3, 1 .. max_terms + 1, []); array_poles := Array(1 .. 3, 1 .. 4, []); array_y1_higher := Array(1 .. 3, 1 .. max_terms + 1, []); array_y2_higher_work2 := Array(1 .. 3, 1 .. max_terms + 1, []); array_y2_higher_work := Array(1 .. 3, 1 .. max_terms + 1, []); array_complex_pole := Array(1 .. 3, 1 .. 4, []); array_real_pole := Array(1 .. 3, 1 .. 4, []); term := 1; while term <= max_terms do array_x[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_norms[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_tmp4_g[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_y2[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_y1[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_y1_init[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; term := 1; while term <= max_terms do array_tmp2[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_tmp3[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_tmp4[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_pole[term] := 0.; term := term + 1 end do; term := 1; while term <= max_terms do array_y2_init[term] := 0.; term := term + 1 end do; ord := 1; while ord <= 2 do term := 1; while term <= max_terms do array_y1_higher_work[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_y2_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_y1_higher_work2[ord, term] := 0.; term := term + 1 end do; ord := ord + 1 end do; ord := 1; while ord <= 2 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 <= 2 do term := 1; while term <= max_terms do array_y1_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_y2_higher_work2[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_y2_higher_work[ord, term] := 0.; term := term + 1 end do; ord := ord + 1 end do; ord := 1; while ord <= 2 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 <= 3 do array_real_pole[ord, term] := 0.; term := term + 1 end do; ord := ord + 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_tmp4_g := Array(1 .. max_terms + 2, []); term := 1; while term <= max_terms + 1 do array_tmp4_g[term] := 0.; term := term + 1 end do; array_y1 := Array(1 .. max_terms + 2, []); term := 1; while term <= max_terms + 1 do array_y1[term] := 0.; term := term + 1 end do; array_y2 := Array(1 .. max_terms + 2, []); term := 1; while term <= max_terms + 1 do array_y2[term] := 0.; term := term + 1 end do; array_tmp4 := Array(1 .. max_terms + 2, []); term := 1; while term <= max_terms + 1 do array_tmp4[term] := 0.; term := term + 1 end do; array_tmp3 := Array(1 .. max_terms + 2, []); term := 1; while term <= max_terms + 1 do array_tmp3[term] := 0.; term := term + 1 end do; array_tmp2 := Array(1 .. max_terms + 2, []); term := 1; while term <= max_terms + 1 do array_tmp2[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_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_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_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 := 0.1; x_end := 0.5; array_y1_init[1] := exact_soln_y1(x_start); array_y2_init[1] := exact_soln_y2(x_start); glob_h := 0.00001; glob_max_iter := 20; 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(); 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_y2[term_no] := array_y2_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_y2_higher[r_order, term_no] := array_y2_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; order_diff := 1; term_no := 1; while term_no <= order_diff do array_y1[term_no] := array_y1_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_y1_higher[r_order, term_no] := array_y1_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_y2(); if glob_small_float < abs(array_y2_higher[1, 1]) then tmp := abs(array_y2_higher[1, 1]); log10norm := log10(tmp); if log10norm < glob_log10normmin then glob_log10normmin := log10norm end if end if; display_alot(current_iter); start_array_y1(); if glob_small_float < abs(array_y1_higher[1, 1]) then tmp := abs(array_y1_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; sub_iter := 1; while sub_iter <= 2 do atomall(); sub_iter := sub_iter + 1 end do; 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; order_diff := 1; order_diff := 1; ord := 2; calc_term := 1; iii := glob_max_terms; while calc_term <= iii do array_y2_higher_work[2, iii] := array_y2_higher[2, iii]/( glob_h^(calc_term - 1)* factorial_3(iii - calc_term, iii - 1)); iii := iii - 1 end do; order_diff := 1; temp_sum := 0.; ord := 2; calc_term := 1; iii := glob_max_terms; while calc_term <= iii do temp_sum := temp_sum + array_y2_higher_work[ord, iii]; iii := iii - 1 end do; array_y2_higher_work2[ord, calc_term] := temp_sum*glob_h^(calc_term - 1)/convfp(calc_term - 1)!; order_diff := 1; ord := 1; calc_term := 2; iii := glob_max_terms; while calc_term <= iii do array_y2_higher_work[1, iii] := array_y2_higher[1, iii]/( glob_h^(calc_term - 1)* factorial_3(iii - calc_term, iii - 1)); iii := iii - 1 end do; order_diff := 1; temp_sum := 0.; ord := 1; calc_term := 2; iii := glob_max_terms; while calc_term <= iii do temp_sum := temp_sum + array_y2_higher_work[ord, iii]; iii := iii - 1 end do; array_y2_higher_work2[ord, calc_term] := temp_sum*glob_h^(calc_term - 1)/convfp(calc_term - 1)!; order_diff := 1; ord := 1; calc_term := 1; iii := glob_max_terms; while calc_term <= iii do array_y2_higher_work[1, iii] := array_y2_higher[1, iii]/( glob_h^(calc_term - 1)* factorial_3(iii - calc_term, iii - 1)); iii := iii - 1 end do; order_diff := 1; temp_sum := 0.; ord := 1; calc_term := 1; iii := glob_max_terms; while calc_term <= iii do temp_sum := temp_sum + array_y2_higher_work[ord, iii]; iii := iii - 1 end do; array_y2_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_y2[term_no] := array_y2_higher_work2[1, term_no]; ord := 1; while ord <= order_diff do array_y2_higher[ord, term_no] := array_y2_higher_work2[ord, term_no]; ord := ord + 1 end do; term_no := term_no - 1 end do; order_diff := 1; order_diff := 1; order_diff := 1; ord := 2; calc_term := 1; iii := glob_max_terms; while calc_term <= iii do array_y1_higher_work[2, iii] := array_y1_higher[2, iii]/( glob_h^(calc_term - 1)* factorial_3(iii - calc_term, iii - 1)); iii := iii - 1 end do; order_diff := 1; temp_sum := 0.; ord := 2; calc_term := 1; iii := glob_max_terms; while calc_term <= iii do temp_sum := temp_sum + array_y1_higher_work[ord, iii]; iii := iii - 1 end do; array_y1_higher_work2[ord, calc_term] := temp_sum*glob_h^(calc_term - 1)/convfp(calc_term - 1)!; order_diff := 1; ord := 1; calc_term := 2; iii := glob_max_terms; while calc_term <= iii do array_y1_higher_work[1, iii] := array_y1_higher[1, iii]/( glob_h^(calc_term - 1)* factorial_3(iii - calc_term, iii - 1)); iii := iii - 1 end do; order_diff := 1; temp_sum := 0.; ord := 1; calc_term := 2; iii := glob_max_terms; while calc_term <= iii do temp_sum := temp_sum + array_y1_higher_work[ord, iii]; iii := iii - 1 end do; array_y1_higher_work2[ord, calc_term] := temp_sum*glob_h^(calc_term - 1)/convfp(calc_term - 1)!; order_diff := 1; ord := 1; calc_term := 1; iii := glob_max_terms; while calc_term <= iii do array_y1_higher_work[1, iii] := array_y1_higher[1, iii]/( glob_h^(calc_term - 1)* factorial_3(iii - calc_term, iii - 1)); iii := iii - 1 end do; order_diff := 1; temp_sum := 0.; ord := 1; calc_term := 1; iii := glob_max_terms; while calc_term <= iii do temp_sum := temp_sum + array_y1_higher_work[ord, iii]; iii := iii - 1 end do; array_y1_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_y1[term_no] := array_y1_higher_work2[1, term_no]; ord := 1; while ord <= order_diff do array_y1_higher[ord, term_no] := array_y1_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_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-05-26T17:36:03-05:00"); logitem_str(html_log_file, "Maple"); logitem_str(html_log_file, "mtest5"); logitem_str(html_log_file, "diff ( y2 , x , 1 ) = diff ( y1, x , 1) ;"); 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, " 067 "); logitem_str(html_log_file, "Testing Systems of Equations"); logend(html_log_file); logditto(html_log_file); logditto(html_log_file); logditto(html_log_file); logitem_str(html_log_file, "diff ( y1 , x , 1 ) = sin ( x ) ;"); logditto(html_log_file); logditto(html_log_file); logditto(html_log_file); logditto(html_log_file); logditto(html_log_file); logditto(html_log_file); logitem_float(html_log_file, array_1st_rel_error[2]); logitem_float(html_log_file, array_last_rel_error[2]); logditto(html_log_file); logitem_pole(html_log_file, array_type_pole[2]); if array_type_pole[2] = 1 or array_type_pole[2] = 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; logditto(html_log_file); if glob_percent_done < 100.0 then logditto(html_log_file); 0 else logditto(html_log_file); 0 end if; logditto(html_log_file); logditto(html_log_file); logend(html_log_file) end if; if glob_html_log then fclose(html_log_file) end if end proc > mainprog(); ##############ECHO OF PROBLEM################# ##############temp/mtest5.ode################# diff ( y2 , x , 1 ) = diff ( y1, x , 1) ; diff ( y1 , x , 1 ) = sin ( x ) ; ! Digits := 32; max_terms := 30; ! x_start := 0.1; x_end := 0.5; array_y1_init[1] := exact_soln_y1(x_start); array_y2_init[1] := exact_soln_y2(x_start); glob_h := 0.00001 ; glob_max_iter := 20; ! exact_soln_y1 := proc(x) -cos(x); end; exact_soln_y2 := proc(x) -cos(x); end; #######END OF ECHO OF PROBLEM################# START of Soultion x[1] = 0.1 y2[1] (analytic) = -0.99500416527802576609556198780387 y2[1] (numeric) = -0.99500416527802576609556198780387 absolute error = 0 relative error = 0 % h = 1e-05 y1[1] (analytic) = -0.99500416527802576609556198780387 y1[1] (numeric) = -0.99500416527802576609556198780387 absolute error = 0 relative error = 0 % h = 1e-05 x[1] = 0.1 y2[1] (analytic) = -0.99500416527802576609556198780387 y2[1] (numeric) = -0.99500416527802576609556198780387 absolute error = 0 relative error = 0 % h = 1e-05 y1[1] (analytic) = -0.99500416527802576609556198780387 y1[1] (numeric) = -0.99500416527802576609556198780387 absolute error = 0 relative error = 0 % h = 1e-05 TOP MAIN SOLVE Loop x[1] = 0.10001 y2[1] (analytic) = -0.99500316689410910618945499081414 y2[1] (numeric) = -0.99500216855994263236142370536325 absolute error = 9.9833416647382803128545089e-07 relative error = 0.00010033477276158995571975679432254 % h = 1e-05 y1[1] (analytic) = -0.99500316689410910618945499081414 y1[1] (numeric) = -0.99500316689410910618945499081409 absolute error = 5e-32 relative error = 5.0251096341808059296954844747265e-30 % h = 1e-05 TOP MAIN SOLVE Loop x[1] = 0.10002 y2[1] (analytic) = -0.9950021684106921295947662525112 y2[1] (numeric) = -0.99500017164285881532871498866694 absolute error = 1.99676783331426605126384426e-06 relative error = 0.00020067974690986704714540121110212 % h = 1e-05 y1[1] (analytic) = -0.9950021684106921295947662525112 y1[1] (numeric) = -0.9950021684106921295947662525111 absolute error = 1.0e-31 relative error = 1.0050229353743930640154216985548e-29 % h = 1e-05 TOP MAIN SOLVE Loop x[1] = 0.10003 y2[1] (analytic) = -0.99500116982777493615983746972246 y2[1] (numeric) = -0.99499817452677451468914421775411 absolute error = 2.99530100042147069325196835e-06 relative error = 0.00030103492249561156603476347306173 % h = 1e-05 y1[1] (analytic) = -0.99500116982777493615983746972246 y1[1] (numeric) = -0.99500116982777493615983746972231 absolute error = 1.5e-31 relative error = 1.5075359160227273595852677425759e-29 % h = 1e-05 TOP MAIN SOLVE Loop x[1] = 0.10004 y2[1] (analytic) = -0.99500017114535762574296036095926 y2[1] (numeric) = -0.99499617721168993015431982102445 absolute error = 3.99393366769558864053993481e-06 relative error = 0.00040140029956960908857576675758061 % h = 1e-05 y1[1] (analytic) = -0.99500017114535762574296036095926 y1[1] (numeric) = -0.99500017114535762574296036095906 absolute error = 2.0e-31 relative error = 2.0100499055168744469584672358996e-29 % h = 1e-05 TOP MAIN SOLVE Loop x[1] = 0.10005 y2[1] (analytic) = -0.99499917236344029821237665643104 y2[1] (numeric) = -0.99499417969760526145575025526701 absolute error = 4.99266583503675662640116403e-06 relative error = 0.00050177587818265047544947779362234 % h = 1e-05 y1[1] (analytic) = -0.99499917236344029821237665643104 y1[1] (numeric) = -0.9949991723634402982123766564308 absolute error = 2.4e-31 relative error = 2.4120623078502012618037529241336e-29 % h = 1e-05 TOP MAIN SOLVE Loop x[1] = 0.10006 y2[1] (analytic) = -0.99499817348202305344627808805855 y2[1] (numeric) = -0.99499218198452070834484398568706 absolute error = 5.99149750234510143410237149e-06 relative error = 0.00060216165838553187189316424149333 % h = 1e-05 y1[1] (analytic) = -0.99499817348202305344627808805855 y1[1] (numeric) = -0.99499817348202305344627808805827 absolute error = 2.8e-31 relative error = 2.8140755175472575731085845835111e-29 % h = 1e-05 TOP MAIN SOLVE Loop memory used=3.8MB, alloc=3.0MB, time=0.19 x[1] = 0.10007 y2[1] (analytic) = -0.99499717450110599133280637948601 y2[1] (numeric) = -0.99499018407243647059290946593092 absolute error = 6.99042866952073989691355509e-06 relative error = 0.00070255764022905470776335885155806 % h = 1e-05 y1[1] (analytic) = -0.99499717450110599133280637948601 y1[1] (numeric) = -0.99499717450110599133280637948567 absolute error = 3.4e-31 relative error = 3.4170951306517712351575368801094e-29 % h = 1e-05 TOP MAIN SOLVE Loop x[1] = 0.10008 y2[1] (analytic) = -0.99499617542068921177005323609226 y2[1] (numeric) = -0.99498818596135274799115511810887 absolute error = 7.98945933646377889811798339e-06 relative error = 0.00080296382376402569759893039502275 % h = 1e-05 y1[1] (analytic) = -0.99499617542068921177005323609226 y1[1] (numeric) = -0.99499617542068921177005323609187 absolute error = 3.9e-31 relative error = 3.9196130561517596517030900322248e-29 % h = 1e-05 TOP MAIN SOLVE Loop x[1] = 0.10009 y2[1] (analytic) = -0.99499517624077281466606033500102 y2[1] (numeric) = -0.99498618765126974035068931281598 absolute error = 8.98858950307431537102218504e-06 relative error = 0.00090338020904125684068416139507436 % h = 1e-05 y1[1] (analytic) = -0.99499517624077281466606033500102 y1[1] (numeric) = -0.99499517624077281466606033500058 absolute error = 4.4e-31 relative error = 4.4221319912562780441464128511811e-29 % h = 1e-05 TOP MAIN SOLVE Loop x[1] = 0.1001 y2[1] (analytic) = -0.99499417696135689993881931509004 y2[1] (numeric) = -0.99498418914218764750252034915104 absolute error = 9.98781916925243629896593900e-06 relative error = 0.0010038067961115654211118326183209 % h = 1e-05 y1[1] (analytic) = -0.99499417696135689993881931509004 y1[1] (numeric) = -0.99499417696135689993881931508955 absolute error = 4.9e-31 relative error = 4.9246519361191234564721864478165e-29 % h = 1e-05 TOP MAIN SOLVE Loop x[1] = 0.10011 y2[1] (analytic) = -0.99499317758244156751627176699931 y2[1] (numeric) = -0.99498219043410666929755643473345 absolute error = 1.098714833489821871533226586e-05 relative error = 0.0011042435850257740078463143578353 % h = 1e-05 y1[1] (analytic) = -0.99499317758244156751627176699931 y1[1] (numeric) = -0.99499317758244156751627176699877 absolute error = 5.4e-31 relative error = 5.4271728908940939544209836807244e-29 % h = 1e-05 TOP MAIN SOLVE Loop x[1] = 0.10012 y2[1] (analytic) = -0.99499217810402691733630922313827 y2[1] (numeric) = -0.99498019152702700560660566571811 absolute error = 1.198657699991172970355742016e-05 relative error = 0.0012046905758347104547866644978991 % h = 1e-05 y1[1] (analytic) = -0.99499217810402691733630922313827 y1[1] (numeric) = -0.99499217810402691733630922313768 absolute error = 5.9e-31 relative error = 5.9296948557349886256220582006095e-29 % h = 1e-05 TOP MAIN SOLVE Loop x[1] = 0.10013 y2[1] (analytic) = -0.99499117852611304934677314769202 y2[1] (numeric) = -0.99497819242094885632037600680837 absolute error = 1.298610516419302639714088365e-05 relative error = 0.0013051477685892079008297333545632 % h = 1e-05 y1[1] (analytic) = -0.99499117852611304934677314769202 y1[1] (numeric) = -0.99499117852611304934677314769138 absolute error = 6.4e-31 relative error = 6.4322178307956075797261353975513e-29 % h = 1e-05 TOP MAIN SOLVE Loop x[1] = 0.10014 y2[1] (analytic) = -0.99499017884870006350545492662652 y2[1] (numeric) = -0.99497619311587242134947527126692 absolute error = 1.398573282764215597965535960e-05 relative error = 0.001405615163340104769933275303226 % h = 1e-05 y1[1] (analytic) = -0.99499017884870006350545492662652 y1[1] (numeric) = -0.99499017884870006350545492662584 absolute error = 6.8e-31 relative error = 6.8342383116467120652260573492196e-29 % h = 1e-05 TOP MAIN SOLVE Loop x[1] = 0.10015 y2[1] (analytic) = -0.99498917907178805978009585769285 y2[1] (numeric) = -0.99497419361179790062441110092476 absolute error = 1.498545999015915568475676809e-05 relative error = 0.0015060927601382447711790671863429 % h = 1e-05 y1[1] (analytic) = -0.99498917907178805978009585769285 y1[1] (numeric) = -0.99498917907178805978009585769212 absolute error = 7.3e-31 relative error = 7.3367632066210722120131506385381e-29 % h = 1e-05 TOP MAIN SOLVE Loop x[1] = 0.10016 y2[1] (analytic) = -0.99498817919537713814838714043039 y2[1] (numeric) = -0.99497219390872549409559094618815 absolute error = 1.598528665164405279619424224e-05 relative error = 0.001606580559034476898836033497391 % h = 1e-05 y1[1] (analytic) = -0.99498817919537713814838714043039 y1[1] (numeric) = -0.99498817919537713814838714042962 absolute error = 7.7e-31 relative error = 7.7387854056987929850471768265811e-29 % h = 1e-05 TOP MAIN SOLVE Loop x[1] = 0.10017 y2[1] (analytic) = -0.99498717921946739859796986616909 y2[1] (numeric) = -0.99497019400665540173332204604355 absolute error = 1.698521281199686464782012554e-05 relative error = 0.001707078560079655432423378357319 % h = 1e-05 y1[1] (analytic) = -0.99498717921946739859796986616909 y1[1] (numeric) = -0.99498717921946739859796986616827 absolute error = 8.2e-31 relative error = 8.2413122211610936202707772562961e-29 % h = 1e-05 TOP MAIN SOLVE Loop memory used=7.6MB, alloc=4.1MB, time=0.43 x[1] = 0.10018 y2[1] (analytic) = -0.99498617914405894112643500803067 y2[1] (numeric) = -0.99496819390558782352781140806061 absolute error = 1.798523847111759862359997006e-05 relative error = 0.0018075867633246399367737242615156 % h = 1e-05 y1[1] (analytic) = -0.99498617914405894112643500803067 y1[1] (numeric) = -0.9949861791440589411264350080298 absolute error = 8.7e-31 relative error = 8.7438400475916275630649066997365e-29 % h = 1e-05 TOP MAIN SOLVE Loop x[1] = 0.10019 y2[1] (analytic) = -0.99498517896915186574132341092889 y2[1] (numeric) = -0.99496619360552295948916578839312 absolute error = 1.898536362890625215762253577e-05 relative error = 0.0019081051688202952620962576205611 % h = 1e-05 y1[1] (analytic) = -0.99498517896915186574132341092889 y1[1] (numeric) = -0.99498517896915186574132341092797 absolute error = 9.2e-31 relative error = 9.2463688851442009557553199341760e-29 % h = 1e-05 TOP MAIN SOLVE Loop x[1] = 0.1002 y2[1] (analytic) = -0.99498417869474627246012578156879 y2[1] (numeric) = -0.99496419310646100964739167177803 absolute error = 1.998558828526281273410979076e-05 relative error = 0.0020086337766174915440398810738025 % h = 1e-05 y1[1] (analytic) = -0.99498417869474627246012578156879 y1[1] (numeric) = -0.99498417869474627246012578156782 absolute error = 9.7e-31 relative error = 9.7488987339726209636082094423616e-29 % h = 1e-05 Finished! Maximum Iterations Reached before Solution Completed! Iterations = 20 Total Elapsed Time = 0 Seconds Elapsed Time(since restart) = 0 Seconds Expected Time Remaining = 14 Minutes 5 Seconds Optimized Time Remaining = 13 Minutes 46 Seconds Time to Timeout = 14 Minutes 59 Seconds Percent Done = 0.0525 % > quit memory used=8.4MB, alloc=4.1MB, time=0.48