(%i1) batch(diffeq.max)
read and interpret file: /home/dennis/mastersource/mine/omnisode/diffeq.max
(%i2) load(stringproc)
(%o2) /usr/share/maxima/5.27.0/share/stringproc/stringproc.mac
(%i3) check_sign(x0, xf) := block([ret],
if xf > x0 then ret : 1.0 else ret : - 1.0, ret)
(%o3) check_sign(x0, xf) := block([ret],
if xf > x0 then ret : 1.0 else ret : - 1.0, ret)
(%i4) est_size_answer() := block([min_size], min_size : glob_large_float,
if omniabs(array_x2 ) < min_size then (min_size : omniabs(array_x2 ),
1 1
omniout_float(ALWAYS, "min_size", 32, min_size, 32, "")),
if omniabs(array_x1 ) < min_size then (min_size : omniabs(array_x1 ),
1 1
omniout_float(ALWAYS, "min_size", 32, min_size, 32, "")),
if min_size < 1.0 then (min_size : 1.0,
omniout_float(ALWAYS, "min_size", 32, min_size, 32, "")), min_size)
(%o4) est_size_answer() := block([min_size], min_size : glob_large_float,
if omniabs(array_x2 ) < min_size then (min_size : omniabs(array_x2 ),
1 1
omniout_float(ALWAYS, "min_size", 32, min_size, 32, "")),
if omniabs(array_x1 ) < min_size then (min_size : omniabs(array_x1 ),
1 1
omniout_float(ALWAYS, "min_size", 32, min_size, 32, "")),
if min_size < 1.0 then (min_size : 1.0,
omniout_float(ALWAYS, "min_size", 32, min_size, 32, "")), min_size)
(%i5) test_suggested_h() := block([max_value3, hn_div_ho, hn_div_ho_2,
hn_div_ho_3, value3, no_terms], max_value3 : 0.0, no_terms : glob_max_terms,
hn_div_ho : 0.5, hn_div_ho_2 : 0.25, hn_div_ho_3 : 0.125,
omniout_float(ALWAYS, "hn_div_ho", 32, hn_div_ho, 32, ""),
omniout_float(ALWAYS, "hn_div_ho_2", 32, hn_div_ho_2, 32, ""),
omniout_float(ALWAYS, "hn_div_ho_3", 32, hn_div_ho_3, 32, ""),
value3 : omniabs(array_x2 hn_div_ho_3
no_terms
+ array_x2 hn_div_ho_2 + array_x2 hn_div_ho
no_terms - 1 no_terms - 2
+ array_x2 ), if value3 > max_value3
no_terms - 3
then (max_value3 : value3, omniout_float(ALWAYS, "value3", 32, value3, 32,
"")), value3 : omniabs(array_x1 hn_div_ho_3
no_terms
+ array_x1 hn_div_ho_2 + array_x1 hn_div_ho
no_terms - 1 no_terms - 2
+ array_x1 ), if value3 > max_value3
no_terms - 3
then (max_value3 : value3, omniout_float(ALWAYS, "value3", 32, value3, 32,
"")), omniout_float(ALWAYS, "max_value3", 32, max_value3, 32, ""), max_value3)
(%o5) test_suggested_h() := block([max_value3, hn_div_ho, hn_div_ho_2,
hn_div_ho_3, value3, no_terms], max_value3 : 0.0, no_terms : glob_max_terms,
hn_div_ho : 0.5, hn_div_ho_2 : 0.25, hn_div_ho_3 : 0.125,
omniout_float(ALWAYS, "hn_div_ho", 32, hn_div_ho, 32, ""),
omniout_float(ALWAYS, "hn_div_ho_2", 32, hn_div_ho_2, 32, ""),
omniout_float(ALWAYS, "hn_div_ho_3", 32, hn_div_ho_3, 32, ""),
value3 : omniabs(array_x2 hn_div_ho_3
no_terms
+ array_x2 hn_div_ho_2 + array_x2 hn_div_ho
no_terms - 1 no_terms - 2
+ array_x2 ), if value3 > max_value3
no_terms - 3
then (max_value3 : value3, omniout_float(ALWAYS, "value3", 32, value3, 32,
"")), value3 : omniabs(array_x1 hn_div_ho_3
no_terms
+ array_x1 hn_div_ho_2 + array_x1 hn_div_ho
no_terms - 1 no_terms - 2
+ array_x1 ), if value3 > max_value3
no_terms - 3
then (max_value3 : value3, omniout_float(ALWAYS, "value3", 32, value3, 32,
"")), omniout_float(ALWAYS, "max_value3", 32, max_value3, 32, ""), max_value3)
(%i6) reached_interval() := block([ret],
if glob_check_sign array_t >= glob_check_sign glob_next_display
1
then ret : true else ret : false, return(ret))
(%o6) reached_interval() := block([ret],
if glob_check_sign array_t >= glob_check_sign glob_next_display
1
then ret : true else ret : false, return(ret))
(%i7) display_alot(iter) := block([abserr, analytic_val_y, ind_var,
numeric_val, relerr, term_no], if reached_interval()
then (if iter >= 0 then (ind_var : array_t ,
1
omniout_float(ALWAYS, "t[1] ", 33, ind_var, 20,
" "), analytic_val_y : exact_soln_x2(ind_var),
omniout_float(ALWAYS, "x2[1] (analytic) ", 33, analytic_val_y,
20, " "), term_no : 1, numeric_val : array_x2 ,
term_no
abserr : omniabs(numeric_val - analytic_val_y),
omniout_float(ALWAYS, "x2[1] (numeric) ", 33, numeric_val,
20, " "), if omniabs(analytic_val_y) # 0.0
abserr 100.0
then (relerr : -----------------------,
omniabs(analytic_val_y)
if relerr > 1.0E-34 then glob_good_digits : 2 - floor(log10(relerr))
else glob_good_digits : 16) else (relerr : - 1.0, glob_good_digits : - 1),
if glob_iter = 1 then array_1st_rel_error : relerr
1
else array_last_rel_error : relerr, omniout_float(ALWAYS,
1
"absolute error ", 4, abserr, 20, " "),
omniout_float(ALWAYS, "relative error ", 4, relerr, 20,
"%"), omniout_int(INFO, "Correct digits ", 32,
glob_good_digits, 4, " "), omniout_float(ALWAYS,
"h ", 4, glob_h, 20, " "),
analytic_val_y : exact_soln_x1(ind_var),
omniout_float(ALWAYS, "x1[1] (analytic) ", 33, analytic_val_y,
20, " "), term_no : 1, numeric_val : array_x1 ,
term_no
abserr : omniabs(numeric_val - analytic_val_y),
omniout_float(ALWAYS, "x1[1] (numeric) ", 33, numeric_val,
20, " "), if omniabs(analytic_val_y) # 0.0
abserr 100.0
then (relerr : -----------------------,
omniabs(analytic_val_y)
if relerr > 1.0E-34 then glob_good_digits : 2 - floor(log10(relerr))
else glob_good_digits : 16) else (relerr : - 1.0, glob_good_digits : - 1),
if glob_iter = 1 then array_1st_rel_error : relerr
2
else array_last_rel_error : relerr, omniout_float(ALWAYS,
2
"absolute error ", 4, abserr, 20, " "),
omniout_float(ALWAYS, "relative error ", 4, relerr, 20,
"%"), omniout_int(INFO, "Correct digits ", 32,
glob_good_digits, 4, " "), omniout_float(ALWAYS,
"h ", 4, glob_h, 20, " "))))
(%o7) display_alot(iter) := block([abserr, analytic_val_y, ind_var,
numeric_val, relerr, term_no], if reached_interval()
then (if iter >= 0 then (ind_var : array_t ,
1
omniout_float(ALWAYS, "t[1] ", 33, ind_var, 20,
" "), analytic_val_y : exact_soln_x2(ind_var),
omniout_float(ALWAYS, "x2[1] (analytic) ", 33, analytic_val_y,
20, " "), term_no : 1, numeric_val : array_x2 ,
term_no
abserr : omniabs(numeric_val - analytic_val_y),
omniout_float(ALWAYS, "x2[1] (numeric) ", 33, numeric_val,
20, " "), if omniabs(analytic_val_y) # 0.0
abserr 100.0
then (relerr : -----------------------,
omniabs(analytic_val_y)
if relerr > 1.0E-34 then glob_good_digits : 2 - floor(log10(relerr))
else glob_good_digits : 16) else (relerr : - 1.0, glob_good_digits : - 1),
if glob_iter = 1 then array_1st_rel_error : relerr
1
else array_last_rel_error : relerr, omniout_float(ALWAYS,
1
"absolute error ", 4, abserr, 20, " "),
omniout_float(ALWAYS, "relative error ", 4, relerr, 20,
"%"), omniout_int(INFO, "Correct digits ", 32,
glob_good_digits, 4, " "), omniout_float(ALWAYS,
"h ", 4, glob_h, 20, " "),
analytic_val_y : exact_soln_x1(ind_var),
omniout_float(ALWAYS, "x1[1] (analytic) ", 33, analytic_val_y,
20, " "), term_no : 1, numeric_val : array_x1 ,
term_no
abserr : omniabs(numeric_val - analytic_val_y),
omniout_float(ALWAYS, "x1[1] (numeric) ", 33, numeric_val,
20, " "), if omniabs(analytic_val_y) # 0.0
abserr 100.0
then (relerr : -----------------------,
omniabs(analytic_val_y)
if relerr > 1.0E-34 then glob_good_digits : 2 - floor(log10(relerr))
else glob_good_digits : 16) else (relerr : - 1.0, glob_good_digits : - 1),
if glob_iter = 1 then array_1st_rel_error : relerr
2
else array_last_rel_error : relerr, omniout_float(ALWAYS,
2
"absolute error ", 4, abserr, 20, " "),
omniout_float(ALWAYS, "relative error ", 4, relerr, 20,
"%"), omniout_int(INFO, "Correct digits ", 32,
glob_good_digits, 4, " "), omniout_float(ALWAYS,
"h ", 4, glob_h, 20, " "))))
(%i8) adjust_for_pole(h_param) := block([hnew, sz2, tmp],
block(hnew : h_param, glob_normmax : glob_small_float,
if omniabs(array_x2_higher ) > glob_small_float
1, 1
then (tmp : omniabs(array_x2_higher ),
1, 1
if tmp < glob_normmax then glob_normmax : tmp),
if omniabs(array_x1_higher ) > glob_small_float
1, 1
then (tmp : omniabs(array_x1_higher ),
1, 1
if tmp < glob_normmax then glob_normmax : tmp),
if glob_look_poles and (omniabs(array_pole ) > glob_small_float)
1
array_pole
1
and (array_pole # glob_large_float) then (sz2 : -----------,
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"),
return(hnew))), 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_t ), hnew : sz2), return(hnew))
1
(%o8) adjust_for_pole(h_param) := block([hnew, sz2, tmp],
block(hnew : h_param, glob_normmax : glob_small_float,
if omniabs(array_x2_higher ) > glob_small_float
1, 1
then (tmp : omniabs(array_x2_higher ),
1, 1
if tmp < glob_normmax then glob_normmax : tmp),
if omniabs(array_x1_higher ) > glob_small_float
1, 1
then (tmp : omniabs(array_x1_higher ),
1, 1
if tmp < glob_normmax then glob_normmax : tmp),
if glob_look_poles and (omniabs(array_pole ) > glob_small_float)
1
array_pole
1
and (array_pole # glob_large_float) then (sz2 : -----------,
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"),
return(hnew))), 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_t ), hnew : sz2), return(hnew))
1
(%i9) prog_report(t_start, t_end) := block([clock_sec, opt_clock_sec,
clock_sec1, expect_sec, left_sec, percent_done, total_clock_sec],
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(clock_sec1) + convfloat(glob_orig_start_sec)
+ convfloat(glob_max_sec), expect_sec :
comp_expect_sec(convfloat(t_end), convfloat(t_start),
convfloat(glob_h) + convfloat(array_t ),
1
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(t_end),
convfloat(t_start), convfloat(glob_h) + convfloat(array_t ),
1
convfloat(opt_clock_sec)), glob_total_exp_sec :
total_clock_sec + glob_optimal_expect_sec,
percent_done : comp_percent(convfloat(t_end), convfloat(t_start),
convfloat(glob_h) + convfloat(array_t )), glob_percent_done : percent_done,
1
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)),
omniout_str_noeol(INFO, "Expected Total Time "),
omniout_timestr(convfloat(glob_total_exp_sec))),
omniout_str_noeol(INFO, "Time to Timeout "),
omniout_timestr(convfloat(left_sec)), omniout_float(INFO,
"Percent Done ", 33, percent_done, 4, "%"))
(%o9) prog_report(t_start, t_end) := block([clock_sec, opt_clock_sec,
clock_sec1, expect_sec, left_sec, percent_done, total_clock_sec],
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(clock_sec1) + convfloat(glob_orig_start_sec)
+ convfloat(glob_max_sec), expect_sec :
comp_expect_sec(convfloat(t_end), convfloat(t_start),
convfloat(glob_h) + convfloat(array_t ),
1
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(t_end),
convfloat(t_start), convfloat(glob_h) + convfloat(array_t ),
1
convfloat(opt_clock_sec)), glob_total_exp_sec :
total_clock_sec + glob_optimal_expect_sec,
percent_done : comp_percent(convfloat(t_end), convfloat(t_start),
convfloat(glob_h) + convfloat(array_t )), glob_percent_done : percent_done,
1
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)),
omniout_str_noeol(INFO, "Expected Total Time "),
omniout_timestr(convfloat(glob_total_exp_sec))),
omniout_str_noeol(INFO, "Time to Timeout "),
omniout_timestr(convfloat(left_sec)), omniout_float(INFO,
"Percent Done ", 33, percent_done, 4, "%"))
(%i10) check_for_pole() := block([cnt, dr1, dr2, ds1, ds2, hdrc, hdrc_BBB, m,
n, nr1, nr2, ord_no, rad_c, rcs, rm0, rm1, rm2, rm3, rm4, found_sing, h_new,
ratio, term], n : glob_max_terms, m : - 1 - 2 + n,
while (m >= 10) and ((omniabs(array_x2_higher ) < glob_small_float glob_small_float)
1, m
or (omniabs(array_x2_higher ) < glob_small_float glob_small_float)
1, m - 1
or (omniabs(array_x2_higher ) < glob_small_float glob_small_float)) do m
1, m - 2
array_x2_higher
1, m
: m - 1, if m > 10 then (rm0 : -----------------------,
array_x2_higher
1, m - 1
array_x2_higher
1, m - 1
rm1 : -----------------------, hdrc : convfloat(m) rm0 - convfloat(m - 1) rm1,
array_x2_higher
1, m - 2
if omniabs(hdrc) > glob_small_float glob_small_float
glob_h
then (rcs : ------, ord_no :
hdrc
rm1 convfloat((m - 2) (m - 2)) - rm0 convfloat(m - 3)
-----------------------------------------------------,
hdrc
array_real_pole : rcs, array_real_pole : ord_no)
1, 1 1, 2
else (array_real_pole : glob_large_float,
1, 1
array_real_pole : glob_large_float))
1, 2
else (array_real_pole : glob_large_float,
1, 1
array_real_pole : glob_large_float), n : glob_max_terms, m : - 1 - 1 + n,
1, 2
while (m >= 10) and ((omniabs(array_x1_higher ) < glob_small_float glob_small_float)
1, m
or (omniabs(array_x1_higher ) < glob_small_float glob_small_float)
1, m - 1
or (omniabs(array_x1_higher ) < glob_small_float glob_small_float)) do m
1, m - 2
array_x1_higher
1, m
: m - 1, if m > 10 then (rm0 : -----------------------,
array_x1_higher
1, m - 1
array_x1_higher
1, m - 1
rm1 : -----------------------, hdrc : convfloat(m) rm0 - convfloat(m - 1) rm1,
array_x1_higher
1, m - 2
if omniabs(hdrc) > glob_small_float glob_small_float
glob_h
then (rcs : ------, ord_no :
hdrc
rm1 convfloat((m - 2) (m - 2)) - rm0 convfloat(m - 3)
-----------------------------------------------------,
hdrc
array_real_pole : rcs, array_real_pole : ord_no)
2, 1 2, 2
else (array_real_pole : glob_large_float,
2, 1
array_real_pole : glob_large_float))
2, 2
else (array_real_pole : glob_large_float,
2, 1
array_real_pole : glob_large_float), n : - 1 - 2 + glob_max_terms,
2, 2
cnt : 0, while (cnt < 5) and (n >= 10) do (if omniabs(array_x2_higher ) >
1, n
glob_small_float then cnt : 1 + cnt else cnt : 0, n : n - 1), m : cnt + n,
if m <= 10 then (rad_c : glob_large_float, ord_no : glob_large_float)
elseif ((omniabs(array_x2_higher ) >= glob_large_float)
1, m
or (omniabs(array_x2_higher ) >= glob_large_float)
1, m - 1
or (omniabs(array_x2_higher ) >= glob_large_float)
1, m - 2
or (omniabs(array_x2_higher ) >= glob_large_float)
1, m - 3
or (omniabs(array_x2_higher ) >= glob_large_float)
1, m - 4
or (omniabs(array_x2_higher ) >= glob_large_float))
1, m - 5
or ((omniabs(array_x2_higher ) <= glob_small_float) or (omniabs(array_x2_higher ) <= glob_small_float) or (omniabs(array_x2_higher ) <= glob_small_float) or (omniabs(array_x2_higher ) <= glob_small_float) or (omniabs(array_x2_higher ) <= glob_small_float) or (omniabs(array_x2_higher ) <= glob_small_float))
1, m 1, m - 1 1, m - 2 1, m - 3 1, m - 4 1, m - 5
then (rad_c : glob_large_float, ord_no : glob_large_float)
array_x2_higher array_x2_higher
1, m 1, m - 1
else (rm0 : -----------------------, rm1 : -----------------------,
array_x2_higher array_x2_higher
1, m - 1 1, m - 2
array_x2_higher array_x2_higher
1, m - 2 1, m - 3
rm2 : -----------------------, rm3 : -----------------------,
array_x2_higher array_x2_higher
1, m - 3 1, m - 4
array_x2_higher
1, m - 4
rm4 : -----------------------, nr1 : convfloat(m - 3) rm2
array_x2_higher
1, m - 5
- 2.0 convfloat(m - 2) rm1 + convfloat(m - 1) rm0,
nr2 : convfloat(m - 4) rm3 - 2.0 convfloat(m - 3) rm2 + convfloat(m - 2) rm1,
- 1.0 2.0 - 1.0 - 1.0 2.0 - 1.0 5.0 8.0 3.0
dr1 : ----- + --- + -----, dr2 : ----- + --- + -----, ds1 : --- - --- + ---,
rm3 rm2 rm1 rm4 rm3 rm2 rm3 rm2 rm1
5.0 8.0 3.0
ds2 : --- - --- + ---, if (omniabs(nr1 dr2 - nr2 dr1) <= glob_small_float)
rm4 rm3 rm2
or (omniabs(dr1) <= glob_small_float) then (rad_c : glob_large_float,
ord_no : glob_large_float) else (if omniabs(nr1 dr2 - nr2 dr1) >
dr1 dr2 - ds2 dr1 + ds1 dr2
glob_small_float then (rcs : ---------------------------,
nr1 dr2 - nr2 dr1
rcs nr1 - ds1 convfloat(m)
ord_no : ------------- - ------------,
2.0 dr1 2.0
if omniabs(rcs) > glob_small_float then (if rcs > 0.0
then rad_c : sqrt(rcs) omniabs(glob_h) else rad_c : glob_large_float)
else (rad_c : glob_large_float, ord_no : glob_large_float))
else (rad_c : glob_large_float, ord_no : glob_large_float)),
array_complex_pole : rad_c, array_complex_pole : ord_no),
1, 1 1, 2
n : - 1 - 1 + glob_max_terms, cnt : 0,
while (cnt < 5) and (n >= 10) do (if omniabs(array_x1_higher ) >
1, n
glob_small_float then cnt : 1 + cnt else cnt : 0, n : n - 1), m : cnt + n,
if m <= 10 then (rad_c : glob_large_float, ord_no : glob_large_float)
elseif ((omniabs(array_x1_higher ) >= glob_large_float)
1, m
or (omniabs(array_x1_higher ) >= glob_large_float)
1, m - 1
or (omniabs(array_x1_higher ) >= glob_large_float)
1, m - 2
or (omniabs(array_x1_higher ) >= glob_large_float)
1, m - 3
or (omniabs(array_x1_higher ) >= glob_large_float)
1, m - 4
or (omniabs(array_x1_higher ) >= glob_large_float))
1, m - 5
or ((omniabs(array_x1_higher ) <= glob_small_float) or (omniabs(array_x1_higher ) <= glob_small_float) or (omniabs(array_x1_higher ) <= glob_small_float) or (omniabs(array_x1_higher ) <= glob_small_float) or (omniabs(array_x1_higher ) <= glob_small_float) or (omniabs(array_x1_higher ) <= glob_small_float))
1, m 1, m - 1 1, m - 2 1, m - 3 1, m - 4 1, m - 5
then (rad_c : glob_large_float, ord_no : glob_large_float)
array_x1_higher array_x1_higher
1, m 1, m - 1
else (rm0 : -----------------------, rm1 : -----------------------,
array_x1_higher array_x1_higher
1, m - 1 1, m - 2
array_x1_higher array_x1_higher
1, m - 2 1, m - 3
rm2 : -----------------------, rm3 : -----------------------,
array_x1_higher array_x1_higher
1, m - 3 1, m - 4
array_x1_higher
1, m - 4
rm4 : -----------------------, nr1 : convfloat(m - 3) rm2
array_x1_higher
1, m - 5
- 2.0 convfloat(m - 2) rm1 + convfloat(m - 1) rm0,
nr2 : convfloat(m - 4) rm3 - 2.0 convfloat(m - 3) rm2 + convfloat(m - 2) rm1,
- 1.0 2.0 - 1.0 - 1.0 2.0 - 1.0 5.0 8.0 3.0
dr1 : ----- + --- + -----, dr2 : ----- + --- + -----, ds1 : --- - --- + ---,
rm3 rm2 rm1 rm4 rm3 rm2 rm3 rm2 rm1
5.0 8.0 3.0
ds2 : --- - --- + ---, if (omniabs(nr1 dr2 - nr2 dr1) <= glob_small_float)
rm4 rm3 rm2
or (omniabs(dr1) <= glob_small_float) then (rad_c : glob_large_float,
ord_no : glob_large_float) else (if omniabs(nr1 dr2 - nr2 dr1) >
dr1 dr2 - ds2 dr1 + ds1 dr2
glob_small_float then (rcs : ---------------------------,
nr1 dr2 - nr2 dr1
rcs nr1 - ds1 convfloat(m)
ord_no : ------------- - ------------,
2.0 dr1 2.0
if omniabs(rcs) > glob_small_float then (if rcs > 0.0
then rad_c : sqrt(rcs) omniabs(glob_h) else rad_c : glob_large_float)
else (rad_c : glob_large_float, ord_no : glob_large_float))
else (rad_c : glob_large_float, ord_no : glob_large_float)),
array_complex_pole : rad_c, array_complex_pole : ord_no),
2, 1 2, 2
found_sing : 0, if (1 # found_sing) and ((array_real_pole = glob_large_float)
1, 1
or (array_real_pole = glob_large_float))
1, 2
and ((array_complex_pole # glob_large_float) and (array_complex_pole # glob_large_float))
1, 1 1, 2
and ((array_complex_pole > 0.0) and (array_complex_pole > 0.0))
1, 1 1, 2
then (array_poles : array_complex_pole ,
1, 1 1, 1
array_poles : array_complex_pole , found_sing : 1,
1, 2 1, 2
array_type_pole : 2, if glob_display_flag
1
then (if reached_interval() then omniout_str(ALWAYS,
"Complex estimate of poles used for equation 1"))),
if (1 # found_sing) and ((array_real_pole # glob_large_float)
1, 1
and (array_real_pole # glob_large_float) and (array_real_pole > 0.0)
1, 2 1, 1
and (array_real_pole > - 1.0 glob_smallish_float)
1, 2
and ((array_complex_pole = glob_large_float) or (array_complex_pole = glob_large_float) or (array_complex_pole <= 0.0) or (array_complex_pole <= 0.0)))
1, 1 1, 2 1, 1 1, 2
then (array_poles : array_real_pole ,
1, 1 1, 1
array_poles : array_real_pole , found_sing : 1, array_type_pole : 1,
1, 2 1, 2 1
if glob_display_flag then (if reached_interval()
then omniout_str(ALWAYS, "Real estimate of pole used for equation 1"))),
if (1 # found_sing) and (((array_real_pole = glob_large_float)
1, 1
or (array_real_pole = glob_large_float))
1, 2
and ((array_complex_pole = glob_large_float) or (array_complex_pole = glob_large_float)))
1, 1 1, 2
then (array_poles : glob_large_float, array_poles : glob_large_float,
1, 1 1, 2
found_sing : 1, array_type_pole : 3, if reached_interval()
1
then omniout_str(ALWAYS, "NO POLE for equation 1")),
if (1 # found_sing) and ((array_real_pole < array_complex_pole )
1, 1 1, 1
and (array_real_pole > 0.0) and (array_real_pole > - 1.0
1, 1 1, 2
glob_smallish_float))
then (array_poles : array_real_pole ,
1, 1 1, 1
array_poles : array_real_pole , found_sing : 1, array_type_pole : 1,
1, 2 1, 2 1
if glob_display_flag then (if reached_interval()
then omniout_str(ALWAYS, "Real estimate of pole used for equation 1"))),
if (1 # found_sing) and ((array_complex_pole # glob_large_float)
1, 1
and (array_complex_pole # glob_large_float)
1, 2
and (array_complex_pole > 0.0) and (array_complex_pole >
1, 1 1, 2
0.0))
then (array_poles : array_complex_pole ,
1, 1 1, 1
array_poles : array_complex_pole , array_type_pole : 2,
1, 2 1, 2 1
found_sing : 1, if glob_display_flag then (if reached_interval()
then omniout_str(ALWAYS, "Complex estimate of poles used for equation 1"))),
if 1 # found_sing then (array_poles : glob_large_float,
1, 1
array_poles : glob_large_float, array_type_pole : 3,
1, 2 1
if reached_interval() then omniout_str(ALWAYS, "NO POLE for equation 1")),
if (2 # found_sing) and ((array_real_pole = glob_large_float)
2, 1
or (array_real_pole = glob_large_float))
2, 2
and ((array_complex_pole # glob_large_float) and (array_complex_pole # glob_large_float))
2, 1 2, 2
and ((array_complex_pole > 0.0) and (array_complex_pole > 0.0))
2, 1 2, 2
then (array_poles : array_complex_pole ,
2, 1 2, 1
array_poles : array_complex_pole , found_sing : 2,
2, 2 2, 2
array_type_pole : 2, if glob_display_flag
2
then (if reached_interval() then omniout_str(ALWAYS,
"Complex estimate of poles used for equation 2"))),
if (2 # found_sing) and ((array_real_pole # glob_large_float)
2, 1
and (array_real_pole # glob_large_float) and (array_real_pole > 0.0)
2, 2 2, 1
and (array_real_pole > - 1.0 glob_smallish_float)
2, 2
and ((array_complex_pole = glob_large_float) or (array_complex_pole = glob_large_float) or (array_complex_pole <= 0.0) or (array_complex_pole <= 0.0)))
2, 1 2, 2 2, 1 2, 2
then (array_poles : array_real_pole ,
2, 1 2, 1
array_poles : array_real_pole , found_sing : 2, array_type_pole : 1,
2, 2 2, 2 2
if glob_display_flag then (if reached_interval()
then omniout_str(ALWAYS, "Real estimate of pole used for equation 2"))),
if (2 # found_sing) and (((array_real_pole = glob_large_float)
2, 1
or (array_real_pole = glob_large_float))
2, 2
and ((array_complex_pole = glob_large_float) or (array_complex_pole = glob_large_float)))
2, 1 2, 2
then (array_poles : glob_large_float, array_poles : glob_large_float,
2, 1 2, 2
found_sing : 2, array_type_pole : 3, if reached_interval()
2
then omniout_str(ALWAYS, "NO POLE for equation 2")),
if (2 # found_sing) and ((array_real_pole < array_complex_pole )
2, 1 2, 1
and (array_real_pole > 0.0) and (array_real_pole > - 1.0
2, 1 2, 2
glob_smallish_float))
then (array_poles : array_real_pole ,
2, 1 2, 1
array_poles : array_real_pole , found_sing : 2, array_type_pole : 1,
2, 2 2, 2 2
if glob_display_flag then (if reached_interval()
then omniout_str(ALWAYS, "Real estimate of pole used for equation 2"))),
if (2 # found_sing) and ((array_complex_pole # glob_large_float)
2, 1
and (array_complex_pole # glob_large_float)
2, 2
and (array_complex_pole > 0.0) and (array_complex_pole >
2, 1 2, 2
0.0))
then (array_poles : array_complex_pole ,
2, 1 2, 1
array_poles : array_complex_pole , array_type_pole : 2,
2, 2 2, 2 2
found_sing : 2, if glob_display_flag then (if reached_interval()
then omniout_str(ALWAYS, "Complex estimate of poles used for equation 2"))),
if 2 # found_sing then (array_poles : glob_large_float,
2, 1
array_poles : glob_large_float, array_type_pole : 3,
2, 2 2
if reached_interval() then omniout_str(ALWAYS, "NO POLE for equation 2")),
array_pole : glob_large_float, array_pole : glob_large_float,
1 2
if array_pole > array_poles then (array_pole : array_poles ,
1 1, 1 1 1, 1
array_pole : array_poles ), if array_pole > array_poles
2 1, 2 1 2, 1
then (array_pole : array_poles , array_pole : array_poles ),
1 2, 1 2 2, 2
if array_pole glob_ratio_of_radius < omniabs(glob_h)
1
then (h_new : array_pole glob_ratio_of_radius, term : 1, ratio : 1.0,
1
while term <= glob_max_terms do (array_x2 : array_x2 ratio,
term term
array_x2_higher : array_x2_higher ratio,
1, term 1, term
array_t : array_t ratio, array_x1 : array_x1 ratio,
term term term term
array_x1_higher : array_x1_higher ratio,
1, term 1, term
ratio h_new
array_t : array_t ratio, ratio : ---------------, term : 1 + term),
term term omniabs(glob_h)
glob_h : h_new), if reached_interval() then display_pole())
(%o10) check_for_pole() := block([cnt, dr1, dr2, ds1, ds2, hdrc, hdrc_BBB, m,
n, nr1, nr2, ord_no, rad_c, rcs, rm0, rm1, rm2, rm3, rm4, found_sing, h_new,
ratio, term], n : glob_max_terms, m : - 1 - 2 + n,
while (m >= 10) and ((omniabs(array_x2_higher ) < glob_small_float glob_small_float)
1, m
or (omniabs(array_x2_higher ) < glob_small_float glob_small_float)
1, m - 1
or (omniabs(array_x2_higher ) < glob_small_float glob_small_float)) do m
1, m - 2
array_x2_higher
1, m
: m - 1, if m > 10 then (rm0 : -----------------------,
array_x2_higher
1, m - 1
array_x2_higher
1, m - 1
rm1 : -----------------------, hdrc : convfloat(m) rm0 - convfloat(m - 1) rm1,
array_x2_higher
1, m - 2
if omniabs(hdrc) > glob_small_float glob_small_float
glob_h
then (rcs : ------, ord_no :
hdrc
rm1 convfloat((m - 2) (m - 2)) - rm0 convfloat(m - 3)
-----------------------------------------------------,
hdrc
array_real_pole : rcs, array_real_pole : ord_no)
1, 1 1, 2
else (array_real_pole : glob_large_float,
1, 1
array_real_pole : glob_large_float))
1, 2
else (array_real_pole : glob_large_float,
1, 1
array_real_pole : glob_large_float), n : glob_max_terms, m : - 1 - 1 + n,
1, 2
while (m >= 10) and ((omniabs(array_x1_higher ) < glob_small_float glob_small_float)
1, m
or (omniabs(array_x1_higher ) < glob_small_float glob_small_float)
1, m - 1
or (omniabs(array_x1_higher ) < glob_small_float glob_small_float)) do m
1, m - 2
array_x1_higher
1, m
: m - 1, if m > 10 then (rm0 : -----------------------,
array_x1_higher
1, m - 1
array_x1_higher
1, m - 1
rm1 : -----------------------, hdrc : convfloat(m) rm0 - convfloat(m - 1) rm1,
array_x1_higher
1, m - 2
if omniabs(hdrc) > glob_small_float glob_small_float
glob_h
then (rcs : ------, ord_no :
hdrc
rm1 convfloat((m - 2) (m - 2)) - rm0 convfloat(m - 3)
-----------------------------------------------------,
hdrc
array_real_pole : rcs, array_real_pole : ord_no)
2, 1 2, 2
else (array_real_pole : glob_large_float,
2, 1
array_real_pole : glob_large_float))
2, 2
else (array_real_pole : glob_large_float,
2, 1
array_real_pole : glob_large_float), n : - 1 - 2 + glob_max_terms,
2, 2
cnt : 0, while (cnt < 5) and (n >= 10) do (if omniabs(array_x2_higher ) >
1, n
glob_small_float then cnt : 1 + cnt else cnt : 0, n : n - 1), m : cnt + n,
if m <= 10 then (rad_c : glob_large_float, ord_no : glob_large_float)
elseif ((omniabs(array_x2_higher ) >= glob_large_float)
1, m
or (omniabs(array_x2_higher ) >= glob_large_float)
1, m - 1
or (omniabs(array_x2_higher ) >= glob_large_float)
1, m - 2
or (omniabs(array_x2_higher ) >= glob_large_float)
1, m - 3
or (omniabs(array_x2_higher ) >= glob_large_float)
1, m - 4
or (omniabs(array_x2_higher ) >= glob_large_float))
1, m - 5
or ((omniabs(array_x2_higher ) <= glob_small_float) or (omniabs(array_x2_higher ) <= glob_small_float) or (omniabs(array_x2_higher ) <= glob_small_float) or (omniabs(array_x2_higher ) <= glob_small_float) or (omniabs(array_x2_higher ) <= glob_small_float) or (omniabs(array_x2_higher ) <= glob_small_float))
1, m 1, m - 1 1, m - 2 1, m - 3 1, m - 4 1, m - 5
then (rad_c : glob_large_float, ord_no : glob_large_float)
array_x2_higher array_x2_higher
1, m 1, m - 1
else (rm0 : -----------------------, rm1 : -----------------------,
array_x2_higher array_x2_higher
1, m - 1 1, m - 2
array_x2_higher array_x2_higher
1, m - 2 1, m - 3
rm2 : -----------------------, rm3 : -----------------------,
array_x2_higher array_x2_higher
1, m - 3 1, m - 4
array_x2_higher
1, m - 4
rm4 : -----------------------, nr1 : convfloat(m - 3) rm2
array_x2_higher
1, m - 5
- 2.0 convfloat(m - 2) rm1 + convfloat(m - 1) rm0,
nr2 : convfloat(m - 4) rm3 - 2.0 convfloat(m - 3) rm2 + convfloat(m - 2) rm1,
- 1.0 2.0 - 1.0 - 1.0 2.0 - 1.0 5.0 8.0 3.0
dr1 : ----- + --- + -----, dr2 : ----- + --- + -----, ds1 : --- - --- + ---,
rm3 rm2 rm1 rm4 rm3 rm2 rm3 rm2 rm1
5.0 8.0 3.0
ds2 : --- - --- + ---, if (omniabs(nr1 dr2 - nr2 dr1) <= glob_small_float)
rm4 rm3 rm2
or (omniabs(dr1) <= glob_small_float) then (rad_c : glob_large_float,
ord_no : glob_large_float) else (if omniabs(nr1 dr2 - nr2 dr1) >
dr1 dr2 - ds2 dr1 + ds1 dr2
glob_small_float then (rcs : ---------------------------,
nr1 dr2 - nr2 dr1
rcs nr1 - ds1 convfloat(m)
ord_no : ------------- - ------------,
2.0 dr1 2.0
if omniabs(rcs) > glob_small_float then (if rcs > 0.0
then rad_c : sqrt(rcs) omniabs(glob_h) else rad_c : glob_large_float)
else (rad_c : glob_large_float, ord_no : glob_large_float))
else (rad_c : glob_large_float, ord_no : glob_large_float)),
array_complex_pole : rad_c, array_complex_pole : ord_no),
1, 1 1, 2
n : - 1 - 1 + glob_max_terms, cnt : 0,
while (cnt < 5) and (n >= 10) do (if omniabs(array_x1_higher ) >
1, n
glob_small_float then cnt : 1 + cnt else cnt : 0, n : n - 1), m : cnt + n,
if m <= 10 then (rad_c : glob_large_float, ord_no : glob_large_float)
elseif ((omniabs(array_x1_higher ) >= glob_large_float)
1, m
or (omniabs(array_x1_higher ) >= glob_large_float)
1, m - 1
or (omniabs(array_x1_higher ) >= glob_large_float)
1, m - 2
or (omniabs(array_x1_higher ) >= glob_large_float)
1, m - 3
or (omniabs(array_x1_higher ) >= glob_large_float)
1, m - 4
or (omniabs(array_x1_higher ) >= glob_large_float))
1, m - 5
or ((omniabs(array_x1_higher ) <= glob_small_float) or (omniabs(array_x1_higher ) <= glob_small_float) or (omniabs(array_x1_higher ) <= glob_small_float) or (omniabs(array_x1_higher ) <= glob_small_float) or (omniabs(array_x1_higher ) <= glob_small_float) or (omniabs(array_x1_higher ) <= glob_small_float))
1, m 1, m - 1 1, m - 2 1, m - 3 1, m - 4 1, m - 5
then (rad_c : glob_large_float, ord_no : glob_large_float)
array_x1_higher array_x1_higher
1, m 1, m - 1
else (rm0 : -----------------------, rm1 : -----------------------,
array_x1_higher array_x1_higher
1, m - 1 1, m - 2
array_x1_higher array_x1_higher
1, m - 2 1, m - 3
rm2 : -----------------------, rm3 : -----------------------,
array_x1_higher array_x1_higher
1, m - 3 1, m - 4
array_x1_higher
1, m - 4
rm4 : -----------------------, nr1 : convfloat(m - 3) rm2
array_x1_higher
1, m - 5
- 2.0 convfloat(m - 2) rm1 + convfloat(m - 1) rm0,
nr2 : convfloat(m - 4) rm3 - 2.0 convfloat(m - 3) rm2 + convfloat(m - 2) rm1,
- 1.0 2.0 - 1.0 - 1.0 2.0 - 1.0 5.0 8.0 3.0
dr1 : ----- + --- + -----, dr2 : ----- + --- + -----, ds1 : --- - --- + ---,
rm3 rm2 rm1 rm4 rm3 rm2 rm3 rm2 rm1
5.0 8.0 3.0
ds2 : --- - --- + ---, if (omniabs(nr1 dr2 - nr2 dr1) <= glob_small_float)
rm4 rm3 rm2
or (omniabs(dr1) <= glob_small_float) then (rad_c : glob_large_float,
ord_no : glob_large_float) else (if omniabs(nr1 dr2 - nr2 dr1) >
dr1 dr2 - ds2 dr1 + ds1 dr2
glob_small_float then (rcs : ---------------------------,
nr1 dr2 - nr2 dr1
rcs nr1 - ds1 convfloat(m)
ord_no : ------------- - ------------,
2.0 dr1 2.0
if omniabs(rcs) > glob_small_float then (if rcs > 0.0
then rad_c : sqrt(rcs) omniabs(glob_h) else rad_c : glob_large_float)
else (rad_c : glob_large_float, ord_no : glob_large_float))
else (rad_c : glob_large_float, ord_no : glob_large_float)),
array_complex_pole : rad_c, array_complex_pole : ord_no),
2, 1 2, 2
found_sing : 0, if (1 # found_sing) and ((array_real_pole = glob_large_float)
1, 1
or (array_real_pole = glob_large_float))
1, 2
and ((array_complex_pole # glob_large_float) and (array_complex_pole # glob_large_float))
1, 1 1, 2
and ((array_complex_pole > 0.0) and (array_complex_pole > 0.0))
1, 1 1, 2
then (array_poles : array_complex_pole ,
1, 1 1, 1
array_poles : array_complex_pole , found_sing : 1,
1, 2 1, 2
array_type_pole : 2, if glob_display_flag
1
then (if reached_interval() then omniout_str(ALWAYS,
"Complex estimate of poles used for equation 1"))),
if (1 # found_sing) and ((array_real_pole # glob_large_float)
1, 1
and (array_real_pole # glob_large_float) and (array_real_pole > 0.0)
1, 2 1, 1
and (array_real_pole > - 1.0 glob_smallish_float)
1, 2
and ((array_complex_pole = glob_large_float) or (array_complex_pole = glob_large_float) or (array_complex_pole <= 0.0) or (array_complex_pole <= 0.0)))
1, 1 1, 2 1, 1 1, 2
then (array_poles : array_real_pole ,
1, 1 1, 1
array_poles : array_real_pole , found_sing : 1, array_type_pole : 1,
1, 2 1, 2 1
if glob_display_flag then (if reached_interval()
then omniout_str(ALWAYS, "Real estimate of pole used for equation 1"))),
if (1 # found_sing) and (((array_real_pole = glob_large_float)
1, 1
or (array_real_pole = glob_large_float))
1, 2
and ((array_complex_pole = glob_large_float) or (array_complex_pole = glob_large_float)))
1, 1 1, 2
then (array_poles : glob_large_float, array_poles : glob_large_float,
1, 1 1, 2
found_sing : 1, array_type_pole : 3, if reached_interval()
1
then omniout_str(ALWAYS, "NO POLE for equation 1")),
if (1 # found_sing) and ((array_real_pole < array_complex_pole )
1, 1 1, 1
and (array_real_pole > 0.0) and (array_real_pole > - 1.0
1, 1 1, 2
glob_smallish_float))
then (array_poles : array_real_pole ,
1, 1 1, 1
array_poles : array_real_pole , found_sing : 1, array_type_pole : 1,
1, 2 1, 2 1
if glob_display_flag then (if reached_interval()
then omniout_str(ALWAYS, "Real estimate of pole used for equation 1"))),
if (1 # found_sing) and ((array_complex_pole # glob_large_float)
1, 1
and (array_complex_pole # glob_large_float)
1, 2
and (array_complex_pole > 0.0) and (array_complex_pole >
1, 1 1, 2
0.0))
then (array_poles : array_complex_pole ,
1, 1 1, 1
array_poles : array_complex_pole , array_type_pole : 2,
1, 2 1, 2 1
found_sing : 1, if glob_display_flag then (if reached_interval()
then omniout_str(ALWAYS, "Complex estimate of poles used for equation 1"))),
if 1 # found_sing then (array_poles : glob_large_float,
1, 1
array_poles : glob_large_float, array_type_pole : 3,
1, 2 1
if reached_interval() then omniout_str(ALWAYS, "NO POLE for equation 1")),
if (2 # found_sing) and ((array_real_pole = glob_large_float)
2, 1
or (array_real_pole = glob_large_float))
2, 2
and ((array_complex_pole # glob_large_float) and (array_complex_pole # glob_large_float))
2, 1 2, 2
and ((array_complex_pole > 0.0) and (array_complex_pole > 0.0))
2, 1 2, 2
then (array_poles : array_complex_pole ,
2, 1 2, 1
array_poles : array_complex_pole , found_sing : 2,
2, 2 2, 2
array_type_pole : 2, if glob_display_flag
2
then (if reached_interval() then omniout_str(ALWAYS,
"Complex estimate of poles used for equation 2"))),
if (2 # found_sing) and ((array_real_pole # glob_large_float)
2, 1
and (array_real_pole # glob_large_float) and (array_real_pole > 0.0)
2, 2 2, 1
and (array_real_pole > - 1.0 glob_smallish_float)
2, 2
and ((array_complex_pole = glob_large_float) or (array_complex_pole = glob_large_float) or (array_complex_pole <= 0.0) or (array_complex_pole <= 0.0)))
2, 1 2, 2 2, 1 2, 2
then (array_poles : array_real_pole ,
2, 1 2, 1
array_poles : array_real_pole , found_sing : 2, array_type_pole : 1,
2, 2 2, 2 2
if glob_display_flag then (if reached_interval()
then omniout_str(ALWAYS, "Real estimate of pole used for equation 2"))),
if (2 # found_sing) and (((array_real_pole = glob_large_float)
2, 1
or (array_real_pole = glob_large_float))
2, 2
and ((array_complex_pole = glob_large_float) or (array_complex_pole = glob_large_float)))
2, 1 2, 2
then (array_poles : glob_large_float, array_poles : glob_large_float,
2, 1 2, 2
found_sing : 2, array_type_pole : 3, if reached_interval()
2
then omniout_str(ALWAYS, "NO POLE for equation 2")),
if (2 # found_sing) and ((array_real_pole < array_complex_pole )
2, 1 2, 1
and (array_real_pole > 0.0) and (array_real_pole > - 1.0
2, 1 2, 2
glob_smallish_float))
then (array_poles : array_real_pole ,
2, 1 2, 1
array_poles : array_real_pole , found_sing : 2, array_type_pole : 1,
2, 2 2, 2 2
if glob_display_flag then (if reached_interval()
then omniout_str(ALWAYS, "Real estimate of pole used for equation 2"))),
if (2 # found_sing) and ((array_complex_pole # glob_large_float)
2, 1
and (array_complex_pole # glob_large_float)
2, 2
and (array_complex_pole > 0.0) and (array_complex_pole >
2, 1 2, 2
0.0))
then (array_poles : array_complex_pole ,
2, 1 2, 1
array_poles : array_complex_pole , array_type_pole : 2,
2, 2 2, 2 2
found_sing : 2, if glob_display_flag then (if reached_interval()
then omniout_str(ALWAYS, "Complex estimate of poles used for equation 2"))),
if 2 # found_sing then (array_poles : glob_large_float,
2, 1
array_poles : glob_large_float, array_type_pole : 3,
2, 2 2
if reached_interval() then omniout_str(ALWAYS, "NO POLE for equation 2")),
array_pole : glob_large_float, array_pole : glob_large_float,
1 2
if array_pole > array_poles then (array_pole : array_poles ,
1 1, 1 1 1, 1
array_pole : array_poles ), if array_pole > array_poles
2 1, 2 1 2, 1
then (array_pole : array_poles , array_pole : array_poles ),
1 2, 1 2 2, 2
if array_pole glob_ratio_of_radius < omniabs(glob_h)
1
then (h_new : array_pole glob_ratio_of_radius, term : 1, ratio : 1.0,
1
while term <= glob_max_terms do (array_x2 : array_x2 ratio,
term term
array_x2_higher : array_x2_higher ratio,
1, term 1, term
array_t : array_t ratio, array_x1 : array_x1 ratio,
term term term term
array_x1_higher : array_x1_higher ratio,
1, term 1, term
ratio h_new
array_t : array_t ratio, ratio : ---------------, term : 1 + term),
term term omniabs(glob_h)
glob_h : h_new), if reached_interval() then display_pole())
(%i11) get_norms() := block([iii], if not glob_initial_pass
then (iii : 1, while iii <= glob_max_terms do (array_norms : 0.0,
iii
iii : 1 + iii), iii : 1, while iii <=
glob_max_terms do (if omniabs(array_x2 ) > array_norms
iii iii
then array_norms : omniabs(array_x2 ), iii : 1 + iii), iii : 1,
iii iii
while iii <= glob_max_terms do (if omniabs(array_x1 ) > array_norms
iii iii
then array_norms : omniabs(array_x1 ), iii : 1 + iii)))
iii iii
(%o11) get_norms() := block([iii], if not glob_initial_pass
then (iii : 1, while iii <= glob_max_terms do (array_norms : 0.0,
iii
iii : 1 + iii), iii : 1, while iii <=
glob_max_terms do (if omniabs(array_x2 ) > array_norms
iii iii
then array_norms : omniabs(array_x2 ), iii : 1 + iii), iii : 1,
iii iii
while iii <= glob_max_terms do (if omniabs(array_x1 ) > array_norms
iii iii
then array_norms : omniabs(array_x1 ), iii : 1 + iii)))
iii iii
(%i12) atomall() := block([kkk, order_d, adj2, adj3, temporary, term, temp,
temp2], array_tmp1 : array_x2_higher ,
1 2, 1
array_tmp2 : array_const_3D0 array_tmp1 ,
1 1 1
array_tmp3 : array_tmp2 + array_const_0D0 ,
1 1 1
array_tmp4 : array_const_2D0 array_x2 ,
1 1 1
array_tmp5 : array_tmp3 - array_tmp4 , array_tmp6 : array_x1_higher ,
1 1 1 1 3, 1
array_tmp7 : array_tmp5 - array_tmp6 , array_tmp8 : array_x1_higher ,
1 1 1 1 2, 1
array_tmp9 : array_tmp7 - array_tmp8 ,
1 1 1
array_tmp10 : array_x1 + array_tmp9 ,
1 1 1
if not array_x2_set_initial then (if 1 <= glob_max_terms
1, 3
then (temporary : array_tmp10 expt(glob_h, 2) factorial_3(0, 2),
1
array_x2 : temporary, array_x2_higher : temporary,
3 1, 3
temporary 2.0
temporary : -------------, array_x2_higher : temporary,
glob_h 2, 2
temporary 1.0
temporary : -------------, array_x2_higher : temporary, 0)), kkk : 2,
glob_h 3, 1
array_tmp12 : array_const_4D0 array_x2 , array_tmp13 : array_x2_higher ,
1 1 1 1 2, 1
array_tmp14 : array_const_2D0 array_tmp13 ,
1 1 1
array_tmp15 : array_tmp12 - array_tmp14 ,
1 1 1
array_tmp16 : array_const_2D0 array_x1 ,
1 1 1
array_tmp17 : array_tmp15 - array_tmp16 ,
1 1 1
if not array_x1_set_initial then (if 1 <= glob_max_terms
2, 2
then (temporary : array_tmp17 expt(glob_h, 1) factorial_3(0, 1),
1
array_x1 : temporary, array_x1_higher : temporary,
2 1, 2
temporary 1.0
temporary : -------------, array_x1_higher : temporary, 0)), kkk : 2,
glob_h 2, 1
array_tmp1 : array_x2_higher , array_tmp2 : array_const_3D0 array_tmp1 ,
2 2, 2 2 1 2
array_tmp3 : array_tmp2 , array_tmp4 : array_const_2D0 array_x2 ,
2 2 2 1 2
array_tmp5 : array_tmp3 - array_tmp4 , array_tmp6 : array_x1_higher ,
2 2 2 2 3, 2
array_tmp7 : array_tmp5 - array_tmp6 , array_tmp8 : array_x1_higher ,
2 2 2 2 2, 2
array_tmp9 : array_tmp7 - array_tmp8 ,
2 2 2
array_tmp10 : array_x1 + array_tmp9 ,
2 2 2
if not array_x2_set_initial then (if 2 <= glob_max_terms
1, 4
then (temporary : array_tmp10 expt(glob_h, 2) factorial_3(1, 3),
2
array_x2 : temporary, array_x2_higher : temporary,
4 1, 4
temporary 3.0
temporary : -------------, array_x2_higher : temporary,
glob_h 2, 3
temporary 2.0
temporary : -------------, array_x2_higher : temporary, 0)), kkk : 3,
glob_h 3, 2
array_tmp12 : array_const_4D0 array_x2 , array_tmp13 : array_x2_higher ,
2 1 2 2 2, 2
array_tmp14 : array_const_2D0 array_tmp13 ,
2 1 2
array_tmp15 : array_tmp12 - array_tmp14 ,
2 2 2
array_tmp16 : array_const_2D0 array_x1 ,
2 1 2
array_tmp17 : array_tmp15 - array_tmp16 ,
2 2 2
if not array_x1_set_initial then (if 2 <= glob_max_terms
2, 3
then (temporary : array_tmp17 expt(glob_h, 1) factorial_3(1, 2),
2
array_x1 : temporary, array_x1_higher : temporary,
3 1, 3
temporary 2.0
temporary : -------------, array_x1_higher : temporary, 0)), kkk : 3,
glob_h 2, 2
array_tmp1 : array_x2_higher , array_tmp2 : array_const_3D0 array_tmp1 ,
3 2, 3 3 1 3
array_tmp3 : array_tmp2 , array_tmp4 : array_const_2D0 array_x2 ,
3 3 3 1 3
array_tmp5 : array_tmp3 - array_tmp4 , array_tmp6 : array_x1_higher ,
3 3 3 3 3, 3
array_tmp7 : array_tmp5 - array_tmp6 , array_tmp8 : array_x1_higher ,
3 3 3 3 2, 3
array_tmp9 : array_tmp7 - array_tmp8 ,
3 3 3
array_tmp10 : array_x1 + array_tmp9 ,
3 3 3
if not array_x2_set_initial then (if 3 <= glob_max_terms
1, 5
then (temporary : array_tmp10 expt(glob_h, 2) factorial_3(2, 4),
3
array_x2 : temporary, array_x2_higher : temporary,
5 1, 5
temporary 4.0
temporary : -------------, array_x2_higher : temporary,
glob_h 2, 4
temporary 3.0
temporary : -------------, array_x2_higher : temporary, 0)), kkk : 4,
glob_h 3, 3
array_tmp12 : array_const_4D0 array_x2 , array_tmp13 : array_x2_higher ,
3 1 3 3 2, 3
array_tmp14 : array_const_2D0 array_tmp13 ,
3 1 3
array_tmp15 : array_tmp12 - array_tmp14 ,
3 3 3
array_tmp16 : array_const_2D0 array_x1 ,
3 1 3
array_tmp17 : array_tmp15 - array_tmp16 ,
3 3 3
if not array_x1_set_initial then (if 3 <= glob_max_terms
2, 4
then (temporary : array_tmp17 expt(glob_h, 1) factorial_3(2, 3),
3
array_x1 : temporary, array_x1_higher : temporary,
4 1, 4
temporary 3.0
temporary : -------------, array_x1_higher : temporary, 0)), kkk : 4,
glob_h 2, 3
array_tmp1 : array_x2_higher , array_tmp2 : array_const_3D0 array_tmp1 ,
4 2, 4 4 1 4
array_tmp3 : array_tmp2 , array_tmp4 : array_const_2D0 array_x2 ,
4 4 4 1 4
array_tmp5 : array_tmp3 - array_tmp4 , array_tmp6 : array_x1_higher ,
4 4 4 4 3, 4
array_tmp7 : array_tmp5 - array_tmp6 , array_tmp8 : array_x1_higher ,
4 4 4 4 2, 4
array_tmp9 : array_tmp7 - array_tmp8 ,
4 4 4
array_tmp10 : array_x1 + array_tmp9 ,
4 4 4
if not array_x2_set_initial then (if 4 <= glob_max_terms
1, 6
then (temporary : array_tmp10 expt(glob_h, 2) factorial_3(3, 5),
4
array_x2 : temporary, array_x2_higher : temporary,
6 1, 6
temporary 5.0
temporary : -------------, array_x2_higher : temporary,
glob_h 2, 5
temporary 4.0
temporary : -------------, array_x2_higher : temporary, 0)), kkk : 5,
glob_h 3, 4
array_tmp12 : array_const_4D0 array_x2 , array_tmp13 : array_x2_higher ,
4 1 4 4 2, 4
array_tmp14 : array_const_2D0 array_tmp13 ,
4 1 4
array_tmp15 : array_tmp12 - array_tmp14 ,
4 4 4
array_tmp16 : array_const_2D0 array_x1 ,
4 1 4
array_tmp17 : array_tmp15 - array_tmp16 ,
4 4 4
if not array_x1_set_initial then (if 4 <= glob_max_terms
2, 5
then (temporary : array_tmp17 expt(glob_h, 1) factorial_3(3, 4),
4
array_x1 : temporary, array_x1_higher : temporary,
5 1, 5
temporary 4.0
temporary : -------------, array_x1_higher : temporary, 0)), kkk : 5,
glob_h 2, 4
array_tmp1 : array_x2_higher , array_tmp2 : array_const_3D0 array_tmp1 ,
5 2, 5 5 1 5
array_tmp3 : array_tmp2 , array_tmp4 : array_const_2D0 array_x2 ,
5 5 5 1 5
array_tmp5 : array_tmp3 - array_tmp4 , array_tmp6 : array_x1_higher ,
5 5 5 5 3, 5
array_tmp7 : array_tmp5 - array_tmp6 , array_tmp8 : array_x1_higher ,
5 5 5 5 2, 5
array_tmp9 : array_tmp7 - array_tmp8 ,
5 5 5
array_tmp10 : array_x1 + array_tmp9 ,
5 5 5
if not array_x2_set_initial then (if 5 <= glob_max_terms
1, 7
then (temporary : array_tmp10 expt(glob_h, 2) factorial_3(4, 6),
5
array_x2 : temporary, array_x2_higher : temporary,
7 1, 7
temporary 6.0
temporary : -------------, array_x2_higher : temporary,
glob_h 2, 6
temporary 5.0
temporary : -------------, array_x2_higher : temporary, 0)), kkk : 6,
glob_h 3, 5
array_tmp12 : array_const_4D0 array_x2 , array_tmp13 : array_x2_higher ,
5 1 5 5 2, 5
array_tmp14 : array_const_2D0 array_tmp13 ,
5 1 5
array_tmp15 : array_tmp12 - array_tmp14 ,
5 5 5
array_tmp16 : array_const_2D0 array_x1 ,
5 1 5
array_tmp17 : array_tmp15 - array_tmp16 ,
5 5 5
if not array_x1_set_initial then (if 5 <= glob_max_terms
2, 6
then (temporary : array_tmp17 expt(glob_h, 1) factorial_3(4, 5),
5
array_x1 : temporary, array_x1_higher : temporary,
6 1, 6
temporary 5.0
temporary : -------------, array_x1_higher : temporary, 0)), kkk : 6,
glob_h 2, 5
while kkk <= glob_max_terms do (array_tmp1 : array_x2_higher ,
kkk 2, kkk
array_tmp2 : array_const_3D0 array_tmp1 , array_tmp3 : array_tmp2 ,
kkk 1 kkk kkk kkk
array_tmp4 : array_const_2D0 array_x2 ,
kkk 1 kkk
array_tmp5 : array_tmp3 - array_tmp4 ,
kkk kkk kkk
array_tmp6 : array_x1_higher ,
kkk 3, kkk
array_tmp7 : array_tmp5 - array_tmp6 ,
kkk kkk kkk
array_tmp8 : array_x1_higher ,
kkk 2, kkk
array_tmp9 : array_tmp7 - array_tmp8 ,
kkk kkk kkk
array_tmp10 : array_x1 + array_tmp9 , order_d : 2,
kkk kkk kkk
if 1 + order_d + kkk <= glob_max_terms
then (if not array_x2_set_initial
1, order_d + kkk
then (temporary : array_tmp10 expt(glob_h, order_d)
kkk
factorial_3(kkk - 1, - 1 + order_d + kkk), array_x2 : temporary,
order_d + kkk
array_x2_higher : temporary, term : - 1 + order_d + kkk,
1, order_d + kkk
adj2 : - 1 + order_d + kkk, adj3 : 2, while term >=
1 do (if adj3 <= 1 + order_d then (if adj2 > 0
temporary convfp(adj2)
then temporary : ---------------------- else temporary : temporary,
glob_h
array_x2_higher : temporary), term : term - 1, adj2 : adj2 - 1,
adj3, term
adj3 : 1 + adj3))), array_tmp12 : array_const_4D0 array_x2 ,
kkk 1 kkk
array_tmp13 : array_x2_higher ,
kkk 2, kkk
array_tmp14 : array_const_2D0 array_tmp13 ,
kkk 1 kkk
array_tmp15 : array_tmp12 - array_tmp14 ,
kkk kkk kkk
array_tmp16 : array_const_2D0 array_x1 ,
kkk 1 kkk
array_tmp17 : array_tmp15 - array_tmp16 , order_d : 1,
kkk kkk kkk
if 1 + order_d + kkk <= glob_max_terms
then (if not array_x1_set_initial
2, order_d + kkk
then (temporary : array_tmp17 expt(glob_h, order_d)
kkk
factorial_3(kkk - 1, - 1 + order_d + kkk), array_x1 : temporary,
order_d + kkk
array_x1_higher : temporary, term : - 1 + order_d + kkk,
1, order_d + kkk
adj2 : - 1 + order_d + kkk, adj3 : 2, while term >=
1 do (if adj3 <= 1 + order_d then (if adj2 > 0
temporary convfp(adj2)
then temporary : ---------------------- else temporary : temporary,
glob_h
array_x1_higher : temporary), term : term - 1, adj2 : adj2 - 1,
adj3, term
adj3 : 1 + adj3))), kkk : 1 + kkk))
(%o12) atomall() := block([kkk, order_d, adj2, adj3, temporary, term, temp,
temp2], array_tmp1 : array_x2_higher ,
1 2, 1
array_tmp2 : array_const_3D0 array_tmp1 ,
1 1 1
array_tmp3 : array_tmp2 + array_const_0D0 ,
1 1 1
array_tmp4 : array_const_2D0 array_x2 ,
1 1 1
array_tmp5 : array_tmp3 - array_tmp4 , array_tmp6 : array_x1_higher ,
1 1 1 1 3, 1
array_tmp7 : array_tmp5 - array_tmp6 , array_tmp8 : array_x1_higher ,
1 1 1 1 2, 1
array_tmp9 : array_tmp7 - array_tmp8 ,
1 1 1
array_tmp10 : array_x1 + array_tmp9 ,
1 1 1
if not array_x2_set_initial then (if 1 <= glob_max_terms
1, 3
then (temporary : array_tmp10 expt(glob_h, 2) factorial_3(0, 2),
1
array_x2 : temporary, array_x2_higher : temporary,
3 1, 3
temporary 2.0
temporary : -------------, array_x2_higher : temporary,
glob_h 2, 2
temporary 1.0
temporary : -------------, array_x2_higher : temporary, 0)), kkk : 2,
glob_h 3, 1
array_tmp12 : array_const_4D0 array_x2 , array_tmp13 : array_x2_higher ,
1 1 1 1 2, 1
array_tmp14 : array_const_2D0 array_tmp13 ,
1 1 1
array_tmp15 : array_tmp12 - array_tmp14 ,
1 1 1
array_tmp16 : array_const_2D0 array_x1 ,
1 1 1
array_tmp17 : array_tmp15 - array_tmp16 ,
1 1 1
if not array_x1_set_initial then (if 1 <= glob_max_terms
2, 2
then (temporary : array_tmp17 expt(glob_h, 1) factorial_3(0, 1),
1
array_x1 : temporary, array_x1_higher : temporary,
2 1, 2
temporary 1.0
temporary : -------------, array_x1_higher : temporary, 0)), kkk : 2,
glob_h 2, 1
array_tmp1 : array_x2_higher , array_tmp2 : array_const_3D0 array_tmp1 ,
2 2, 2 2 1 2
array_tmp3 : array_tmp2 , array_tmp4 : array_const_2D0 array_x2 ,
2 2 2 1 2
array_tmp5 : array_tmp3 - array_tmp4 , array_tmp6 : array_x1_higher ,
2 2 2 2 3, 2
array_tmp7 : array_tmp5 - array_tmp6 , array_tmp8 : array_x1_higher ,
2 2 2 2 2, 2
array_tmp9 : array_tmp7 - array_tmp8 ,
2 2 2
array_tmp10 : array_x1 + array_tmp9 ,
2 2 2
if not array_x2_set_initial then (if 2 <= glob_max_terms
1, 4
then (temporary : array_tmp10 expt(glob_h, 2) factorial_3(1, 3),
2
array_x2 : temporary, array_x2_higher : temporary,
4 1, 4
temporary 3.0
temporary : -------------, array_x2_higher : temporary,
glob_h 2, 3
temporary 2.0
temporary : -------------, array_x2_higher : temporary, 0)), kkk : 3,
glob_h 3, 2
array_tmp12 : array_const_4D0 array_x2 , array_tmp13 : array_x2_higher ,
2 1 2 2 2, 2
array_tmp14 : array_const_2D0 array_tmp13 ,
2 1 2
array_tmp15 : array_tmp12 - array_tmp14 ,
2 2 2
array_tmp16 : array_const_2D0 array_x1 ,
2 1 2
array_tmp17 : array_tmp15 - array_tmp16 ,
2 2 2
if not array_x1_set_initial then (if 2 <= glob_max_terms
2, 3
then (temporary : array_tmp17 expt(glob_h, 1) factorial_3(1, 2),
2
array_x1 : temporary, array_x1_higher : temporary,
3 1, 3
temporary 2.0
temporary : -------------, array_x1_higher : temporary, 0)), kkk : 3,
glob_h 2, 2
array_tmp1 : array_x2_higher , array_tmp2 : array_const_3D0 array_tmp1 ,
3 2, 3 3 1 3
array_tmp3 : array_tmp2 , array_tmp4 : array_const_2D0 array_x2 ,
3 3 3 1 3
array_tmp5 : array_tmp3 - array_tmp4 , array_tmp6 : array_x1_higher ,
3 3 3 3 3, 3
array_tmp7 : array_tmp5 - array_tmp6 , array_tmp8 : array_x1_higher ,
3 3 3 3 2, 3
array_tmp9 : array_tmp7 - array_tmp8 ,
3 3 3
array_tmp10 : array_x1 + array_tmp9 ,
3 3 3
if not array_x2_set_initial then (if 3 <= glob_max_terms
1, 5
then (temporary : array_tmp10 expt(glob_h, 2) factorial_3(2, 4),
3
array_x2 : temporary, array_x2_higher : temporary,
5 1, 5
temporary 4.0
temporary : -------------, array_x2_higher : temporary,
glob_h 2, 4
temporary 3.0
temporary : -------------, array_x2_higher : temporary, 0)), kkk : 4,
glob_h 3, 3
array_tmp12 : array_const_4D0 array_x2 , array_tmp13 : array_x2_higher ,
3 1 3 3 2, 3
array_tmp14 : array_const_2D0 array_tmp13 ,
3 1 3
array_tmp15 : array_tmp12 - array_tmp14 ,
3 3 3
array_tmp16 : array_const_2D0 array_x1 ,
3 1 3
array_tmp17 : array_tmp15 - array_tmp16 ,
3 3 3
if not array_x1_set_initial then (if 3 <= glob_max_terms
2, 4
then (temporary : array_tmp17 expt(glob_h, 1) factorial_3(2, 3),
3
array_x1 : temporary, array_x1_higher : temporary,
4 1, 4
temporary 3.0
temporary : -------------, array_x1_higher : temporary, 0)), kkk : 4,
glob_h 2, 3
array_tmp1 : array_x2_higher , array_tmp2 : array_const_3D0 array_tmp1 ,
4 2, 4 4 1 4
array_tmp3 : array_tmp2 , array_tmp4 : array_const_2D0 array_x2 ,
4 4 4 1 4
array_tmp5 : array_tmp3 - array_tmp4 , array_tmp6 : array_x1_higher ,
4 4 4 4 3, 4
array_tmp7 : array_tmp5 - array_tmp6 , array_tmp8 : array_x1_higher ,
4 4 4 4 2, 4
array_tmp9 : array_tmp7 - array_tmp8 ,
4 4 4
array_tmp10 : array_x1 + array_tmp9 ,
4 4 4
if not array_x2_set_initial then (if 4 <= glob_max_terms
1, 6
then (temporary : array_tmp10 expt(glob_h, 2) factorial_3(3, 5),
4
array_x2 : temporary, array_x2_higher : temporary,
6 1, 6
temporary 5.0
temporary : -------------, array_x2_higher : temporary,
glob_h 2, 5
temporary 4.0
temporary : -------------, array_x2_higher : temporary, 0)), kkk : 5,
glob_h 3, 4
array_tmp12 : array_const_4D0 array_x2 , array_tmp13 : array_x2_higher ,
4 1 4 4 2, 4
array_tmp14 : array_const_2D0 array_tmp13 ,
4 1 4
array_tmp15 : array_tmp12 - array_tmp14 ,
4 4 4
array_tmp16 : array_const_2D0 array_x1 ,
4 1 4
array_tmp17 : array_tmp15 - array_tmp16 ,
4 4 4
if not array_x1_set_initial then (if 4 <= glob_max_terms
2, 5
then (temporary : array_tmp17 expt(glob_h, 1) factorial_3(3, 4),
4
array_x1 : temporary, array_x1_higher : temporary,
5 1, 5
temporary 4.0
temporary : -------------, array_x1_higher : temporary, 0)), kkk : 5,
glob_h 2, 4
array_tmp1 : array_x2_higher , array_tmp2 : array_const_3D0 array_tmp1 ,
5 2, 5 5 1 5
array_tmp3 : array_tmp2 , array_tmp4 : array_const_2D0 array_x2 ,
5 5 5 1 5
array_tmp5 : array_tmp3 - array_tmp4 , array_tmp6 : array_x1_higher ,
5 5 5 5 3, 5
array_tmp7 : array_tmp5 - array_tmp6 , array_tmp8 : array_x1_higher ,
5 5 5 5 2, 5
array_tmp9 : array_tmp7 - array_tmp8 ,
5 5 5
array_tmp10 : array_x1 + array_tmp9 ,
5 5 5
if not array_x2_set_initial then (if 5 <= glob_max_terms
1, 7
then (temporary : array_tmp10 expt(glob_h, 2) factorial_3(4, 6),
5
array_x2 : temporary, array_x2_higher : temporary,
7 1, 7
temporary 6.0
temporary : -------------, array_x2_higher : temporary,
glob_h 2, 6
temporary 5.0
temporary : -------------, array_x2_higher : temporary, 0)), kkk : 6,
glob_h 3, 5
array_tmp12 : array_const_4D0 array_x2 , array_tmp13 : array_x2_higher ,
5 1 5 5 2, 5
array_tmp14 : array_const_2D0 array_tmp13 ,
5 1 5
array_tmp15 : array_tmp12 - array_tmp14 ,
5 5 5
array_tmp16 : array_const_2D0 array_x1 ,
5 1 5
array_tmp17 : array_tmp15 - array_tmp16 ,
5 5 5
if not array_x1_set_initial then (if 5 <= glob_max_terms
2, 6
then (temporary : array_tmp17 expt(glob_h, 1) factorial_3(4, 5),
5
array_x1 : temporary, array_x1_higher : temporary,
6 1, 6
temporary 5.0
temporary : -------------, array_x1_higher : temporary, 0)), kkk : 6,
glob_h 2, 5
while kkk <= glob_max_terms do (array_tmp1 : array_x2_higher ,
kkk 2, kkk
array_tmp2 : array_const_3D0 array_tmp1 , array_tmp3 : array_tmp2 ,
kkk 1 kkk kkk kkk
array_tmp4 : array_const_2D0 array_x2 ,
kkk 1 kkk
array_tmp5 : array_tmp3 - array_tmp4 ,
kkk kkk kkk
array_tmp6 : array_x1_higher ,
kkk 3, kkk
array_tmp7 : array_tmp5 - array_tmp6 ,
kkk kkk kkk
array_tmp8 : array_x1_higher ,
kkk 2, kkk
array_tmp9 : array_tmp7 - array_tmp8 ,
kkk kkk kkk
array_tmp10 : array_x1 + array_tmp9 , order_d : 2,
kkk kkk kkk
if 1 + order_d + kkk <= glob_max_terms
then (if not array_x2_set_initial
1, order_d + kkk
then (temporary : array_tmp10 expt(glob_h, order_d)
kkk
factorial_3(kkk - 1, - 1 + order_d + kkk), array_x2 : temporary,
order_d + kkk
array_x2_higher : temporary, term : - 1 + order_d + kkk,
1, order_d + kkk
adj2 : - 1 + order_d + kkk, adj3 : 2, while term >=
1 do (if adj3 <= 1 + order_d then (if adj2 > 0
temporary convfp(adj2)
then temporary : ---------------------- else temporary : temporary,
glob_h
array_x2_higher : temporary), term : term - 1, adj2 : adj2 - 1,
adj3, term
adj3 : 1 + adj3))), array_tmp12 : array_const_4D0 array_x2 ,
kkk 1 kkk
array_tmp13 : array_x2_higher ,
kkk 2, kkk
array_tmp14 : array_const_2D0 array_tmp13 ,
kkk 1 kkk
array_tmp15 : array_tmp12 - array_tmp14 ,
kkk kkk kkk
array_tmp16 : array_const_2D0 array_x1 ,
kkk 1 kkk
array_tmp17 : array_tmp15 - array_tmp16 , order_d : 1,
kkk kkk kkk
if 1 + order_d + kkk <= glob_max_terms
then (if not array_x1_set_initial
2, order_d + kkk
then (temporary : array_tmp17 expt(glob_h, order_d)
kkk
factorial_3(kkk - 1, - 1 + order_d + kkk), array_x1 : temporary,
order_d + kkk
array_x1_higher : temporary, term : - 1 + order_d + kkk,
1, order_d + kkk
adj2 : - 1 + order_d + kkk, adj3 : 2, while term >=
1 do (if adj3 <= 1 + order_d then (if adj2 > 0
temporary convfp(adj2)
then temporary : ---------------------- else temporary : temporary,
glob_h
array_x1_higher : temporary), term : term - 1, adj2 : adj2 - 1,
adj3, term
adj3 : 1 + adj3))), kkk : 1 + kkk))
log(x)
(%i13) log10(x) := ---------
log(10.0)
log(x)
(%o13) log10(x) := ---------
log(10.0)
(%i14) omniout_str(iolevel, str) := if glob_iolevel >= iolevel
then printf(true, "~a~%", string(str))
(%o14) omniout_str(iolevel, str) := if glob_iolevel >= iolevel
then printf(true, "~a~%", string(str))
(%i15) omniout_str_noeol(iolevel, str) :=
if glob_iolevel >= iolevel then printf(true, "~a", string(str))
(%o15) omniout_str_noeol(iolevel, str) :=
if glob_iolevel >= iolevel then printf(true, "~a", string(str))
(%i16) omniout_labstr(iolevel, label, str) :=
if glob_iolevel >= iolevel then printf(true, "~a = ~a~%", string(label),
string(str))
(%o16) omniout_labstr(iolevel, label, str) :=
if glob_iolevel >= iolevel then printf(true, "~a = ~a~%", string(label),
string(str))
(%i17) omniout_float(iolevel, prelabel, prelen, value, vallen, postlabel) :=
if glob_iolevel >= iolevel then (if vallen = 4
then printf(true, "~a = ~g ~s ~%", prelabel, value, postlabel)
else printf(true, "~a = ~g ~s ~%", prelabel, value, postlabel))
(%o17) omniout_float(iolevel, prelabel, prelen, value, vallen, postlabel) :=
if glob_iolevel >= iolevel then (if vallen = 4
then printf(true, "~a = ~g ~s ~%", prelabel, value, postlabel)
else printf(true, "~a = ~g ~s ~%", prelabel, value, postlabel))
(%i18) omniout_int(iolevel, prelabel, prelen, value, vallen, postlabel) :=
if glob_iolevel >= iolevel then (printf(true, "~a = ~d ~a~%", prelabel, value,
postlabel), newline())
(%o18) omniout_int(iolevel, prelabel, prelen, value, vallen, postlabel) :=
if glob_iolevel >= iolevel then (printf(true, "~a = ~d ~a~%", prelabel, value,
postlabel), newline())
(%i19) omniout_float_arr(iolevel, prelabel, elemnt, prelen, value, vallen,
postlabel) := if glob_iolevel >= iolevel
then (sprint(prelabel, "[", elemnt, "]=", value, postlabel), newline())
(%o19) omniout_float_arr(iolevel, prelabel, elemnt, prelen, value, vallen,
postlabel) := if glob_iolevel >= iolevel
then (sprint(prelabel, "[", elemnt, "]=", value, postlabel), newline())
(%i20) dump_series(iolevel, dump_label, series_name, arr_series, numb) :=
block([i], if glob_iolevel >= iolevel then (i : 1,
while i <= numb do (sprint(dump_label, series_name, "i = ", i, "series = ",
array_series ), newline(), i : 1 + i)))
i
(%o20) dump_series(iolevel, dump_label, series_name, arr_series, numb) :=
block([i], if glob_iolevel >= iolevel then (i : 1,
while i <= numb do (sprint(dump_label, series_name, "i = ", i, "series = ",
array_series ), newline(), i : 1 + i)))
i
(%i21) dump_series_2(iolevel, dump_label, series_name2, arr_series2, numb,
subnum, arr_x) := (array_series2, numb, subnum) :=
block([i, sub, ts_term], if glob_iolevel >= iolevel
then (sub : 1, while sub <= subnum do (i : 1,
while i <= num do (sprint(dump_label, series_name, "sub = ", sub, "i = ", i,
"series2 = ", array_series2 ), i : 1 + i), sub : 1 + sub)))
sub, i
(%o21) dump_series_2(iolevel, dump_label, series_name2, arr_series2, numb,
subnum, arr_x) := (array_series2, numb, subnum) :=
block([i, sub, ts_term], if glob_iolevel >= iolevel
then (sub : 1, while sub <= subnum do (i : 1,
while i <= num do (sprint(dump_label, series_name, "sub = ", sub, "i = ", i,
"series2 = ", array_series2 ), i : 1 + i), sub : 1 + sub)))
sub, i
(%i22) cs_info(iolevel, str) := if glob_iolevel >= iolevel
then sprint(concat("cs_info ", str, " glob_correct_start_flag = ",
glob_correct_start_flag, "glob_h := ", glob_h, "glob_reached_optimal_h := ",
glob_reached_optimal_h))
(%o22) cs_info(iolevel, str) := if glob_iolevel >= iolevel
then sprint(concat("cs_info ", str, " glob_correct_start_flag = ",
glob_correct_start_flag, "glob_h := ", glob_h, "glob_reached_optimal_h := ",
glob_reached_optimal_h))
(%i23) logitem_time(fd, secs_in) := block([days, days_int, hours, hours_int,
minutes, minutes_int, sec_int, seconds, secs, years, years_int],
secs : convfloat(secs_in), printf(fd, "
~%"),
secs
if secs >= 0 then (years_int : trunc(----------------),
glob_sec_in_year
sec_temp : mod(trunc(secs), trunc(glob_sec_in_year)),
sec_temp
days_int : trunc(---------------), sec_temp :
glob_sec_in_day
sec_temp
mod(sec_temp, trunc(glob_sec_in_day)), hours_int : trunc(----------------),
glob_sec_in_hour
sec_temp : mod(sec_temp, trunc(glob_sec_in_hour)),
sec_temp
minutes_int : trunc(------------------),
glob_sec_in_minute
sec_int : mod(sec_temp, trunc(glob_sec_in_minute)),
if years_int > 0 then printf(fd,
"= ~d Years ~d Days ~d Hours ~d Minutes ~d Seconds~%", years_int, days_int,
hours_int, minutes_int, sec_int) elseif days_int > 0
then printf(fd, "= ~d Days ~d Hours ~d Minutes ~d Seconds~%", days_int,
hours_int, minutes_int, sec_int) elseif hours_int > 0
then printf(fd, "= ~d Hours ~d Minutes ~d Seconds~%", hours_int, minutes_int,
sec_int) elseif minutes_int > 0 then printf(fd, "= ~d Minutes ~d Seconds~%",
minutes_int, sec_int) else printf(fd, "= ~d Seconds~%", sec_int))
else printf(fd, " Unknown~%"), printf(fd, " | ~%"))
(%o23) logitem_time(fd, secs_in) := block([days, days_int, hours, hours_int,
minutes, minutes_int, sec_int, seconds, secs, years, years_int],
secs : convfloat(secs_in), printf(fd, "~%"),
secs
if secs >= 0 then (years_int : trunc(----------------),
glob_sec_in_year
sec_temp : mod(trunc(secs), trunc(glob_sec_in_year)),
sec_temp
days_int : trunc(---------------), sec_temp :
glob_sec_in_day
sec_temp
mod(sec_temp, trunc(glob_sec_in_day)), hours_int : trunc(----------------),
glob_sec_in_hour
sec_temp : mod(sec_temp, trunc(glob_sec_in_hour)),
sec_temp
minutes_int : trunc(------------------),
glob_sec_in_minute
sec_int : mod(sec_temp, trunc(glob_sec_in_minute)),
if years_int > 0 then printf(fd,
"= ~d Years ~d Days ~d Hours ~d Minutes ~d Seconds~%", years_int, days_int,
hours_int, minutes_int, sec_int) elseif days_int > 0
then printf(fd, "= ~d Days ~d Hours ~d Minutes ~d Seconds~%", days_int,
hours_int, minutes_int, sec_int) elseif hours_int > 0
then printf(fd, "= ~d Hours ~d Minutes ~d Seconds~%", hours_int, minutes_int,
sec_int) elseif minutes_int > 0 then printf(fd, "= ~d Minutes ~d Seconds~%",
minutes_int, sec_int) else printf(fd, "= ~d Seconds~%", sec_int))
else printf(fd, " Unknown~%"), printf(fd, " | ~%"))
(%i24) omniout_timestr(secs_in) := block([days, days_int, hours, hours_int,
minutes, minutes_int, sec_int, seconds, secs, years, years_int],
secs : convfloat(secs_in), if secs >= 0
secs
then (years_int : trunc(----------------),
glob_sec_in_year
sec_temp : mod(trunc(secs), trunc(glob_sec_in_year)),
sec_temp
days_int : trunc(---------------), sec_temp :
glob_sec_in_day
sec_temp
mod(sec_temp, trunc(glob_sec_in_day)), hours_int : trunc(----------------),
glob_sec_in_hour
sec_temp : mod(sec_temp, trunc(glob_sec_in_hour)),
sec_temp
minutes_int : trunc(------------------),
glob_sec_in_minute
sec_int : mod(sec_temp, trunc(glob_sec_in_minute)),
if years_int > 0 then printf(true,
"= ~d Years ~d Days ~d Hours ~d Minutes ~d Seconds~%", years_int, days_int,
hours_int, minutes_int, sec_int) elseif days_int > 0
then printf(true, "= ~d Days ~d Hours ~d Minutes ~d Seconds~%", days_int,
hours_int, minutes_int, sec_int) elseif hours_int > 0
then printf(true, "= ~d Hours ~d Minutes ~d Seconds~%", hours_int,
minutes_int, sec_int) elseif minutes_int > 0
then printf(true, "= ~d Minutes ~d Seconds~%", minutes_int, sec_int)
else printf(true, "= ~d Seconds~%", sec_int)) else printf(true, " Unknown~%"))
(%o24) omniout_timestr(secs_in) := block([days, days_int, hours, hours_int,
minutes, minutes_int, sec_int, seconds, secs, years, years_int],
secs : convfloat(secs_in), if secs >= 0
secs
then (years_int : trunc(----------------),
glob_sec_in_year
sec_temp : mod(trunc(secs), trunc(glob_sec_in_year)),
sec_temp
days_int : trunc(---------------), sec_temp :
glob_sec_in_day
sec_temp
mod(sec_temp, trunc(glob_sec_in_day)), hours_int : trunc(----------------),
glob_sec_in_hour
sec_temp : mod(sec_temp, trunc(glob_sec_in_hour)),
sec_temp
minutes_int : trunc(------------------),
glob_sec_in_minute
sec_int : mod(sec_temp, trunc(glob_sec_in_minute)),
if years_int > 0 then printf(true,
"= ~d Years ~d Days ~d Hours ~d Minutes ~d Seconds~%", years_int, days_int,
hours_int, minutes_int, sec_int) elseif days_int > 0
then printf(true, "= ~d Days ~d Hours ~d Minutes ~d Seconds~%", days_int,
hours_int, minutes_int, sec_int) elseif hours_int > 0
then printf(true, "= ~d Hours ~d Minutes ~d Seconds~%", hours_int,
minutes_int, sec_int) elseif minutes_int > 0
then printf(true, "= ~d Minutes ~d Seconds~%", minutes_int, sec_int)
else printf(true, "= ~d Seconds~%", sec_int)) else printf(true, " Unknown~%"))
(%i25) ats(mmm_ats, arr_a, arr_b, jjj_ats) :=
block([iii_ats, lll_ats, ma_ats, ret_ats], ret_ats : 0.0,
if jjj_ats <= mmm_ats then (ma_ats : 1 + mmm_ats, iii_ats : jjj_ats,
while iii_ats <= mmm_ats do (lll_ats : ma_ats - iii_ats,
ret_ats : arr_a arr_b + ret_ats, iii_ats : 1 + iii_ats)),
iii_ats lll_ats
ret_ats)
(%o25) ats(mmm_ats, arr_a, arr_b, jjj_ats) :=
block([iii_ats, lll_ats, ma_ats, ret_ats], ret_ats : 0.0,
if jjj_ats <= mmm_ats then (ma_ats : 1 + mmm_ats, iii_ats : jjj_ats,
while iii_ats <= mmm_ats do (lll_ats : ma_ats - iii_ats,
ret_ats : arr_a arr_b + ret_ats, iii_ats : 1 + iii_ats)),
iii_ats lll_ats
ret_ats)
(%i26) att(mmm_att, arr_aa, arr_bb, jjj_att) :=
block([al_att, iii_att, lll_att, ma_att, ret_att], ret_att : 0.0,
if jjj_att <= mmm_att then (ma_att : 2 + mmm_att, 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 : arr_aa arr_bb convfp(al_att) + ret_att,
iii_att lll_att
ret_att
iii_att : 1 + iii_att), ret_att : ---------------), ret_att)
convfp(mmm_att)
(%o26) att(mmm_att, arr_aa, arr_bb, jjj_att) :=
block([al_att, iii_att, lll_att, ma_att, ret_att], ret_att : 0.0,
if jjj_att <= mmm_att then (ma_att : 2 + mmm_att, 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 : arr_aa arr_bb convfp(al_att) + ret_att,
iii_att lll_att
ret_att
iii_att : 1 + iii_att), ret_att : ---------------), ret_att)
convfp(mmm_att)
(%i27) display_pole_debug(typ, radius, order2) :=
(if typ = 1 then omniout_str(ALWAYS, "Real")
else omniout_str(ALWAYS, "Complex"), omniout_float(ALWAYS,
"DBG Radius of convergence ", 4, radius, 4, " "),
omniout_float(ALWAYS, "DBG Order of pole ", 4, order2, 4, " "))
(%o27) display_pole_debug(typ, radius, order2) :=
(if typ = 1 then omniout_str(ALWAYS, "Real")
else omniout_str(ALWAYS, "Complex"), omniout_float(ALWAYS,
"DBG Radius of convergence ", 4, radius, 4, " "),
omniout_float(ALWAYS, "DBG Order of pole ", 4, order2, 4, " "))
(%i28) display_pole() := if (array_pole # glob_large_float)
1
and (array_pole > 0.0) and (array_pole # glob_large_float)
1 2
and (array_pole > 0.0) and glob_display_flag
2
then (omniout_float(ALWAYS, "Radius of convergence ", 4,
array_pole , 4, " "), omniout_float(ALWAYS,
1
"Order of pole ", 4, array_pole , 4, " "))
2
(%o28) display_pole() := if (array_pole # glob_large_float)
1
and (array_pole > 0.0) and (array_pole # glob_large_float)
1 2
and (array_pole > 0.0) and glob_display_flag
2
then (omniout_float(ALWAYS, "Radius of convergence ", 4,
array_pole , 4, " "), omniout_float(ALWAYS,
1
"Order of pole ", 4, array_pole , 4, " "))
2
(%i29) logditto(file) := (printf(file, ""), printf(file, "ditto"),
printf(file, " | "))
(%o29) logditto(file) := (printf(file, ""), printf(file, "ditto"),
printf(file, " | "))
(%i30) logitem_integer(file, n) := (printf(file, ""),
printf(file, "~d", n), printf(file, " | "))
(%o30) logitem_integer(file, n) := (printf(file, ""),
printf(file, "~d", n), printf(file, " | "))
(%i31) logitem_str(file, str) := (printf(file, ""), printf(file, str),
printf(file, " | "))
(%o31) logitem_str(file, str) := (printf(file, ""), printf(file, str),
printf(file, " | "))
(%i32) logitem_good_digits(file, rel_error) :=
block([good_digits], printf(file, ""),
if rel_error # - 1.0 then (if rel_error > + 1.0E-34
then (good_digits : 1 - floor(log10(rel_error)),
printf(file, "~d", good_digits)) else (good_digits : 16,
printf(file, "~d", good_digits))) else printf(file, "Unknown"),
printf(file, " | "))
(%o32) logitem_good_digits(file, rel_error) :=
block([good_digits], printf(file, ""),
if rel_error # - 1.0 then (if rel_error > + 1.0E-34
then (good_digits : 1 - floor(log10(rel_error)),
printf(file, "~d", good_digits)) else (good_digits : 16,
printf(file, "~d", good_digits))) else printf(file, "Unknown"),
printf(file, " | "))
(%i33) log_revs(file, revs) := printf(file, revs)
(%o33) log_revs(file, revs) := printf(file, revs)
(%i34) logitem_float(file, x) := (printf(file, ""), printf(file, "~g", x),
printf(file, " | "))
(%o34) logitem_float(file, x) := (printf(file, ""), printf(file, "~g", x),
printf(file, " | "))
(%i35) logitem_pole(file, pole) := (printf(file, ""),
if pole = 0 then printf(file, "NA") elseif pole = 1 then printf(file, "Real")
elseif pole = 2 then printf(file, "Complex") else printf(file, "No Pole"),
printf(file, " | "))
(%o35) logitem_pole(file, pole) := (printf(file, ""),
if pole = 0 then printf(file, "NA") elseif pole = 1 then printf(file, "Real")
elseif pole = 2 then printf(file, "Complex") else printf(file, "No Pole"),
printf(file, " | "))
(%i36) logstart(file) := printf(file, "")
(%o36) logstart(file) := printf(file, "
")
(%i37) logend(file) := printf(file, "
~%")
(%o37) logend(file) := printf(file, "~%")
(%i38) chk_data() := block([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), if glob_max_iter < 2
then (omniout_str(ALWAYS, "Illegal max_iter"), errflag : true),
if errflag then quit())
(%o38) chk_data() := block([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), if glob_max_iter < 2
then (omniout_str(ALWAYS, "Illegal max_iter"), errflag : true),
if errflag then quit())
(%i39) comp_expect_sec(t_end2, t_start2, t2, clock_sec2) :=
block([ms2, rrr, sec_left, sub1, sub2], ms2 : clock_sec2,
sub1 : t_end2 - t_start2, sub2 : t2 - t_start2,
if sub1 = 0.0 then sec_left : 0.0 else (if sub2 > 0.0
sub1
then (rrr : ----, sec_left : rrr ms2 - ms2) else sec_left : 0.0), sec_left)
sub2
(%o39) comp_expect_sec(t_end2, t_start2, t2, clock_sec2) :=
block([ms2, rrr, sec_left, sub1, sub2], ms2 : clock_sec2,
sub1 : t_end2 - t_start2, sub2 : t2 - t_start2,
if sub1 = 0.0 then sec_left : 0.0 else (if sub2 > 0.0
sub1
then (rrr : ----, sec_left : rrr ms2 - ms2) else sec_left : 0.0), sec_left)
sub2
(%i40) comp_percent(t_end2, t_start2, t2) :=
block([rrr, sub1, sub2], sub1 : t_end2 - t_start2, sub2 : t2 - t_start2,
100.0 sub2
if sub2 > glob_small_float then rrr : ---------- else rrr : 0.0, rrr)
sub1
(%o40) comp_percent(t_end2, t_start2, t2) :=
block([rrr, sub1, sub2], sub1 : t_end2 - t_start2, sub2 : t2 - t_start2,
100.0 sub2
if sub2 > glob_small_float then rrr : ---------- else rrr : 0.0, rrr)
sub1
(%i41) factorial_2(nnn) := nnn!
(%o41) factorial_2(nnn) := nnn!
(%i42) factorial_1(nnn) := block([ret],
if nnn <= glob_max_terms then (if array_fact_1 = 0
nnn
then (ret : factorial_2(nnn), array_fact_1 : ret)
nnn
else ret : array_fact_1 ) else ret : factorial_2(nnn), ret)
nnn
(%o42) factorial_1(nnn) := block([ret],
if nnn <= glob_max_terms then (if array_fact_1 = 0
nnn
then (ret : factorial_2(nnn), array_fact_1 : ret)
nnn
else ret : array_fact_1 ) else ret : factorial_2(nnn), ret)
nnn
(%i43) factorial_3(mmm, nnn) := block([ret],
if (nnn <= glob_max_terms) and (mmm <= glob_max_terms)
factorial_1(mmm)
then (if array_fact_2 = 0 then (ret : ----------------,
mmm, nnn factorial_1(nnn)
array_fact_2 : ret) else ret : array_fact_2 )
mmm, nnn mmm, nnn
factorial_2(mmm)
else ret : ----------------, ret)
factorial_2(nnn)
(%o43) factorial_3(mmm, nnn) := block([ret],
if (nnn <= glob_max_terms) and (mmm <= glob_max_terms)
factorial_1(mmm)
then (if array_fact_2 = 0 then (ret : ----------------,
mmm, nnn factorial_1(nnn)
array_fact_2 : ret) else ret : array_fact_2 )
mmm, nnn mmm, nnn
factorial_2(mmm)
else ret : ----------------, ret)
factorial_2(nnn)
(%i44) convfp(mmm) := mmm
(%o44) convfp(mmm) := mmm
(%i45) convfloat(mmm) := mmm
(%o45) convfloat(mmm) := mmm
(%i46) elapsed_time_seconds() := block([t], t : elapsed_real_time(), t)
(%o46) elapsed_time_seconds() := block([t], t : elapsed_real_time(), t)
(%i47) Si(x) := 0.0
(%o47) Si(x) := 0.0
(%i48) Ci(x) := 0.0
(%o48) Ci(x) := 0.0
(%i49) ln(x) := log(x)
(%o49) ln(x) := log(x)
(%i50) arcsin(x) := asin(x)
(%o50) arcsin(x) := asin(x)
(%i51) arccos(x) := acos(x)
(%o51) arccos(x) := acos(x)
(%i52) arctan(x) := atan(x)
(%o52) arctan(x) := atan(x)
(%i53) omniabs(x) := abs(x)
(%o53) omniabs(x) := abs(x)
(%i54) expt(x, y) := (if (x = 0.0) and (y < 0.0)
y
then print("expt error x = ", x, "y = ", y), x )
(%o54) expt(x, y) := (if (x = 0.0) and (y < 0.0)
y
then print("expt error x = ", x, "y = ", y), x )
(%i55) estimated_needed_step_error(x_start, x_end, estimated_h,
estimated_answer) := block([desired_abs_gbl_error, range, estimated_steps,
step_error], omniout_float(ALWAYS, "glob_desired_digits_correct", 32,
glob_desired_digits_correct, 32, ""), desired_abs_gbl_error :
expt(10.0, - glob_desired_digits_correct) omniabs(estimated_answer),
omniout_float(ALWAYS, "desired_abs_gbl_error", 32, desired_abs_gbl_error, 32,
""), range : x_end - x_start, omniout_float(ALWAYS, "range", 32, range, 32,
range
""), estimated_steps : -----------, omniout_float(ALWAYS, "estimated_steps",
estimated_h
desired_abs_gbl_error
32, estimated_steps, 32, ""), step_error : omniabs(---------------------),
estimated_steps
omniout_float(ALWAYS, "step_error", 32, step_error, 32, ""), step_error)
(%o55) estimated_needed_step_error(x_start, x_end, estimated_h,
estimated_answer) := block([desired_abs_gbl_error, range, estimated_steps,
step_error], omniout_float(ALWAYS, "glob_desired_digits_correct", 32,
glob_desired_digits_correct, 32, ""), desired_abs_gbl_error :
expt(10.0, - glob_desired_digits_correct) omniabs(estimated_answer),
omniout_float(ALWAYS, "desired_abs_gbl_error", 32, desired_abs_gbl_error, 32,
""), range : x_end - x_start, omniout_float(ALWAYS, "range", 32, range, 32,
range
""), estimated_steps : -----------, omniout_float(ALWAYS, "estimated_steps",
estimated_h
desired_abs_gbl_error
32, estimated_steps, 32, ""), step_error : omniabs(---------------------),
estimated_steps
omniout_float(ALWAYS, "step_error", 32, step_error, 32, ""), step_error)
(%i56) exact_soln_x1(t) := block([c1, c2, c3], c1 : 1.0, c2 : 2.0E-4,
c3 : 3.0E-4, 6.0 c3 exp(- t) + 2.0 c1)
(%o56) exact_soln_x1(t) := block([c1, c2, c3], c1 : 1.0, c2 : 2.0E-4,
c3 : 3.0E-4, 6.0 c3 exp(- t) + 2.0 c1)
(%i57) exact_soln_x1p(t) := block([c1, c2, c3], c1 : 1.0, c2 : 2.0E-4,
c3 : 3.0E-4, - 6.0 c3 exp(- t))
(%o57) exact_soln_x1p(t) := block([c1, c2, c3], c1 : 1.0, c2 : 2.0E-4,
c3 : 3.0E-4, - 6.0 c3 exp(- t))
(%i58) exact_soln_x2(t) := block([c1, c2, c3], c1 : 1.0, c2 : 2.0E-4,
c3 : 3.0E-4, c3 exp(- t) + c2 exp(2.0 t) + c1)
(%o58) exact_soln_x2(t) := block([c1, c2, c3], c1 : 1.0, c2 : 2.0E-4,
c3 : 3.0E-4, c3 exp(- t) + c2 exp(2.0 t) + c1)
(%i59) exact_soln_x2p(t) := block([c1, c2, c3], c1 : 1.0, c2 : 2.0E-4,
c3 : 3.0E-4, 2.0 c2 exp(2.0 t) - c3 exp(- t))
(%o59) exact_soln_x2p(t) := block([c1, c2, c3], c1 : 1.0, c2 : 2.0E-4,
c3 : 3.0E-4, 2.0 c2 exp(2.0 t) - c3 exp(- t))
(%i60) main() := block([d1, d2, d3, d4, est_err_2, niii, done_once, term, ord,
order_diff, term_no, html_log_file, iiif, jjjf, rows, r_order, sub_iter,
calc_term, iii, temp_sum, current_iter, t_start, t_end, it, max_terms,
opt_iter, tmp, subiter, est_needed_step_err, value3, min_value, est_answer,
best_h, found_h, repeat_it], define_variable(glob_max_terms, 30, fixnum),
define_variable(glob_iolevel, 5, fixnum), define_variable(ALWAYS, 1, fixnum),
define_variable(INFO, 2, fixnum), define_variable(DEBUGL, 3, fixnum),
define_variable(DEBUGMASSIVE, 4, fixnum),
define_variable(MAX_UNCHANGED, 10, fixnum),
define_variable(glob_check_sign, 1.0, float),
define_variable(glob_desired_digits_correct, 8.0, float),
define_variable(glob_max_value3, 0.0, float),
define_variable(glob_ratio_of_radius, 0.01, float),
define_variable(glob_percent_done, 0.0, float),
define_variable(glob_subiter_method, 3, fixnum),
define_variable(glob_total_exp_sec, 0.1, float),
define_variable(glob_optimal_expect_sec, 0.1, float),
define_variable(glob_html_log, true, boolean),
define_variable(glob_good_digits, 0, fixnum),
define_variable(glob_max_opt_iter, 10, fixnum),
define_variable(glob_dump, false, boolean),
define_variable(glob_djd_debug, true, boolean),
define_variable(glob_display_flag, true, boolean),
define_variable(glob_djd_debug2, true, boolean),
define_variable(glob_sec_in_minute, 60, fixnum),
define_variable(glob_min_in_hour, 60, fixnum),
define_variable(glob_hours_in_day, 24, fixnum),
define_variable(glob_days_in_year, 365, fixnum),
define_variable(glob_sec_in_hour, 3600, fixnum),
define_variable(glob_sec_in_day, 86400, fixnum),
define_variable(glob_sec_in_year, 31536000, fixnum),
define_variable(glob_almost_1, 0.999, float),
define_variable(glob_clock_sec, 0.0, float),
define_variable(glob_clock_start_sec, 0.0, float),
define_variable(glob_not_yet_finished, true, boolean),
define_variable(glob_initial_pass, true, boolean),
define_variable(glob_not_yet_start_msg, true, boolean),
define_variable(glob_reached_optimal_h, false, boolean),
define_variable(glob_optimal_done, false, boolean),
define_variable(glob_disp_incr, 0.1, float),
define_variable(glob_h, 0.1, float), define_variable(glob_max_h, 0.1, float),
define_variable(glob_large_float, 9.0E+100, float),
define_variable(glob_last_good_h, 0.1, float),
define_variable(glob_look_poles, false, boolean),
define_variable(glob_neg_h, false, boolean),
define_variable(glob_display_interval, 0.0, float),
define_variable(glob_next_display, 0.0, float),
define_variable(glob_dump_analytic, false, boolean),
define_variable(glob_abserr, 1.0E-11, float),
define_variable(glob_relerr, 1.0E-11, float),
define_variable(glob_max_hours, 0.0, float),
define_variable(glob_max_iter, 1000, fixnum),
define_variable(glob_max_rel_trunc_err, 1.0E-11, float),
define_variable(glob_max_trunc_err, 1.0E-11, float),
define_variable(glob_no_eqs, 0, fixnum),
define_variable(glob_optimal_clock_start_sec, 0.0, float),
define_variable(glob_optimal_start, 0.0, float),
define_variable(glob_small_float, 1.0E-201, float),
define_variable(glob_smallish_float, 1.0E-101, float),
define_variable(glob_unchanged_h_cnt, 0, fixnum),
define_variable(glob_warned, false, boolean),
define_variable(glob_warned2, false, boolean),
define_variable(glob_max_sec, 10000.0, float),
define_variable(glob_orig_start_sec, 0.0, float),
define_variable(glob_start, 0, fixnum),
define_variable(glob_curr_iter_when_opt, 0, fixnum),
define_variable(glob_current_iter, 0, fixnum),
define_variable(glob_iter, 0, fixnum),
define_variable(glob_normmax, 0.0, float),
define_variable(glob_max_minutes, 0.0, float), ALWAYS : 1, INFO : 2,
DEBUGL : 3, DEBUGMASSIVE : 4, glob_iolevel : INFO,
glob_orig_start_sec : elapsed_time_seconds(), MAX_UNCHANGED : 10,
glob_curr_iter_when_opt : 0, glob_display_flag : true, 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/mtest6_rev_sm_hpostode.ode#################"),
omniout_str(ALWAYS, "diff (x2,t,2) = 3.0 * diff(x2,t,1) - 2.0 * x2 - diff(x1,t\
,2) - diff (x1,t,1)+x1;"), omniout_str(ALWAYS,
"diff (x1,t,1) = 4.0 * x2 - 2.0 * diff (x2,t ,1) - 2.0 * x1;"),
omniout_str(ALWAYS, "!"), omniout_str(ALWAYS,
"/* BEGIN FIRST INPUT BLOCK */"), omniout_str(ALWAYS, "Digits:64,"),
omniout_str(ALWAYS, "max_terms:30,"), omniout_str(ALWAYS, "!"),
omniout_str(ALWAYS, "/* END FIRST INPUT BLOCK */"),
omniout_str(ALWAYS, "/* BEGIN SECOND INPUT BLOCK */"),
omniout_str(ALWAYS, "/* # problem from Boyce DePrima - */"),
omniout_str(ALWAYS,
"/* # _Elementary Differential Equations and Boundary Value Problems_ */"),
omniout_str(ALWAYS, "/* # page 269 */"), omniout_str(ALWAYS, "/* # */"),
omniout_str(ALWAYS, "t_start:1.5,"), omniout_str(ALWAYS,
"/* # did poorly with t_start := 0.5; */"), omniout_str(ALWAYS, "t_end:5.0,"),
omniout_str(ALWAYS, "array_x1_init[0 + 1] : exact_soln_x1(t_start),"),
omniout_str(ALWAYS, "/* # I think following line should be omitted */"),
omniout_str(ALWAYS, "/* # diff(x1,1,exact_soln_x1p(t_start)); */"),
omniout_str(ALWAYS, "array_x2_init[0 + 1] : exact_soln_x2(t_start),"),
omniout_str(ALWAYS, "array_x2_init[1 + 1] : exact_soln_x2p(t_start),"),
omniout_str(ALWAYS, "glob_max_h:0.0000001,"),
omniout_str(ALWAYS, "glob_look_poles:true,"),
omniout_str(ALWAYS, "glob_max_iter:100,"),
omniout_str(ALWAYS, "/* END SECOND INPUT BLOCK */"),
omniout_str(ALWAYS, "/* BEGIN OVERRIDE BLOCK */"),
omniout_str(ALWAYS, "glob_desired_digits_correct:10,"),
omniout_str(ALWAYS, "glob_display_interval:0.001,"),
omniout_str(ALWAYS, "glob_look_poles:true,"),
omniout_str(ALWAYS, "glob_max_iter:10000000,"),
omniout_str(ALWAYS, "glob_max_minutes:3,"),
omniout_str(ALWAYS, "glob_subiter_method:3,"),
omniout_str(ALWAYS, "/* END OVERRIDE BLOCK */"), omniout_str(ALWAYS, "!"),
omniout_str(ALWAYS, "/* BEGIN USER DEF BLOCK */"),
omniout_str(ALWAYS, "exact_soln_x1 (t) := (block("),
omniout_str(ALWAYS, "[ c1,c2,c3],"), omniout_str(ALWAYS, "c1 : 1.0,"),
omniout_str(ALWAYS, "c2 : 0.0002,"), omniout_str(ALWAYS, "c3 : 0.0003,"),
omniout_str(ALWAYS, " (2.0 * c1 + 6.0 * c3 * exp(-t)) "),
omniout_str(ALWAYS, "));"), omniout_str(ALWAYS,
"exact_soln_x1p (t) := (block("), omniout_str(ALWAYS, "[ c1,c2,c3],"),
omniout_str(ALWAYS, "c1 : 1.0,"), omniout_str(ALWAYS, "c2 : 0.0002,"),
omniout_str(ALWAYS, "c3 : 0.0003,"), omniout_str(ALWAYS,
" ( - 6.0 * c3 * exp(-t)) "), omniout_str(ALWAYS, "));"),
omniout_str(ALWAYS, "exact_soln_x2 (t) := (block("),
omniout_str(ALWAYS, "[ c1,c2,c3],"), omniout_str(ALWAYS, "c1 : 1.0,"),
omniout_str(ALWAYS, "c2 : 0.0002,"), omniout_str(ALWAYS, "c3 : 0.0003,"),
omniout_str(ALWAYS, " (c1 + c2 * exp(2.0 * t) + c3 * exp(-t)) "),
omniout_str(ALWAYS, "));"), omniout_str(ALWAYS,
"exact_soln_x2p (t) := (block("), omniout_str(ALWAYS, "[ c1,c2,c3],"),
omniout_str(ALWAYS, "c1 : 1.0,"), omniout_str(ALWAYS, "c2 : 0.0002,"),
omniout_str(ALWAYS, "c3 : 0.0003,"), omniout_str(ALWAYS,
" ( 2.0 * c2 * exp(2.0 * t) - c3 * exp(-t)) "), omniout_str(ALWAYS, "));"),
omniout_str(ALWAYS, "/* END USER DEF BLOCK */"),
omniout_str(ALWAYS, "#######END OF ECHO OF PROBLEM#################"),
glob_unchanged_h_cnt : 0, glob_warned : false, glob_warned2 : false,
glob_small_float : 1.0E-200, glob_smallish_float : 1.0E-64,
glob_large_float : 1.0E+100, glob_almost_1 : 0.99, Digits : 64,
max_terms : 30, glob_max_terms : max_terms, glob_html_log : true,
array(array_x2_init, 1 + max_terms), array(array_x1_init, 1 + max_terms),
array(array_norms, 1 + max_terms), array(array_fact_1, 1 + max_terms),
array(array_pole, 1 + max_terms), array(array_1st_rel_error, 1 + max_terms),
array(array_last_rel_error, 1 + max_terms),
array(array_type_pole, 1 + max_terms), array(array_x2, 1 + max_terms),
array(array_t, 1 + max_terms), array(array_x1, 1 + max_terms),
array(array_tmp0, 1 + max_terms), array(array_tmp1, 1 + max_terms),
array(array_tmp2, 1 + max_terms), array(array_tmp3, 1 + max_terms),
array(array_tmp4, 1 + max_terms), array(array_tmp5, 1 + max_terms),
array(array_tmp6, 1 + max_terms), array(array_tmp7, 1 + max_terms),
array(array_tmp8, 1 + max_terms), array(array_tmp9, 1 + max_terms),
array(array_tmp10, 1 + max_terms), array(array_tmp11, 1 + max_terms),
array(array_tmp12, 1 + max_terms), array(array_tmp13, 1 + max_terms),
array(array_tmp14, 1 + max_terms), array(array_tmp15, 1 + max_terms),
array(array_tmp16, 1 + max_terms), array(array_tmp17, 1 + max_terms),
array(array_m1, 1 + max_terms), array(array_x2_higher, 1 + 3, 1 + max_terms),
array(array_x2_higher_work, 1 + 3, 1 + max_terms),
array(array_x2_higher_work2, 1 + 3, 1 + max_terms),
array(array_x2_set_initial, 1 + 3, 1 + max_terms),
array(array_x1_higher, 1 + 3, 1 + max_terms),
array(array_x1_higher_work, 1 + 3, 1 + max_terms),
array(array_x1_higher_work2, 1 + 3, 1 + max_terms),
array(array_x1_set_initial, 1 + 3, 1 + max_terms),
array(array_poles, 1 + 2, 1 + 3), array(array_real_pole, 1 + 2, 1 + 3),
array(array_complex_pole, 1 + 2, 1 + 3),
array(array_fact_2, 1 + max_terms, 1 + max_terms), term : 1,
while term <= max_terms do (array_x2_init : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_x1_init : 0.0,
term
term : 1 + term), term : 1, while term <=
max_terms do (array_norms : 0.0, term : 1 + term), term : 1,
term
while term <= max_terms do (array_fact_1 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_pole : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_1st_rel_error : 0.0,
term
term : 1 + term), term : 1, while term <=
max_terms do (array_last_rel_error : 0.0, term : 1 + term), term : 1,
term
while term <= max_terms do (array_type_pole : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_x2 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_t : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_x1 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp0 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp1 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp2 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp3 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp4 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp5 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp6 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp7 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp8 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp9 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp10 : 0.0,
term
term : 1 + term), term : 1, while term <=
max_terms do (array_tmp11 : 0.0, term : 1 + term), term : 1,
term
while term <= max_terms do (array_tmp12 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp13 : 0.0,
term
term : 1 + term), term : 1, while term <=
max_terms do (array_tmp14 : 0.0, term : 1 + term), term : 1,
term
while term <= max_terms do (array_tmp15 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp16 : 0.0,
term
term : 1 + term), term : 1, while term <=
max_terms do (array_tmp17 : 0.0, term : 1 + term), term : 1,
term
while term <= max_terms do (array_m1 : 0.0, term : 1 + term), ord : 1,
term
while ord <= 3 do (term : 1, while term <=
max_terms do (array_x2_higher : 0.0, term : 1 + term),
ord, term
ord : 1 + ord), ord : 1, while ord <= 3 do (term : 1,
while term <= max_terms do (array_x2_higher_work : 0.0,
ord, term
term : 1 + term), ord : 1 + ord), ord : 1,
while ord <= 3 do (term : 1, while term <=
max_terms do (array_x2_higher_work2 : 0.0, term : 1 + term),
ord, term
ord : 1 + ord), ord : 1, while ord <= 3 do (term : 1,
while term <= max_terms do (array_x2_set_initial : 0.0,
ord, term
term : 1 + term), ord : 1 + ord), ord : 1,
while ord <= 3 do (term : 1, while term <=
max_terms do (array_x1_higher : 0.0, term : 1 + term),
ord, term
ord : 1 + ord), ord : 1, while ord <= 3 do (term : 1,
while term <= max_terms do (array_x1_higher_work : 0.0,
ord, term
term : 1 + term), ord : 1 + ord), ord : 1,
while ord <= 3 do (term : 1, while term <=
max_terms do (array_x1_higher_work2 : 0.0, term : 1 + term),
ord, term
ord : 1 + ord), ord : 1, while ord <= 3 do (term : 1,
while term <= max_terms do (array_x1_set_initial : 0.0,
ord, term
term : 1 + term), ord : 1 + ord), ord : 1,
while ord <= 2 do (term : 1, while term <= 3 do (array_poles : 0.0,
ord, term
term : 1 + term), ord : 1 + ord), ord : 1,
while ord <= 2 do (term : 1, while term <=
3 do (array_real_pole : 0.0, term : 1 + term), ord : 1 + ord),
ord, term
ord : 1, while ord <= 2 do (term : 1,
while term <= 3 do (array_complex_pole : 0.0, term : 1 + term),
ord, term
ord : 1 + ord), ord : 1, while ord <= max_terms do (term : 1,
while term <= max_terms do (array_fact_2 : 0.0, term : 1 + term),
ord, term
ord : 1 + ord), array(array_x2, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_x2 : 0.0, term : 1 + term),
term
array(array_t, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_t : 0.0, term : 1 + term),
term
array(array_x1, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_x1 : 0.0, term : 1 + term),
term
array(array_tmp0, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp0 : 0.0, term : 1 + term),
term
array(array_tmp1, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp1 : 0.0, term : 1 + term),
term
array(array_tmp2, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp2 : 0.0, term : 1 + term),
term
array(array_tmp3, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp3 : 0.0, term : 1 + term),
term
array(array_tmp4, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp4 : 0.0, term : 1 + term),
term
array(array_tmp5, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp5 : 0.0, term : 1 + term),
term
array(array_tmp6, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp6 : 0.0, term : 1 + term),
term
array(array_tmp7, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp7 : 0.0, term : 1 + term),
term
array(array_tmp8, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp8 : 0.0, term : 1 + term),
term
array(array_tmp9, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp9 : 0.0, term : 1 + term),
term
array(array_tmp10, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp10 : 0.0, term : 1 + term),
term
array(array_tmp11, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp11 : 0.0, term : 1 + term),
term
array(array_tmp12, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp12 : 0.0, term : 1 + term),
term
array(array_tmp13, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp13 : 0.0, term : 1 + term),
term
array(array_tmp14, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp14 : 0.0, term : 1 + term),
term
array(array_tmp15, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp15 : 0.0, term : 1 + term),
term
array(array_tmp16, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp16 : 0.0, term : 1 + term),
term
array(array_tmp17, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp17 : 0.0, term : 1 + term),
term
array(array_m1, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_m1 : 0.0, term : 1 + term),
term
array(array_const_2, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_const_2 : 0.0, term : 1 + term),
term
array_const_2 : 2, array(array_const_0D0, 1 + 1 + max_terms), term : 1,
1
while term <= 1 + max_terms do (array_const_0D0 : 0.0, term : 1 + term),
term
array_const_0D0 : 0.0, array(array_const_3D0, 1 + 1 + max_terms), term : 1,
1
while term <= 1 + max_terms do (array_const_3D0 : 0.0, term : 1 + term),
term
array_const_3D0 : 3.0, array(array_const_1, 1 + 1 + max_terms), term : 1,
1
while term <= 1 + max_terms do (array_const_1 : 0.0, term : 1 + term),
term
array_const_1 : 1, array(array_const_2D0, 1 + 1 + max_terms), term : 1,
1
while term <= 1 + max_terms do (array_const_2D0 : 0.0, term : 1 + term),
term
array_const_2D0 : 2.0, array(array_const_4D0, 1 + 1 + max_terms), term : 1,
1
while term <= 1 + max_terms do (array_const_4D0 : 0.0, term : 1 + term),
term
array_const_4D0 : 4.0, array(array_m1, 1 + 1 + max_terms), term : 1,
1
while term <= max_terms do (array_m1 : 0.0, term : 1 + term),
term
array_m1 : - 1.0, iiif : 0, while iiif <= glob_max_terms do (jjjf : 0,
1
while jjjf <= glob_max_terms do (array_fact_1 : 0,
iiif
array_fact_2 : 0, jjjf : 1 + jjjf), iiif : 1 + iiif), t_start : 1.5,
iiif, jjjf
t_end : 5.0, array_x1_init : exact_soln_x1(t_start),
1 + 0
array_x2_init : exact_soln_x2(t_start),
1 + 0
array_x2_init : exact_soln_x2p(t_start), glob_max_h : 1.0E-7,
1 + 1
glob_look_poles : true, glob_max_iter : 100, glob_desired_digits_correct : 10,
glob_display_interval : 0.001, glob_look_poles : true,
glob_max_iter : 10000000, glob_max_minutes : 3, glob_subiter_method : 3,
glob_last_good_h : glob_h, glob_max_terms : max_terms,
glob_max_sec : convfloat(3600.0) convfloat(glob_max_hours)
+ convfloat(60.0) convfloat(glob_max_minutes),
if glob_h > 0.0 then (glob_neg_h : false,
glob_display_interval : omniabs(glob_display_interval))
else (glob_neg_h : true, glob_display_interval :
- omniabs(glob_display_interval)), chk_data(),
array_x2_set_initial : true, array_x2_set_initial : true,
1, 1 1, 2
array_x2_set_initial : false, array_x2_set_initial : false,
1, 3 1, 4
array_x2_set_initial : false, array_x2_set_initial : false,
1, 5 1, 6
array_x2_set_initial : false, array_x2_set_initial : false,
1, 7 1, 8
array_x2_set_initial : false, array_x2_set_initial : false,
1, 9 1, 10
array_x2_set_initial : false, array_x2_set_initial : false,
1, 11 1, 12
array_x2_set_initial : false, array_x2_set_initial : false,
1, 13 1, 14
array_x2_set_initial : false, array_x2_set_initial : false,
1, 15 1, 16
array_x2_set_initial : false, array_x2_set_initial : false,
1, 17 1, 18
array_x2_set_initial : false, array_x2_set_initial : false,
1, 19 1, 20
array_x2_set_initial : false, array_x2_set_initial : false,
1, 21 1, 22
array_x2_set_initial : false, array_x2_set_initial : false,
1, 23 1, 24
array_x2_set_initial : false, array_x2_set_initial : false,
1, 25 1, 26
array_x2_set_initial : false, array_x2_set_initial : false,
1, 27 1, 28
array_x2_set_initial : false, array_x2_set_initial : false,
1, 29 1, 30
array_x1_set_initial : true, array_x1_set_initial : false,
2, 1 2, 2
array_x1_set_initial : false, array_x1_set_initial : false,
2, 3 2, 4
array_x1_set_initial : false, array_x1_set_initial : false,
2, 5 2, 6
array_x1_set_initial : false, array_x1_set_initial : false,
2, 7 2, 8
array_x1_set_initial : false, array_x1_set_initial : false,
2, 9 2, 10
array_x1_set_initial : false, array_x1_set_initial : false,
2, 11 2, 12
array_x1_set_initial : false, array_x1_set_initial : false,
2, 13 2, 14
array_x1_set_initial : false, array_x1_set_initial : false,
2, 15 2, 16
array_x1_set_initial : false, array_x1_set_initial : false,
2, 17 2, 18
array_x1_set_initial : false, array_x1_set_initial : false,
2, 19 2, 20
array_x1_set_initial : false, array_x1_set_initial : false,
2, 21 2, 22
array_x1_set_initial : false, array_x1_set_initial : false,
2, 23 2, 24
array_x1_set_initial : false, array_x1_set_initial : false,
2, 25 2, 26
array_x1_set_initial : false, array_x1_set_initial : false,
2, 27 2, 28
array_x1_set_initial : false, array_x1_set_initial : false,
2, 29 2, 30
omniout_str(ALWAYS, "START of Optimize"),
glob_check_sign : check_sign(t_start, t_end),
glob_h : check_sign(t_start, t_end), if glob_display_interval < glob_h
then glob_h : glob_display_interval, if glob_max_h < glob_h
then glob_h : glob_max_h, found_h : - 1.0, best_h : 0.0,
min_value : glob_large_float, est_answer : est_size_answer(), opt_iter : 1,
while (opt_iter <= 20) and (found_h < 0.0) do (omniout_int(ALWAYS,
"opt_iter", 32, opt_iter, 4, ""), array_t : t_start, array_t : glob_h,
1 2
glob_next_display : t_start, order_diff : 2, term_no : 1,
while term_no <= order_diff do (array_x2 :
term_no
array_x2_init expt(glob_h, term_no - 1)
term_no
----------------------------------------------, term_no : 1 + term_no),
factorial_1(term_no - 1)
rows : order_diff, r_order : 1, while r_order <= rows do (term_no : 1,
while term_no <= 1 - r_order + rows do (it : - 1 + r_order + term_no,
array_x2_init expt(glob_h, term_no - 1)
it
array_x2_higher : -----------------------------------------,
r_order, term_no factorial_1(term_no - 1)
term_no : 1 + term_no), r_order : 1 + r_order), order_diff : 2, term_no : 1,
while term_no <= order_diff do (array_x1 :
term_no
array_x1_init expt(glob_h, term_no - 1)
term_no
----------------------------------------------, term_no : 1 + term_no),
factorial_1(term_no - 1)
rows : order_diff, r_order : 1, while r_order <= rows do (term_no : 1,
while term_no <= 1 - r_order + rows do (it : - 1 + r_order + term_no,
array_x1_init expt(glob_h, term_no - 1)
it
array_x1_higher : -----------------------------------------,
r_order, term_no factorial_1(term_no - 1)
term_no : 1 + term_no), r_order : 1 + r_order),
if glob_subiter_method = 1 then atomall() elseif glob_subiter_method = 2
then (subiter : 1, while subiter <= 3 do (atomall(), subiter : 1 + subiter))
else (subiter : 1, while subiter <= glob_max_terms + 3 do (atomall(),
subiter : 1 + subiter)), est_needed_step_err :
estimated_needed_step_error(t_start, t_end, glob_h, est_answer),
omniout_float(ALWAYS, "est_needed_step_err", 32, est_needed_step_err, 16, ""),
value3 : test_suggested_h(), omniout_float(ALWAYS, "value3", 32, value3, 32,
""), if (value3 < est_needed_step_err) and (found_h < 0.0)
then (best_h : glob_h, found_h : 1.0),
omniout_float(ALWAYS, "best_h", 32, best_h, 32, ""), opt_iter : 1 + opt_iter,
glob_h : glob_h 0.5), if found_h > 0.0 then glob_h : best_h
else omniout_str(ALWAYS, "No increment to obtain desired accuracy found"),
if glob_html_log then html_log_file : openw("html/entry.html"),
if found_h > 0.0 then (omniout_str(ALWAYS, "START of Soultion"),
array_t : t_start, array_t : glob_h, glob_next_display : t_start,
1 2
order_diff : 2, term_no : 1, while term_no <=
order_diff do (array_x2 :
term_no
array_x2_init expt(glob_h, term_no - 1)
term_no
----------------------------------------------, term_no : 1 + term_no),
factorial_1(term_no - 1)
rows : order_diff, r_order : 1, while r_order <= rows do (term_no : 1,
while term_no <= 1 - r_order + rows do (it : - 1 + r_order + term_no,
array_x2_init expt(glob_h, term_no - 1)
it
array_x2_higher : -----------------------------------------,
r_order, term_no factorial_1(term_no - 1)
term_no : 1 + term_no), r_order : 1 + r_order), order_diff : 2, term_no : 1,
while term_no <= order_diff do (array_x1 :
term_no
array_x1_init expt(glob_h, term_no - 1)
term_no
----------------------------------------------, term_no : 1 + term_no),
factorial_1(term_no - 1)
rows : order_diff, r_order : 1, while r_order <= rows do (term_no : 1,
while term_no <= 1 - r_order + rows do (it : - 1 + r_order + term_no,
array_x1_init expt(glob_h, term_no - 1)
it
array_x1_higher : -----------------------------------------,
r_order, term_no factorial_1(term_no - 1)
term_no : 1 + term_no), r_order : 1 + r_order), current_iter : 1,
glob_clock_start_sec : elapsed_time_seconds(),
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 (glob_check_sign array_t < glob_check_sign t_end)
1
and (convfloat(glob_clock_sec) - convfloat(glob_orig_start_sec) < convfloat(glob_max_sec)) do (if reached_interval
() then (omniout_str(INFO, " "), omniout_str(INFO, "TOP MAIN SOLVE Loop")),
glob_iter : 1 + glob_iter, glob_clock_sec : elapsed_time_seconds(),
glob_current_iter : 1 + glob_current_iter,
if glob_subiter_method = 1 then atomall() elseif glob_subiter_method = 2
then (subiter : 1, while subiter <= 3 do (atomall(), subiter : 1 + subiter))
else (subiter : 1, while subiter <= glob_max_terms + 3 do (atomall(),
subiter : 1 + subiter)), display_alot(current_iter),
if glob_look_poles then check_for_pole(),
if reached_interval() then glob_next_display :
glob_display_interval + glob_next_display, array_t : glob_h + array_t ,
1 1
array_t : glob_h, order_diff : 3, ord : 3, calc_term : 1,
2
iii : glob_max_terms, while iii >= calc_term do (array_x2_higher_work :
3, iii
array_x2_higher
3, iii
---------------------------
expt(glob_h, calc_term - 1)
-------------------------------------, iii : iii - 1), temp_sum : 0.0,
factorial_3(iii - calc_term, iii - 1)
ord : 3, calc_term : 1, iii : glob_max_terms,
while iii >= calc_term do (temp_sum :
array_x2_higher_work + temp_sum, iii : iii - 1),
ord, iii
temp_sum expt(glob_h, calc_term - 1)
array_x2_higher_work2 : ------------------------------------,
ord, calc_term factorial_1(calc_term - 1)
ord : 2, calc_term : 2, iii : glob_max_terms,
while iii >= calc_term do (array_x2_higher_work :
2, iii
array_x2_higher
2, iii
---------------------------
expt(glob_h, calc_term - 1)
-------------------------------------, iii : iii - 1), temp_sum : 0.0,
factorial_3(iii - calc_term, iii - 1)
ord : 2, calc_term : 2, iii : glob_max_terms,
while iii >= calc_term do (temp_sum :
array_x2_higher_work + temp_sum, iii : iii - 1),
ord, iii
temp_sum expt(glob_h, calc_term - 1)
array_x2_higher_work2 : ------------------------------------,
ord, calc_term factorial_1(calc_term - 1)
ord : 2, calc_term : 1, iii : glob_max_terms,
while iii >= calc_term do (array_x2_higher_work :
2, iii
array_x2_higher
2, iii
---------------------------
expt(glob_h, calc_term - 1)
-------------------------------------, iii : iii - 1), temp_sum : 0.0,
factorial_3(iii - calc_term, iii - 1)
ord : 2, calc_term : 1, iii : glob_max_terms,
while iii >= calc_term do (temp_sum :
array_x2_higher_work + temp_sum, iii : iii - 1),
ord, iii
temp_sum expt(glob_h, calc_term - 1)
array_x2_higher_work2 : ------------------------------------,
ord, calc_term factorial_1(calc_term - 1)
ord : 1, calc_term : 3, iii : glob_max_terms,
while iii >= calc_term do (array_x2_higher_work :
1, iii
array_x2_higher
1, iii
---------------------------
expt(glob_h, calc_term - 1)
-------------------------------------, iii : iii - 1), temp_sum : 0.0,
factorial_3(iii - calc_term, iii - 1)
ord : 1, calc_term : 3, iii : glob_max_terms,
while iii >= calc_term do (temp_sum :
array_x2_higher_work + temp_sum, iii : iii - 1),
ord, iii
temp_sum expt(glob_h, calc_term - 1)
array_x2_higher_work2 : ------------------------------------,
ord, calc_term factorial_1(calc_term - 1)
ord : 1, calc_term : 2, iii : glob_max_terms,
while iii >= calc_term do (array_x2_higher_work :
1, iii
array_x2_higher
1, iii
---------------------------
expt(glob_h, calc_term - 1)
-------------------------------------, iii : iii - 1), temp_sum : 0.0,
factorial_3(iii - calc_term, iii - 1)
ord : 1, calc_term : 2, iii : glob_max_terms,
while iii >= calc_term do (temp_sum :
array_x2_higher_work + temp_sum, iii : iii - 1),
ord, iii
temp_sum expt(glob_h, calc_term - 1)
array_x2_higher_work2 : ------------------------------------,
ord, calc_term factorial_1(calc_term - 1)
ord : 1, calc_term : 1, iii : glob_max_terms,
while iii >= calc_term do (array_x2_higher_work :
1, iii
array_x2_higher
1, iii
---------------------------
expt(glob_h, calc_term - 1)
-------------------------------------, iii : iii - 1), temp_sum : 0.0,
factorial_3(iii - calc_term, iii - 1)
ord : 1, calc_term : 1, iii : glob_max_terms,
while iii >= calc_term do (temp_sum :
array_x2_higher_work + temp_sum, iii : iii - 1),
ord, iii
temp_sum expt(glob_h, calc_term - 1)
array_x2_higher_work2 : ------------------------------------,
ord, calc_term factorial_1(calc_term - 1)
term_no : glob_max_terms, while term_no >=
1 do (array_x2 : array_x2_higher_work2 , ord : 1,
term_no 1, term_no
while ord <= order_diff do (array_x2_higher :
ord, term_no
array_x2_higher_work2 , ord : 1 + ord), term_no : term_no - 1),
ord, term_no
order_diff : 2, ord : 2, calc_term : 1, iii : glob_max_terms,
while iii >= calc_term do (array_x1_higher_work :
2, iii
array_x1_higher
2, iii
---------------------------
expt(glob_h, calc_term - 1)
-------------------------------------, iii : iii - 1), temp_sum : 0.0,
factorial_3(iii - calc_term, iii - 1)
ord : 2, calc_term : 1, iii : glob_max_terms,
while iii >= calc_term do (temp_sum :
array_x1_higher_work + temp_sum, iii : iii - 1),
ord, iii
temp_sum expt(glob_h, calc_term - 1)
array_x1_higher_work2 : ------------------------------------,
ord, calc_term factorial_1(calc_term - 1)
ord : 1, calc_term : 2, iii : glob_max_terms,
while iii >= calc_term do (array_x1_higher_work :
1, iii
array_x1_higher
1, iii
---------------------------
expt(glob_h, calc_term - 1)
-------------------------------------, iii : iii - 1), temp_sum : 0.0,
factorial_3(iii - calc_term, iii - 1)
ord : 1, calc_term : 2, iii : glob_max_terms,
while iii >= calc_term do (temp_sum :
array_x1_higher_work + temp_sum, iii : iii - 1),
ord, iii
temp_sum expt(glob_h, calc_term - 1)
array_x1_higher_work2 : ------------------------------------,
ord, calc_term factorial_1(calc_term - 1)
ord : 1, calc_term : 1, iii : glob_max_terms,
while iii >= calc_term do (array_x1_higher_work :
1, iii
array_x1_higher
1, iii
---------------------------
expt(glob_h, calc_term - 1)
-------------------------------------, iii : iii - 1), temp_sum : 0.0,
factorial_3(iii - calc_term, iii - 1)
ord : 1, calc_term : 1, iii : glob_max_terms,
while iii >= calc_term do (temp_sum :
array_x1_higher_work + temp_sum, iii : iii - 1),
ord, iii
temp_sum expt(glob_h, calc_term - 1)
array_x1_higher_work2 : ------------------------------------,
ord, calc_term factorial_1(calc_term - 1)
term_no : glob_max_terms, while term_no >=
1 do (array_x1 : array_x1_higher_work2 , ord : 1,
term_no 1, term_no
while ord <= order_diff do (array_x1_higher :
ord, term_no
array_x1_higher_work2 , ord : 1 + ord), term_no : term_no - 1)),
ord, term_no
omniout_str(ALWAYS, "Finished!"), if glob_iter >= glob_max_iter
then omniout_str(ALWAYS,
"Maximum Iterations Reached before Solution Completed!"),
if elapsed_time_seconds() - convfloat(glob_orig_start_sec) >=
convfloat(glob_max_sec) then omniout_str(ALWAYS,
"Maximum Time Reached before Solution Completed!"),
glob_clock_sec : elapsed_time_seconds(), omniout_str(INFO, "diff (x2,t,2) = 3.\
0 * diff(x2,t,1) - 2.0 * x2 - diff(x1,t,2) - diff (x1,t,1)+x1;"),
omniout_str(INFO,
"diff (x1,t,1) = 4.0 * x2 - 2.0 * diff (x2,t ,1) - 2.0 * x1;"),
omniout_int(INFO, "Iterations ", 32, glob_iter, 4, " "),
prog_report(t_start, t_end), if glob_html_log
then (logstart(html_log_file), logitem_str(html_log_file,
"2013-01-28T17:26:04-06:00"), logitem_str(html_log_file, "Maxima"),
logitem_str(html_log_file,
"mtest6_rev_sm_h"),
logitem_str(html_log_file, "diff (x2,t,2) = 3.0 * diff(x2,t,1) - 2.0 * x2 - di\
ff(x1,t,2) - diff (x1,t,1)+x1;"), logitem_float(html_log_file, t_start),
logitem_float(html_log_file, t_end), logitem_float(html_log_file, array_t ),
1
logitem_float(html_log_file, glob_h), logitem_str(html_log_file, "16"),
logitem_good_digits(html_log_file, array_last_rel_error ),
1
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) or (array_type_pole = 2)
1 1
then (logitem_float(html_log_file, array_pole ),
1
logitem_float(html_log_file, array_pole ), 0)
2
else (logitem_str(html_log_file, "NA"), logitem_str(html_log_file, "NA"), 0),
logitem_time(html_log_file, convfloat(glob_clock_sec)),
if glob_percent_done < 100.0 then (logitem_time(html_log_file,
convfloat(glob_total_exp_sec)), 0) else (logitem_str(html_log_file, "Done"),
0), log_revs(html_log_file, " 165 | "), logitem_str(html_log_file, "mtest6_rev_sm_h diffeq.max"),
logitem_str(html_log_file, "mtest6_r\
ev_sm_h maxima results"), logitem_str(html_log_file,
"All Tests - All Languages"), logend(html_log_file), logditto(html_log_file),
logditto(html_log_file), logditto(html_log_file), logitem_str(html_log_file, "\
diff (x1,t,1) = 4.0 * x2 - 2.0 * diff (x2,t ,1) - 2.0 * x1;"),
logditto(html_log_file), logditto(html_log_file), logditto(html_log_file),
logditto(html_log_file), logditto(html_log_file),
logitem_good_digits(html_log_file, array_last_rel_error ),
2
logditto(html_log_file), logitem_float(html_log_file, array_1st_rel_error ),
2
logitem_float(html_log_file, array_last_rel_error ), logditto(html_log_file),
2
logitem_pole(html_log_file, array_type_pole ),
2
if (array_type_pole = 1) or (array_type_pole = 2)
2 2
then (logitem_float(html_log_file, array_pole ),
1
logitem_float(html_log_file, array_pole ), 0)
2
else (logitem_str(html_log_file, "NA"), logitem_str(html_log_file, "NA"), 0),
logditto(html_log_file), if glob_percent_done < 100.0
then (logditto(html_log_file), 0) else (logditto(html_log_file), 0),
logditto(html_log_file), logditto(html_log_file), logditto(html_log_file),
logditto(html_log_file), logend(html_log_file)),
if glob_html_log then close(html_log_file)))
(%o60) main() := block([d1, d2, d3, d4, est_err_2, niii, done_once, term, ord,
order_diff, term_no, html_log_file, iiif, jjjf, rows, r_order, sub_iter,
calc_term, iii, temp_sum, current_iter, t_start, t_end, it, max_terms,
opt_iter, tmp, subiter, est_needed_step_err, value3, min_value, est_answer,
best_h, found_h, repeat_it], define_variable(glob_max_terms, 30, fixnum),
define_variable(glob_iolevel, 5, fixnum), define_variable(ALWAYS, 1, fixnum),
define_variable(INFO, 2, fixnum), define_variable(DEBUGL, 3, fixnum),
define_variable(DEBUGMASSIVE, 4, fixnum),
define_variable(MAX_UNCHANGED, 10, fixnum),
define_variable(glob_check_sign, 1.0, float),
define_variable(glob_desired_digits_correct, 8.0, float),
define_variable(glob_max_value3, 0.0, float),
define_variable(glob_ratio_of_radius, 0.01, float),
define_variable(glob_percent_done, 0.0, float),
define_variable(glob_subiter_method, 3, fixnum),
define_variable(glob_total_exp_sec, 0.1, float),
define_variable(glob_optimal_expect_sec, 0.1, float),
define_variable(glob_html_log, true, boolean),
define_variable(glob_good_digits, 0, fixnum),
define_variable(glob_max_opt_iter, 10, fixnum),
define_variable(glob_dump, false, boolean),
define_variable(glob_djd_debug, true, boolean),
define_variable(glob_display_flag, true, boolean),
define_variable(glob_djd_debug2, true, boolean),
define_variable(glob_sec_in_minute, 60, fixnum),
define_variable(glob_min_in_hour, 60, fixnum),
define_variable(glob_hours_in_day, 24, fixnum),
define_variable(glob_days_in_year, 365, fixnum),
define_variable(glob_sec_in_hour, 3600, fixnum),
define_variable(glob_sec_in_day, 86400, fixnum),
define_variable(glob_sec_in_year, 31536000, fixnum),
define_variable(glob_almost_1, 0.999, float),
define_variable(glob_clock_sec, 0.0, float),
define_variable(glob_clock_start_sec, 0.0, float),
define_variable(glob_not_yet_finished, true, boolean),
define_variable(glob_initial_pass, true, boolean),
define_variable(glob_not_yet_start_msg, true, boolean),
define_variable(glob_reached_optimal_h, false, boolean),
define_variable(glob_optimal_done, false, boolean),
define_variable(glob_disp_incr, 0.1, float),
define_variable(glob_h, 0.1, float), define_variable(glob_max_h, 0.1, float),
define_variable(glob_large_float, 9.0E+100, float),
define_variable(glob_last_good_h, 0.1, float),
define_variable(glob_look_poles, false, boolean),
define_variable(glob_neg_h, false, boolean),
define_variable(glob_display_interval, 0.0, float),
define_variable(glob_next_display, 0.0, float),
define_variable(glob_dump_analytic, false, boolean),
define_variable(glob_abserr, 1.0E-11, float),
define_variable(glob_relerr, 1.0E-11, float),
define_variable(glob_max_hours, 0.0, float),
define_variable(glob_max_iter, 1000, fixnum),
define_variable(glob_max_rel_trunc_err, 1.0E-11, float),
define_variable(glob_max_trunc_err, 1.0E-11, float),
define_variable(glob_no_eqs, 0, fixnum),
define_variable(glob_optimal_clock_start_sec, 0.0, float),
define_variable(glob_optimal_start, 0.0, float),
define_variable(glob_small_float, 1.0E-201, float),
define_variable(glob_smallish_float, 1.0E-101, float),
define_variable(glob_unchanged_h_cnt, 0, fixnum),
define_variable(glob_warned, false, boolean),
define_variable(glob_warned2, false, boolean),
define_variable(glob_max_sec, 10000.0, float),
define_variable(glob_orig_start_sec, 0.0, float),
define_variable(glob_start, 0, fixnum),
define_variable(glob_curr_iter_when_opt, 0, fixnum),
define_variable(glob_current_iter, 0, fixnum),
define_variable(glob_iter, 0, fixnum),
define_variable(glob_normmax, 0.0, float),
define_variable(glob_max_minutes, 0.0, float), ALWAYS : 1, INFO : 2,
DEBUGL : 3, DEBUGMASSIVE : 4, glob_iolevel : INFO,
glob_orig_start_sec : elapsed_time_seconds(), MAX_UNCHANGED : 10,
glob_curr_iter_when_opt : 0, glob_display_flag : true, 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/mtest6_rev_sm_hpostode.ode#################"),
omniout_str(ALWAYS, "diff (x2,t,2) = 3.0 * diff(x2,t,1) - 2.0 * x2 - diff(x1,t\
,2) - diff (x1,t,1)+x1;"), omniout_str(ALWAYS,
"diff (x1,t,1) = 4.0 * x2 - 2.0 * diff (x2,t ,1) - 2.0 * x1;"),
omniout_str(ALWAYS, "!"), omniout_str(ALWAYS,
"/* BEGIN FIRST INPUT BLOCK */"), omniout_str(ALWAYS, "Digits:64,"),
omniout_str(ALWAYS, "max_terms:30,"), omniout_str(ALWAYS, "!"),
omniout_str(ALWAYS, "/* END FIRST INPUT BLOCK */"),
omniout_str(ALWAYS, "/* BEGIN SECOND INPUT BLOCK */"),
omniout_str(ALWAYS, "/* # problem from Boyce DePrima - */"),
omniout_str(ALWAYS,
"/* # _Elementary Differential Equations and Boundary Value Problems_ */"),
omniout_str(ALWAYS, "/* # page 269 */"), omniout_str(ALWAYS, "/* # */"),
omniout_str(ALWAYS, "t_start:1.5,"), omniout_str(ALWAYS,
"/* # did poorly with t_start := 0.5; */"), omniout_str(ALWAYS, "t_end:5.0,"),
omniout_str(ALWAYS, "array_x1_init[0 + 1] : exact_soln_x1(t_start),"),
omniout_str(ALWAYS, "/* # I think following line should be omitted */"),
omniout_str(ALWAYS, "/* # diff(x1,1,exact_soln_x1p(t_start)); */"),
omniout_str(ALWAYS, "array_x2_init[0 + 1] : exact_soln_x2(t_start),"),
omniout_str(ALWAYS, "array_x2_init[1 + 1] : exact_soln_x2p(t_start),"),
omniout_str(ALWAYS, "glob_max_h:0.0000001,"),
omniout_str(ALWAYS, "glob_look_poles:true,"),
omniout_str(ALWAYS, "glob_max_iter:100,"),
omniout_str(ALWAYS, "/* END SECOND INPUT BLOCK */"),
omniout_str(ALWAYS, "/* BEGIN OVERRIDE BLOCK */"),
omniout_str(ALWAYS, "glob_desired_digits_correct:10,"),
omniout_str(ALWAYS, "glob_display_interval:0.001,"),
omniout_str(ALWAYS, "glob_look_poles:true,"),
omniout_str(ALWAYS, "glob_max_iter:10000000,"),
omniout_str(ALWAYS, "glob_max_minutes:3,"),
omniout_str(ALWAYS, "glob_subiter_method:3,"),
omniout_str(ALWAYS, "/* END OVERRIDE BLOCK */"), omniout_str(ALWAYS, "!"),
omniout_str(ALWAYS, "/* BEGIN USER DEF BLOCK */"),
omniout_str(ALWAYS, "exact_soln_x1 (t) := (block("),
omniout_str(ALWAYS, "[ c1,c2,c3],"), omniout_str(ALWAYS, "c1 : 1.0,"),
omniout_str(ALWAYS, "c2 : 0.0002,"), omniout_str(ALWAYS, "c3 : 0.0003,"),
omniout_str(ALWAYS, " (2.0 * c1 + 6.0 * c3 * exp(-t)) "),
omniout_str(ALWAYS, "));"), omniout_str(ALWAYS,
"exact_soln_x1p (t) := (block("), omniout_str(ALWAYS, "[ c1,c2,c3],"),
omniout_str(ALWAYS, "c1 : 1.0,"), omniout_str(ALWAYS, "c2 : 0.0002,"),
omniout_str(ALWAYS, "c3 : 0.0003,"), omniout_str(ALWAYS,
" ( - 6.0 * c3 * exp(-t)) "), omniout_str(ALWAYS, "));"),
omniout_str(ALWAYS, "exact_soln_x2 (t) := (block("),
omniout_str(ALWAYS, "[ c1,c2,c3],"), omniout_str(ALWAYS, "c1 : 1.0,"),
omniout_str(ALWAYS, "c2 : 0.0002,"), omniout_str(ALWAYS, "c3 : 0.0003,"),
omniout_str(ALWAYS, " (c1 + c2 * exp(2.0 * t) + c3 * exp(-t)) "),
omniout_str(ALWAYS, "));"), omniout_str(ALWAYS,
"exact_soln_x2p (t) := (block("), omniout_str(ALWAYS, "[ c1,c2,c3],"),
omniout_str(ALWAYS, "c1 : 1.0,"), omniout_str(ALWAYS, "c2 : 0.0002,"),
omniout_str(ALWAYS, "c3 : 0.0003,"), omniout_str(ALWAYS,
" ( 2.0 * c2 * exp(2.0 * t) - c3 * exp(-t)) "), omniout_str(ALWAYS, "));"),
omniout_str(ALWAYS, "/* END USER DEF BLOCK */"),
omniout_str(ALWAYS, "#######END OF ECHO OF PROBLEM#################"),
glob_unchanged_h_cnt : 0, glob_warned : false, glob_warned2 : false,
glob_small_float : 1.0E-200, glob_smallish_float : 1.0E-64,
glob_large_float : 1.0E+100, glob_almost_1 : 0.99, Digits : 64,
max_terms : 30, glob_max_terms : max_terms, glob_html_log : true,
array(array_x2_init, 1 + max_terms), array(array_x1_init, 1 + max_terms),
array(array_norms, 1 + max_terms), array(array_fact_1, 1 + max_terms),
array(array_pole, 1 + max_terms), array(array_1st_rel_error, 1 + max_terms),
array(array_last_rel_error, 1 + max_terms),
array(array_type_pole, 1 + max_terms), array(array_x2, 1 + max_terms),
array(array_t, 1 + max_terms), array(array_x1, 1 + max_terms),
array(array_tmp0, 1 + max_terms), array(array_tmp1, 1 + max_terms),
array(array_tmp2, 1 + max_terms), array(array_tmp3, 1 + max_terms),
array(array_tmp4, 1 + max_terms), array(array_tmp5, 1 + max_terms),
array(array_tmp6, 1 + max_terms), array(array_tmp7, 1 + max_terms),
array(array_tmp8, 1 + max_terms), array(array_tmp9, 1 + max_terms),
array(array_tmp10, 1 + max_terms), array(array_tmp11, 1 + max_terms),
array(array_tmp12, 1 + max_terms), array(array_tmp13, 1 + max_terms),
array(array_tmp14, 1 + max_terms), array(array_tmp15, 1 + max_terms),
array(array_tmp16, 1 + max_terms), array(array_tmp17, 1 + max_terms),
array(array_m1, 1 + max_terms), array(array_x2_higher, 1 + 3, 1 + max_terms),
array(array_x2_higher_work, 1 + 3, 1 + max_terms),
array(array_x2_higher_work2, 1 + 3, 1 + max_terms),
array(array_x2_set_initial, 1 + 3, 1 + max_terms),
array(array_x1_higher, 1 + 3, 1 + max_terms),
array(array_x1_higher_work, 1 + 3, 1 + max_terms),
array(array_x1_higher_work2, 1 + 3, 1 + max_terms),
array(array_x1_set_initial, 1 + 3, 1 + max_terms),
array(array_poles, 1 + 2, 1 + 3), array(array_real_pole, 1 + 2, 1 + 3),
array(array_complex_pole, 1 + 2, 1 + 3),
array(array_fact_2, 1 + max_terms, 1 + max_terms), term : 1,
while term <= max_terms do (array_x2_init : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_x1_init : 0.0,
term
term : 1 + term), term : 1, while term <=
max_terms do (array_norms : 0.0, term : 1 + term), term : 1,
term
while term <= max_terms do (array_fact_1 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_pole : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_1st_rel_error : 0.0,
term
term : 1 + term), term : 1, while term <=
max_terms do (array_last_rel_error : 0.0, term : 1 + term), term : 1,
term
while term <= max_terms do (array_type_pole : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_x2 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_t : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_x1 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp0 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp1 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp2 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp3 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp4 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp5 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp6 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp7 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp8 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp9 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp10 : 0.0,
term
term : 1 + term), term : 1, while term <=
max_terms do (array_tmp11 : 0.0, term : 1 + term), term : 1,
term
while term <= max_terms do (array_tmp12 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp13 : 0.0,
term
term : 1 + term), term : 1, while term <=
max_terms do (array_tmp14 : 0.0, term : 1 + term), term : 1,
term
while term <= max_terms do (array_tmp15 : 0.0, term : 1 + term),
term
term : 1, while term <= max_terms do (array_tmp16 : 0.0,
term
term : 1 + term), term : 1, while term <=
max_terms do (array_tmp17 : 0.0, term : 1 + term), term : 1,
term
while term <= max_terms do (array_m1 : 0.0, term : 1 + term), ord : 1,
term
while ord <= 3 do (term : 1, while term <=
max_terms do (array_x2_higher : 0.0, term : 1 + term),
ord, term
ord : 1 + ord), ord : 1, while ord <= 3 do (term : 1,
while term <= max_terms do (array_x2_higher_work : 0.0,
ord, term
term : 1 + term), ord : 1 + ord), ord : 1,
while ord <= 3 do (term : 1, while term <=
max_terms do (array_x2_higher_work2 : 0.0, term : 1 + term),
ord, term
ord : 1 + ord), ord : 1, while ord <= 3 do (term : 1,
while term <= max_terms do (array_x2_set_initial : 0.0,
ord, term
term : 1 + term), ord : 1 + ord), ord : 1,
while ord <= 3 do (term : 1, while term <=
max_terms do (array_x1_higher : 0.0, term : 1 + term),
ord, term
ord : 1 + ord), ord : 1, while ord <= 3 do (term : 1,
while term <= max_terms do (array_x1_higher_work : 0.0,
ord, term
term : 1 + term), ord : 1 + ord), ord : 1,
while ord <= 3 do (term : 1, while term <=
max_terms do (array_x1_higher_work2 : 0.0, term : 1 + term),
ord, term
ord : 1 + ord), ord : 1, while ord <= 3 do (term : 1,
while term <= max_terms do (array_x1_set_initial : 0.0,
ord, term
term : 1 + term), ord : 1 + ord), ord : 1,
while ord <= 2 do (term : 1, while term <= 3 do (array_poles : 0.0,
ord, term
term : 1 + term), ord : 1 + ord), ord : 1,
while ord <= 2 do (term : 1, while term <=
3 do (array_real_pole : 0.0, term : 1 + term), ord : 1 + ord),
ord, term
ord : 1, while ord <= 2 do (term : 1,
while term <= 3 do (array_complex_pole : 0.0, term : 1 + term),
ord, term
ord : 1 + ord), ord : 1, while ord <= max_terms do (term : 1,
while term <= max_terms do (array_fact_2 : 0.0, term : 1 + term),
ord, term
ord : 1 + ord), array(array_x2, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_x2 : 0.0, term : 1 + term),
term
array(array_t, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_t : 0.0, term : 1 + term),
term
array(array_x1, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_x1 : 0.0, term : 1 + term),
term
array(array_tmp0, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp0 : 0.0, term : 1 + term),
term
array(array_tmp1, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp1 : 0.0, term : 1 + term),
term
array(array_tmp2, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp2 : 0.0, term : 1 + term),
term
array(array_tmp3, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp3 : 0.0, term : 1 + term),
term
array(array_tmp4, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp4 : 0.0, term : 1 + term),
term
array(array_tmp5, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp5 : 0.0, term : 1 + term),
term
array(array_tmp6, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp6 : 0.0, term : 1 + term),
term
array(array_tmp7, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp7 : 0.0, term : 1 + term),
term
array(array_tmp8, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp8 : 0.0, term : 1 + term),
term
array(array_tmp9, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp9 : 0.0, term : 1 + term),
term
array(array_tmp10, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp10 : 0.0, term : 1 + term),
term
array(array_tmp11, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp11 : 0.0, term : 1 + term),
term
array(array_tmp12, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp12 : 0.0, term : 1 + term),
term
array(array_tmp13, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp13 : 0.0, term : 1 + term),
term
array(array_tmp14, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp14 : 0.0, term : 1 + term),
term
array(array_tmp15, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp15 : 0.0, term : 1 + term),
term
array(array_tmp16, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp16 : 0.0, term : 1 + term),
term
array(array_tmp17, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_tmp17 : 0.0, term : 1 + term),
term
array(array_m1, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_m1 : 0.0, term : 1 + term),
term
array(array_const_2, 1 + 1 + max_terms), term : 1,
while term <= 1 + max_terms do (array_const_2 : 0.0, term : 1 + term),
term
array_const_2 : 2, array(array_const_0D0, 1 + 1 + max_terms), term : 1,
1
while term <= 1 + max_terms do (array_const_0D0 : 0.0, term : 1 + term),
term
array_const_0D0 : 0.0, array(array_const_3D0, 1 + 1 + max_terms), term : 1,
1
while term <= 1 + max_terms do (array_const_3D0 : 0.0, term : 1 + term),
term
array_const_3D0 : 3.0, array(array_const_1, 1 + 1 + max_terms), term : 1,
1
while term <= 1 + max_terms do (array_const_1 : 0.0, term : 1 + term),
term
array_const_1 : 1, array(array_const_2D0, 1 + 1 + max_terms), term : 1,
1
while term <= 1 + max_terms do (array_const_2D0 : 0.0, term : 1 + term),
term
array_const_2D0 : 2.0, array(array_const_4D0, 1 + 1 + max_terms), term : 1,
1
while term <= 1 + max_terms do (array_const_4D0 : 0.0, term : 1 + term),
term
array_const_4D0 : 4.0, array(array_m1, 1 + 1 + max_terms), term : 1,
1
while term <= max_terms do (array_m1 : 0.0, term : 1 + term),
term
array_m1 : - 1.0, iiif : 0, while iiif <= glob_max_terms do (jjjf : 0,
1
while jjjf <= glob_max_terms do (array_fact_1 : 0,
iiif
array_fact_2 : 0, jjjf : 1 + jjjf), iiif : 1 + iiif), t_start : 1.5,
iiif, jjjf
t_end : 5.0, array_x1_init : exact_soln_x1(t_start),
1 + 0
array_x2_init : exact_soln_x2(t_start),
1 + 0
array_x2_init : exact_soln_x2p(t_start), glob_max_h : 1.0E-7,
1 + 1
glob_look_poles : true, glob_max_iter : 100, glob_desired_digits_correct : 10,
glob_display_interval : 0.001, glob_look_poles : true,
glob_max_iter : 10000000, glob_max_minutes : 3, glob_subiter_method : 3,
glob_last_good_h : glob_h, glob_max_terms : max_terms,
glob_max_sec : convfloat(3600.0) convfloat(glob_max_hours)
+ convfloat(60.0) convfloat(glob_max_minutes),
if glob_h > 0.0 then (glob_neg_h : false,
glob_display_interval : omniabs(glob_display_interval))
else (glob_neg_h : true, glob_display_interval :
- omniabs(glob_display_interval)), chk_data(),
array_x2_set_initial : true, array_x2_set_initial : true,
1, 1 1, 2
array_x2_set_initial : false, array_x2_set_initial : false,
1, 3 1, 4
array_x2_set_initial : false, array_x2_set_initial : false,
1, 5 1, 6
array_x2_set_initial : false, array_x2_set_initial : false,
1, 7 1, 8
array_x2_set_initial : false, array_x2_set_initial : false,
1, 9 1, 10
array_x2_set_initial : false, array_x2_set_initial : false,
1, 11 1, 12
array_x2_set_initial : false, array_x2_set_initial : false,
1, 13 1, 14
array_x2_set_initial : false, array_x2_set_initial : false,
1, 15 1, 16
array_x2_set_initial : false, array_x2_set_initial : false,
1, 17 1, 18
array_x2_set_initial : false, array_x2_set_initial : false,
1, 19 1, 20
array_x2_set_initial : false, array_x2_set_initial : false,
1, 21 1, 22
array_x2_set_initial : false, array_x2_set_initial : false,
1, 23 1, 24
array_x2_set_initial : false, array_x2_set_initial : false,
1, 25 1, 26
array_x2_set_initial : false, array_x2_set_initial : false,
1, 27 1, 28
array_x2_set_initial : false, array_x2_set_initial : false,
1, 29 1, 30
array_x1_set_initial : true, array_x1_set_initial : false,
2, 1 2, 2
array_x1_set_initial : false, array_x1_set_initial : false,
2, 3 2, 4
array_x1_set_initial : false, array_x1_set_initial : false,
2, 5 2, 6
array_x1_set_initial : false, array_x1_set_initial : false,
2, 7 2, 8
array_x1_set_initial : false, array_x1_set_initial : false,
2, 9 2, 10
array_x1_set_initial : false, array_x1_set_initial : false,
2, 11 2, 12
array_x1_set_initial : false, array_x1_set_initial : false,
2, 13 2, 14
array_x1_set_initial : false, array_x1_set_initial : false,
2, 15 2, 16
array_x1_set_initial : false, array_x1_set_initial : false,
2, 17 2, 18
array_x1_set_initial : false, array_x1_set_initial : false,
2, 19 2, 20
array_x1_set_initial : false, array_x1_set_initial : false,
2, 21 2, 22
array_x1_set_initial : false, array_x1_set_initial : false,
2, 23 2, 24
array_x1_set_initial : false, array_x1_set_initial : false,
2, 25 2, 26
array_x1_set_initial : false, array_x1_set_initial : false,
2, 27 2, 28
array_x1_set_initial : false, array_x1_set_initial : false,
2, 29 2, 30
omniout_str(ALWAYS, "START of Optimize"),
glob_check_sign : check_sign(t_start, t_end),
glob_h : check_sign(t_start, t_end), if glob_display_interval < glob_h
then glob_h : glob_display_interval, if glob_max_h < glob_h
then glob_h : glob_max_h, found_h : - 1.0, best_h : 0.0,
min_value : glob_large_float, est_answer : est_size_answer(), opt_iter : 1,
while (opt_iter <= 20) and (found_h < 0.0) do (omniout_int(ALWAYS,
"opt_iter", 32, opt_iter, 4, ""), array_t : t_start, array_t : glob_h,
1 2
glob_next_display : t_start, order_diff : 2, term_no : 1,
while term_no <= order_diff do (array_x2 :
term_no
array_x2_init expt(glob_h, term_no - 1)
term_no
----------------------------------------------, term_no : 1 + term_no),
factorial_1(term_no - 1)
rows : order_diff, r_order : 1, while r_order <= rows do (term_no : 1,
while term_no <= 1 - r_order + rows do (it : - 1 + r_order + term_no,
array_x2_init expt(glob_h, term_no - 1)
it
array_x2_higher : -----------------------------------------,
r_order, term_no factorial_1(term_no - 1)
term_no : 1 + term_no), r_order : 1 + r_order), order_diff : 2, term_no : 1,
while term_no <= order_diff do (array_x1 :
term_no
array_x1_init expt(glob_h, term_no - 1)
term_no
----------------------------------------------, term_no : 1 + term_no),
factorial_1(term_no - 1)
rows : order_diff, r_order : 1, while r_order <= rows do (term_no : 1,
while term_no <= 1 - r_order + rows do (it : - 1 + r_order + term_no,
array_x1_init expt(glob_h, term_no - 1)
it
array_x1_higher : -----------------------------------------,
r_order, term_no factorial_1(term_no - 1)
term_no : 1 + term_no), r_order : 1 + r_order),
if glob_subiter_method = 1 then atomall() elseif glob_subiter_method = 2
then (subiter : 1, while subiter <= 3 do (atomall(), subiter : 1 + subiter))
else (subiter : 1, while subiter <= glob_max_terms + 3 do (atomall(),
subiter : 1 + subiter)), est_needed_step_err :
estimated_needed_step_error(t_start, t_end, glob_h, est_answer),
omniout_float(ALWAYS, "est_needed_step_err", 32, est_needed_step_err, 16, ""),
value3 : test_suggested_h(), omniout_float(ALWAYS, "value3", 32, value3, 32,
""), if (value3 < est_needed_step_err) and (found_h < 0.0)
then (best_h : glob_h, found_h : 1.0),
omniout_float(ALWAYS, "best_h", 32, best_h, 32, ""), opt_iter : 1 + opt_iter,
glob_h : glob_h 0.5), if found_h > 0.0 then glob_h : best_h
else omniout_str(ALWAYS, "No increment to obtain desired accuracy found"),
if glob_html_log then html_log_file : openw("html/entry.html"),
if found_h > 0.0 then (omniout_str(ALWAYS, "START of Soultion"),
array_t : t_start, array_t : glob_h, glob_next_display : t_start,
1 2
order_diff : 2, term_no : 1, while term_no <=
order_diff do (array_x2 :
term_no
array_x2_init expt(glob_h, term_no - 1)
term_no
----------------------------------------------, term_no : 1 + term_no),
factorial_1(term_no - 1)
rows : order_diff, r_order : 1, while r_order <= rows do (term_no : 1,
while term_no <= 1 - r_order + rows do (it : - 1 + r_order + term_no,
array_x2_init expt(glob_h, term_no - 1)
it
array_x2_higher : -----------------------------------------,
r_order, term_no factorial_1(term_no - 1)
term_no : 1 + term_no), r_order : 1 + r_order), order_diff : 2, term_no : 1,
while term_no <= order_diff do (array_x1 :
term_no
array_x1_init expt(glob_h, term_no - 1)
term_no
----------------------------------------------, term_no : 1 + term_no),
factorial_1(term_no - 1)
rows : order_diff, r_order : 1, while r_order <= rows do (term_no : 1,
while term_no <= 1 - r_order + rows do (it : - 1 + r_order + term_no,
array_x1_init expt(glob_h, term_no - 1)
it
array_x1_higher : -----------------------------------------,
r_order, term_no factorial_1(term_no - 1)
term_no : 1 + term_no), r_order : 1 + r_order), current_iter : 1,
glob_clock_start_sec : elapsed_time_seconds(),
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 (glob_check_sign array_t < glob_check_sign t_end)
1
and (convfloat(glob_clock_sec) - convfloat(glob_orig_start_sec) < convfloat(glob_max_sec)) do (if reached_interval
() then (omniout_str(INFO, " "), omniout_str(INFO, "TOP MAIN SOLVE Loop")),
glob_iter : 1 + glob_iter, glob_clock_sec : elapsed_time_seconds(),
glob_current_iter : 1 + glob_current_iter,
if glob_subiter_method = 1 then atomall() elseif glob_subiter_method = 2
then (subiter : 1, while subiter <= 3 do (atomall(), subiter : 1 + subiter))
else (subiter : 1, while subiter <= glob_max_terms + 3 do (atomall(),
subiter : 1 + subiter)), display_alot(current_iter),
if glob_look_poles then check_for_pole(),
if reached_interval() then glob_next_display :
glob_display_interval + glob_next_display, array_t : glob_h + array_t ,
1 1
array_t : glob_h, order_diff : 3, ord : 3, calc_term : 1,
2
iii : glob_max_terms, while iii >= calc_term do (array_x2_higher_work :
3, iii
array_x2_higher
3, iii
---------------------------
expt(glob_h, calc_term - 1)
-------------------------------------, iii : iii - 1), temp_sum : 0.0,
factorial_3(iii - calc_term, iii - 1)
ord : 3, calc_term : 1, iii : glob_max_terms,
while iii >= calc_term do (temp_sum :
array_x2_higher_work + temp_sum, iii : iii - 1),
ord, iii
temp_sum expt(glob_h, calc_term - 1)
array_x2_higher_work2 : ------------------------------------,
ord, calc_term factorial_1(calc_term - 1)
ord : 2, calc_term : 2, iii : glob_max_terms,
while iii >= calc_term do (array_x2_higher_work :
2, iii
array_x2_higher
2, iii
---------------------------
expt(glob_h, calc_term - 1)
-------------------------------------, iii : iii - 1), temp_sum : 0.0,
factorial_3(iii - calc_term, iii - 1)
ord : 2, calc_term : 2, iii : glob_max_terms,
while iii >= calc_term do (temp_sum :
array_x2_higher_work + temp_sum, iii : iii - 1),
ord, iii
temp_sum expt(glob_h, calc_term - 1)
array_x2_higher_work2 : ------------------------------------,
ord, calc_term factorial_1(calc_term - 1)
ord : 2, calc_term : 1, iii : glob_max_terms,
while iii >= calc_term do (array_x2_higher_work :
2, iii
array_x2_higher
2, iii
---------------------------
expt(glob_h, calc_term - 1)
-------------------------------------, iii : iii - 1), temp_sum : 0.0,
factorial_3(iii - calc_term, iii - 1)
ord : 2, calc_term : 1, iii : glob_max_terms,
while iii >= calc_term do (temp_sum :
array_x2_higher_work + temp_sum, iii : iii - 1),
ord, iii
temp_sum expt(glob_h, calc_term - 1)
array_x2_higher_work2 : ------------------------------------,
ord, calc_term factorial_1(calc_term - 1)
ord : 1, calc_term : 3, iii : glob_max_terms,
while iii >= calc_term do (array_x2_higher_work :
1, iii
array_x2_higher
1, iii
---------------------------
expt(glob_h, calc_term - 1)
-------------------------------------, iii : iii - 1), temp_sum : 0.0,
factorial_3(iii - calc_term, iii - 1)
ord : 1, calc_term : 3, iii : glob_max_terms,
while iii >= calc_term do (temp_sum :
array_x2_higher_work + temp_sum, iii : iii - 1),
ord, iii
temp_sum expt(glob_h, calc_term - 1)
array_x2_higher_work2 : ------------------------------------,
ord, calc_term factorial_1(calc_term - 1)
ord : 1, calc_term : 2, iii : glob_max_terms,
while iii >= calc_term do (array_x2_higher_work :
1, iii
array_x2_higher
1, iii
---------------------------
expt(glob_h, calc_term - 1)
-------------------------------------, iii : iii - 1), temp_sum : 0.0,
factorial_3(iii - calc_term, iii - 1)
ord : 1, calc_term : 2, iii : glob_max_terms,
while iii >= calc_term do (temp_sum :
array_x2_higher_work + temp_sum, iii : iii - 1),
ord, iii
temp_sum expt(glob_h, calc_term - 1)
array_x2_higher_work2 : ------------------------------------,
ord, calc_term factorial_1(calc_term - 1)
ord : 1, calc_term : 1, iii : glob_max_terms,
while iii >= calc_term do (array_x2_higher_work :
1, iii
array_x2_higher
1, iii
---------------------------
expt(glob_h, calc_term - 1)
-------------------------------------, iii : iii - 1), temp_sum : 0.0,
factorial_3(iii - calc_term, iii - 1)
ord : 1, calc_term : 1, iii : glob_max_terms,
while iii >= calc_term do (temp_sum :
array_x2_higher_work + temp_sum, iii : iii - 1),
ord, iii
temp_sum expt(glob_h, calc_term - 1)
array_x2_higher_work2 : ------------------------------------,
ord, calc_term factorial_1(calc_term - 1)
term_no : glob_max_terms, while term_no >=
1 do (array_x2 : array_x2_higher_work2 , ord : 1,
term_no 1, term_no
while ord <= order_diff do (array_x2_higher :
ord, term_no
array_x2_higher_work2 , ord : 1 + ord), term_no : term_no - 1),
ord, term_no
order_diff : 2, ord : 2, calc_term : 1, iii : glob_max_terms,
while iii >= calc_term do (array_x1_higher_work :
2, iii
array_x1_higher
2, iii
---------------------------
expt(glob_h, calc_term - 1)
-------------------------------------, iii : iii - 1), temp_sum : 0.0,
factorial_3(iii - calc_term, iii - 1)
ord : 2, calc_term : 1, iii : glob_max_terms,
while iii >= calc_term do (temp_sum :
array_x1_higher_work + temp_sum, iii : iii - 1),
ord, iii
temp_sum expt(glob_h, calc_term - 1)
array_x1_higher_work2 : ------------------------------------,
ord, calc_term factorial_1(calc_term - 1)
ord : 1, calc_term : 2, iii : glob_max_terms,
while iii >= calc_term do (array_x1_higher_work :
1, iii
array_x1_higher
1, iii
---------------------------
expt(glob_h, calc_term - 1)
-------------------------------------, iii : iii - 1), temp_sum : 0.0,
factorial_3(iii - calc_term, iii - 1)
ord : 1, calc_term : 2, iii : glob_max_terms,
while iii >= calc_term do (temp_sum :
array_x1_higher_work + temp_sum, iii : iii - 1),
ord, iii
temp_sum expt(glob_h, calc_term - 1)
array_x1_higher_work2 : ------------------------------------,
ord, calc_term factorial_1(calc_term - 1)
ord : 1, calc_term : 1, iii : glob_max_terms,
while iii >= calc_term do (array_x1_higher_work :
1, iii
array_x1_higher
1, iii
---------------------------
expt(glob_h, calc_term - 1)
-------------------------------------, iii : iii - 1), temp_sum : 0.0,
factorial_3(iii - calc_term, iii - 1)
ord : 1, calc_term : 1, iii : glob_max_terms,
while iii >= calc_term do (temp_sum :
array_x1_higher_work + temp_sum, iii : iii - 1),
ord, iii
temp_sum expt(glob_h, calc_term - 1)
array_x1_higher_work2 : ------------------------------------,
ord, calc_term factorial_1(calc_term - 1)
term_no : glob_max_terms, while term_no >=
1 do (array_x1 : array_x1_higher_work2 , ord : 1,
term_no 1, term_no
while ord <= order_diff do (array_x1_higher :
ord, term_no
array_x1_higher_work2 , ord : 1 + ord), term_no : term_no - 1)),
ord, term_no
omniout_str(ALWAYS, "Finished!"), if glob_iter >= glob_max_iter
then omniout_str(ALWAYS,
"Maximum Iterations Reached before Solution Completed!"),
if elapsed_time_seconds() - convfloat(glob_orig_start_sec) >=
convfloat(glob_max_sec) then omniout_str(ALWAYS,
"Maximum Time Reached before Solution Completed!"),
glob_clock_sec : elapsed_time_seconds(), omniout_str(INFO, "diff (x2,t,2) = 3.\
0 * diff(x2,t,1) - 2.0 * x2 - diff(x1,t,2) - diff (x1,t,1)+x1;"),
omniout_str(INFO,
"diff (x1,t,1) = 4.0 * x2 - 2.0 * diff (x2,t ,1) - 2.0 * x1;"),
omniout_int(INFO, "Iterations ", 32, glob_iter, 4, " "),
prog_report(t_start, t_end), if glob_html_log
then (logstart(html_log_file), logitem_str(html_log_file,
"2013-01-28T17:26:04-06:00"), logitem_str(html_log_file, "Maxima"),
logitem_str(html_log_file,
"mtest6_rev_sm_h"),
logitem_str(html_log_file, "diff (x2,t,2) = 3.0 * diff(x2,t,1) - 2.0 * x2 - di\
ff(x1,t,2) - diff (x1,t,1)+x1;"), logitem_float(html_log_file, t_start),
logitem_float(html_log_file, t_end), logitem_float(html_log_file, array_t ),
1
logitem_float(html_log_file, glob_h), logitem_str(html_log_file, "16"),
logitem_good_digits(html_log_file, array_last_rel_error ),
1
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) or (array_type_pole = 2)
1 1
then (logitem_float(html_log_file, array_pole ),
1
logitem_float(html_log_file, array_pole ), 0)
2
else (logitem_str(html_log_file, "NA"), logitem_str(html_log_file, "NA"), 0),
logitem_time(html_log_file, convfloat(glob_clock_sec)),
if glob_percent_done < 100.0 then (logitem_time(html_log_file,
convfloat(glob_total_exp_sec)), 0) else (logitem_str(html_log_file, "Done"),
0), log_revs(html_log_file, " 165 | "), logitem_str(html_log_file, "mtest6_rev_sm_h diffeq.max"),
logitem_str(html_log_file, "mtest6_r\
ev_sm_h maxima results"), logitem_str(html_log_file,
"All Tests - All Languages"), logend(html_log_file), logditto(html_log_file),
logditto(html_log_file), logditto(html_log_file), logitem_str(html_log_file, "\
diff (x1,t,1) = 4.0 * x2 - 2.0 * diff (x2,t ,1) - 2.0 * x1;"),
logditto(html_log_file), logditto(html_log_file), logditto(html_log_file),
logditto(html_log_file), logditto(html_log_file),
logitem_good_digits(html_log_file, array_last_rel_error ),
2
logditto(html_log_file), logitem_float(html_log_file, array_1st_rel_error ),
2
logitem_float(html_log_file, array_last_rel_error ), logditto(html_log_file),
2
logitem_pole(html_log_file, array_type_pole ),
2
if (array_type_pole = 1) or (array_type_pole = 2)
2 2
then (logitem_float(html_log_file, array_pole ),
1
logitem_float(html_log_file, array_pole ), 0)
2
else (logitem_str(html_log_file, "NA"), logitem_str(html_log_file, "NA"), 0),
logditto(html_log_file), if glob_percent_done < 100.0
then (logditto(html_log_file), 0) else (logditto(html_log_file), 0),
logditto(html_log_file), logditto(html_log_file), logditto(html_log_file),
logditto(html_log_file), logend(html_log_file)),
if glob_html_log then close(html_log_file)))
(%i61) main()
"##############ECHO OF PROBLEM#################"
"##############temp/mtest6_rev_sm_hpostode.ode#################"
"diff (x2,t,2) = 3.0 * diff(x2,t,1) - 2.0 * x2 - diff(x1,t,2) - diff (x1,t,1)+x1;"
"diff (x1,t,1) = 4.0 * x2 - 2.0 * diff (x2,t ,1) - 2.0 * x1;"
"!"
"/* BEGIN FIRST INPUT BLOCK */"
"Digits:64,"
"max_terms:30,"
"!"
"/* END FIRST INPUT BLOCK */"
"/* BEGIN SECOND INPUT BLOCK */"
"/* # problem from Boyce DePrima - */"
"/* # _Elementary Differential Equations and Boundary Value Problems_ */"
"/* # page 269 */"
"/* # */"
"t_start:1.5,"
"/* # did poorly with t_start := 0.5; */"
"t_end:5.0,"
"array_x1_init[0 + 1] : exact_soln_x1(t_start),"
"/* # I think following line should be omitted */"
"/* # diff(x1,1,exact_soln_x1p(t_start)); */"
"array_x2_init[0 + 1] : exact_soln_x2(t_start),"
"array_x2_init[1 + 1] : exact_soln_x2p(t_start),"
"glob_max_h:0.0000001,"
"glob_look_poles:true,"
"glob_max_iter:100,"
"/* END SECOND INPUT BLOCK */"
"/* BEGIN OVERRIDE BLOCK */"
"glob_desired_digits_correct:10,"
"glob_display_interval:0.001,"
"glob_look_poles:true,"
"glob_max_iter:10000000,"
"glob_max_minutes:3,"
"glob_subiter_method:3,"
"/* END OVERRIDE BLOCK */"
"!"
"/* BEGIN USER DEF BLOCK */"
"exact_soln_x1 (t) := (block("
"[ c1,c2,c3],"
"c1 : 1.0,"
"c2 : 0.0002,"
"c3 : 0.0003,"
" (2.0 * c1 + 6.0 * c3 * exp(-t)) "
"));"
"exact_soln_x1p (t) := (block("
"[ c1,c2,c3],"
"c1 : 1.0,"
"c2 : 0.0002,"
"c3 : 0.0003,"
" ( - 6.0 * c3 * exp(-t)) "
"));"
"exact_soln_x2 (t) := (block("
"[ c1,c2,c3],"
"c1 : 1.0,"
"c2 : 0.0002,"
"c3 : 0.0003,"
" (c1 + c2 * exp(2.0 * t) + c3 * exp(-t)) "
"));"
"exact_soln_x2p (t) := (block("
"[ c1,c2,c3],"
"c1 : 1.0,"
"c2 : 0.0002,"
"c3 : 0.0003,"
" ( 2.0 * c2 * exp(2.0 * t) - c3 * exp(-t)) "
"));"
"/* END USER DEF BLOCK */"
"#######END OF ECHO OF PROBLEM#################"
"START of Optimize"
min_size = 0.0 ""
min_size = 1. ""
opt_iter = 1
glob_desired_digits_correct = 10. ""
desired_abs_gbl_error = 1.0000000000E-10 ""
range = 3.5 ""
estimated_steps = 35000000. ""
step_error = 2.8571428571428575000000000000000000E-18 ""
est_needed_step_err = 2.8571428571428575000000000000000000E-18 ""
hn_div_ho = 0.5 ""
hn_div_ho_2 = 0.25 ""
hn_div_ho_3 = 0.125 ""
value3 = 7.130136767447525000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E-204 ""
max_value3 = 7.130136767447525000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E-204 ""
value3 = 7.130136767447525000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E-204 ""
best_h = 1.0000000E-7 ""
"START of Soultion"
" "
"TOP MAIN SOLVE Loop"
t[1] = 1.5 " "
x2[1] (analytic) = 1.0040840464326821 " "
x2[1] (numeric) = 1.0040840464326821 " "
absolute error = 0.0 " "
relative error = 0.0 "%"
Correct digits = 16
h = 1.0000000E-7 " "
x1[1] (analytic) = 2.0004016342882673 " "
x1[1] (numeric) = 2.0004016342882673 " "
absolute error = 0.0 " "
relative error = 0.0 "%"
Correct digits = 16
h = 1.0000000E-7 " "
"Complex estimate of poles used for equation 1"
"NO POLE for equation 2"
Radius of convergence = 32770.89187583429 " "
Order of pole = 59662849.87729554 " "
"Finished!"
"Maximum Time Reached before Solution Completed!"
"diff (x2,t,2) = 3.0 * diff(x2,t,1) - 2.0 * x2 - diff(x1,t,2) - diff (x1,t,1)+x1;"
"diff (x1,t,1) = 4.0 * x2 - 2.0 * diff (x2,t ,1) - 2.0 * x1;"
Iterations = 19
"Total Elapsed Time "= 0 Years 0 Days 0 Hours 3 Minutes 13 Seconds
"Elapsed Time(since restart) "= 0 Years 0 Days 0 Hours 3 Minutes 3 Seconds
"Expected Time Remaining "= 10 Years 261 Days 9 Hours 2 Minutes 44 Seconds
"Optimized Time Remaining "= 10 Years 60 Days 15 Hours 6 Minutes 7 Seconds
"Expected Total Time "= 10 Years 60 Days 15 Hours 9 Minutes 20 Seconds
"Time to Timeout " Unknown
Percent Done = 5.714285717622098000000E-5 "%"
(%o61) true
(%o61) diffeq.max