class Object

Constants

ALWAYS

BEGIN OUTFILE1

before write_ruby top matter
DEBUGL
DEBUGMASSIVE
INFO
MAX_TERMS
MAX_UNCHANGED

Public Instance Methods

Ci(x) click to toggle source

Begin Function number 41

# File diffeq.rb, line 445
def Ci(x)
   return(0.0)
end
Si(x) click to toggle source

Begin Function number 40

# File diffeq.rb, line 441
def Si(x)
   return(0.0)
end
arccos(x) click to toggle source

Begin Function number 50

# File diffeq.rb, line 481
def arccos(x)
   return(Math.acos(x))
end
arccosh(x) click to toggle source

Begin Function number 51

# File diffeq.rb, line 485
def arccosh(x)
   return(Math.acosh(x))
end
arcsin(x) click to toggle source

Begin Function number 52

# File diffeq.rb, line 489
def arcsin(x)
   return(Math.asin(x))
end
arcsinh(x) click to toggle source

Begin Function number 53

# File diffeq.rb, line 493
def arcsinh(x)
   return(Math.asinh(x))
end
arctan(x) click to toggle source

Begin Function number 54

# File diffeq.rb, line 497
def arctan(x)
   return(Math.atan(x))
end
arctanh(x) click to toggle source

Begin Function number 55

# File diffeq.rb, line 501
def arctanh(x)
   return(Math.atanh(x))
end
array2d(op3,op4) click to toggle source

Begin Function number 64

# File diffeq.rb, line 537
def array2d(op3,op4)
   i = 0
   x1 = Array.new(op3.to_i + 1)
   while i <= op3.to_i + 1  do # do number -1
       x1[i] = Array.new(op4.to_i + 1)
       i += 1
   end# end do number -1
   return x1
end
ats(mmm_ats,arr_a,arr_b,jjj_ats) click to toggle source

Begin Function number 14

# File diffeq.rb, line 145
def ats(mmm_ats,arr_a,arr_b,jjj_ats)
   ret_ats  =  0.0
   if (jjj_ats <=  mmm_ats)  then # if number 8
       ma_ats  =  mmm_ats + 1
       iii_ats  =  jjj_ats
       while (iii_ats <= mmm_ats) do # do number -1
           lll_ats  =  ma_ats - iii_ats
           if ((lll_ats <= MAX_TERMS  and (iii_ats <= MAX_TERMS) ))  then # if number 9
               ret_ats  =  ret_ats + arr_a[iii_ats]*arr_b[lll_ats]
           end# end if 9
           iii_ats  =  iii_ats + 1
       end# end do number -1
   end# end if 8
   return ( ret_ats)
end
att(mmm_att,arr_aa,arr_bb,jjj_att) click to toggle source

Begin Function number 15

# File diffeq.rb, line 161
def att(mmm_att,arr_aa,arr_bb,jjj_att)
   ret_att  =  0.0
   if (jjj_att < mmm_att)  then # if number 8
       ma_att  =  mmm_att + 2
       iii_att  =  jjj_att
       while ((iii_att < mmm_att) and (iii_att <= MAX_TERMS) )   do # do number -1
           lll_att  =  ma_att - iii_att
           al_att  =  (lll_att - 1)
           if ((lll_att <= MAX_TERMS  and (iii_att <= MAX_TERMS) ))  then # if number 9
               ret_att  =   ret_att + arr_aa[iii_att]*arr_bb[lll_att]* (al_att)
           end# end if 9
           iii_att  =  iii_att + 1
       end# end do number -1
       ret_att  =  ret_att / (mmm_att)
   end# end if 8
   return ( ret_att)
end
chk_data() click to toggle source

Begin Function number 25

# File diffeq.rb, line 256
def chk_data()
   errflag  =  false
   if ($glob_max_iter < 2)  then # if number 13
       omniout_str(ALWAYS,"Illegal max_iter")
       errflag  =  true
   end# end if 13
   if (errflag)   then # if number 13
   end# end if 13
end
comp_expect_sec(t_end2,t_start2,t2,clock_sec2) click to toggle source

Begin Function number 26

# File diffeq.rb, line 266
def comp_expect_sec(t_end2,t_start2,t2,clock_sec2)
   ms2 = clock_sec2
   sub1 = (t_end2-t_start2)
   sub2 = (t2-t_start2)
   if (sub1 == 0.0)  then # if number 13
       sec_left = 0.0
   else
       if (sub2 > 0.0)  then # if number 14
           rrr = (sub1/sub2)
           sec_left  = rrr * ms2 - ms2
       else
           sec_left  = 0.0
       end# end if 14
   end# end if 13
   return ( sec_left)
end
comp_ord_from_ratio(term1,term2,last_no) click to toggle source

Begin Function number 29

# File diffeq.rb, line 305
def comp_ord_from_ratio(term1,term2,last_no)
   #TOP TWO TERM ORDER ANALYSIS
   if (term2 > 0.0)  then # if number 13
       ret = 1.0 +  float_abs(term2) * convfloat(last_no) * ln(float_abs(term1 * $glob_h / term2))/ln(convfloat(last_no))
   else
       ret = $glob_larger_float
   end# end if 13
   return (   ret)
   #BOTTOM TWO TERM ORDER ANALYSIS
end
comp_ord_from_six_terms(term1,term2,term3,term4,term5,term6,last_no) click to toggle source

Begin Function number 33

# File diffeq.rb, line 382
def comp_ord_from_six_terms(term1,term2,term3,term4,term5,term6,last_no)
   #TOP SIX TERM ORDER ANALYSIS
   #TOP SAVED FROM SIX TERM RADIUS ANALYSIS
   return ( $glob_six_term_ord_save)
   #BOTTOM SIX TERM ORDER ANALYSIS
end
comp_ord_from_three_terms(term1,term2,term3,last_no) click to toggle source

Begin Function number 31

# File diffeq.rb, line 328
def comp_ord_from_three_terms(term1,term2,term3,last_no)
   #TOP THREE TERM ORDER ANALYSIS
   ret = float_abs((4.0*term1*term3*convfloat(last_no)-3.0*term1*term3-4.0*term2*term2*convfloat(last_no)+4.0*term2*term2+term2*term2*convfloat(last_no*last_no)-term1*term3*convfloat(last_no*last_no))/(term2*term2*convfloat(last_no)-2.0*term2*term2-term1*term3*convfloat(last_no)+term1*term3))
   return ( ret)
   #TOP THREE TERM ORDER ANALYSIS
end
comp_percent(t_end2,t_start2, t2) click to toggle source

Begin Function number 27

# File diffeq.rb, line 283
def comp_percent(t_end2,t_start2, t2)
   sub1  =  (t_end2-t_start2)
   sub2  =  (t2-t_start2)
   if (sub2 > $glob_small_float)  then # if number 13
       rrr  =  (100.0*sub2)/sub1
   else
       rrr  =  0.0
   end# end if 13
   return (   rrr)
end
comp_rad_from_ratio(term1,term2,last_no) click to toggle source

Begin Function number 28

# File diffeq.rb, line 294
def comp_rad_from_ratio(term1,term2,last_no)
   #TOP TWO TERM RADIUS ANALYSIS
   if (term2 > 0.0)  then # if number 13
       ret =  float_abs(term1 * $glob_h / term2)
   else
       ret = $glob_larger_float
   end# end if 13
   return (   ret)
   #BOTTOM TWO TERM RADIUS ANALYSIS
end
comp_rad_from_six_terms(term1,term2,term3,term4,term5,term6,last_no) click to toggle source

Begin Function number 32

# File diffeq.rb, line 335
def comp_rad_from_six_terms(term1,term2,term3,term4,term5,term6,last_no)
   #TOP SIX TERM RADIUS ANALYSIS
   if ((term5  != 0.0) and (term4  != 0.0) and (term3  != 0.0) and  (term2  != 0.0) and (term1  != 0.0)) then # if number 13
       rm0 = term6/term5
       rm1 = term5/term4
       rm2 = term4/term3
       rm3 = term3/term2
       rm4 = term2/term1
       nr1 =  convfloat(last_no-1)*rm0 - 2.0*convfloat(last_no-2)*rm1 + convfloat(last_no-3)*rm2
       nr2 =  convfloat(last_no-2)*rm1 - 2.0*convfloat(last_no-3)*rm2 + convfloat(last_no-4)*rm3
       dr1 =  (-1.0)/rm1 + 2.0/rm2 - 1.0/rm3
       dr2 =  (-1.0)/rm2 + 2.0/rm3 - 1.0/rm4
       ds1 =  3.0/rm1 - 8.0/rm2 + 5.0/rm3
       ds2 =  3.0/rm2 - 8.0/rm3 + 5.0/rm4
       if ((float_abs(nr1 * dr2 - nr2 * dr1)  ==  0.0)  or  (float_abs(dr1) == 0.0))  then # if number 14
           rad_c =  $glob_larger_float
           ord_no =  $glob_larger_float
       else
           if (float_abs(nr1*dr2 - nr2 * dr1) != 0.0)  then # if number 15
               rcs =  ((ds1*dr2 - ds2*dr1 +dr1*dr2)/(nr1*dr2 - nr2 * dr1))
               #(Manuels)  rcs  =  (ds1*dr2 - ds2*dr1)/(nr1*dr2 - nr2 * dr1)
               ord_no =  (rcs*nr1 - ds1)/(2.0*dr1) -convfloat(last_no)/2.0
               if (float_abs(rcs)  != 0.0)  then # if number 16
                   if (rcs > 0.0)  then # if number 17
                       rad_c  =  sqrt(rcs) * float_abs($glob_h)
                   else
                       rad_c  =  $glob_larger_float
                       ord_no =  $glob_larger_float
                   end# end if 17
               else
                   rad_c =  $glob_larger_float
                   ord_no =  $glob_larger_float
               end# end if 16
           else
               rad_c =  $glob_larger_float
               ord_no =  $glob_larger_float
           end# end if 15
       end# end if 14
   else
       rad_c =  $glob_larger_float
       ord_no =  $glob_larger_float
   end# end if 13
   $glob_six_term_ord_save =  ord_no
   return ( rad_c)
   #BOTTOM SIX TERM RADIUS ANALYSIS
end
comp_rad_from_three_terms(term1,term2,term3,last_no) click to toggle source

Begin Function number 30

# File diffeq.rb, line 316
def comp_rad_from_three_terms(term1,term2,term3,last_no)
   #TOP THREE TERM RADIUS ANALYSIS
   temp = float_abs(term2*term2*convfloat(last_no)-2.0*term2*term2-term1*term3*convfloat(last_no)+term1*term3)
   if (temp > 0.0)  then # if number 13
       ret = float_abs((term2*$glob_h*term1)/(temp))
   else
       ret = $glob_larger_float
   end# end if 13
   return ( ret)
   #BOTTOM THREE TERM RADIUS ANALYSIS
end
convfloat(mmm) click to toggle source

Begin Function number 37

# File diffeq.rb, line 425
def convfloat(mmm)
   return(mmm.to_f)
end
cos(x) click to toggle source

Begin Function number 48

# File diffeq.rb, line 473
def cos(x)
   return(Math.cos(x))
end
cosh(x) click to toggle source

Begin Function number 56

# File diffeq.rb, line 505
def cosh(x)
   return(Math.cosh(x))
end
cs_info(iolevel,str) click to toggle source

Begin Function number 10

# File diffeq.rb, line 71
def cs_info(iolevel,str)
   if ($glob_iolevel >= iolevel)  then # if number 2
       puts "cs_info " + str  + " $glob_correct_start_flag = " , $glob_correct_start_flag.to_s + "$glob_h := " + $glob_h + "$glob_reached_optimal_h := "  +  $glob_reached_optimal_h
   end# end if 2
end
dump_series(iolevel,dump_label,series_name,arr_series,numb) click to toggle source

Begin Function number 8

# File diffeq.rb, line 48
def dump_series(iolevel,dump_label,series_name,arr_series,numb)
   if ($glob_iolevel >= iolevel)  then # if number 1
       i = 1
       while (i <= numb) do
       puts dump_label + series_name  + "[" + i.to_s + "]" + arr_series[i].to_s
       i += 1
       end
       end
   end
dump_series_2(iolevel,dump_label,series_name2,arr_series2,numb,subnum,arr_x) click to toggle source

Begin Function number 9

# File diffeq.rb, line 58
   def dump_series_2(iolevel,dump_label,series_name2,arr_series2,numb,subnum,arr_x)
       if ($glob_iolevel >= iolevel)  then # if number 2
           sub = 1;
           while (sub <= subnum) do
           i =  1;
           while (i <= numb) do
           puts dump_label + series_name2 + "[" + sub.to_s + "," + i.to_s + "]" + arr_series2[sub,i].to_s
       end# end do number 0
       sub += 1;
   end# end do number -1
end# end if 2
end
elapsed_time_seconds() click to toggle source

Begin Function number 38

# File diffeq.rb, line 429
def elapsed_time_seconds()
   t = Time.now
   return(t.to_i)
end
erf(x) click to toggle source

Begin Function number 57

# File diffeq.rb, line 509
def erf(x)
   return(Math.erf(x))
end
estimated_needed_step_error(x_start,x_end,estimated_h,estimated_answer) click to toggle source

Begin Function number 65

# File diffeq.rb, line 547
def estimated_needed_step_error(x_start,x_end,estimated_h,estimated_answer)
   omniout_float(ALWAYS,"$glob_desired_digits_correct",32,$glob_desired_digits_correct,32,"")
   desired_abs_gbl_error = expt(10.0, -$glob_desired_digits_correct) * float_abs(estimated_answer)
   omniout_float(ALWAYS,"estimated_h",32,estimated_h,32,"")
   omniout_float(ALWAYS,"estimated_answer",32,estimated_answer,32,"")
   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,"")
   estimated_steps = range / estimated_h
   omniout_float(ALWAYS,"estimated_steps",32,estimated_steps,32,"")
   step_error = (float_abs(desired_abs_gbl_error /sqrt( estimated_steps)))
   omniout_float(ALWAYS,"step_error",32,step_error,32,"")
   return ( (step_error))
end # End Function number 65
#END ATS LIBRARY BLOCK
#BEGIN USER FUNCTION BLOCK
#BEGIN BLOCK 3
#BEGIN USER DEF BLOCK
def exact_soln_y (x)
return(expt(2.0*x+1.0,sin(x)))
end
#END USER DEF BLOCK
#END BLOCK 3
#END USER FUNCTION BLOCK
# before write_aux functions
# Begin Function number 2
def display_poles()
   if (($glob_type_given_pole == 1) or ($glob_type_given_pole == 2))  then # if number 1
       rad_given = sqrt(($array_x[1] - $array_given_rad_poles[1][1]) * ($array_x[1] - $array_given_rad_poles[1][1]) +  $array_given_rad_poles[1][2] * $array_given_rad_poles[1][2])
       omniout_float(ALWAYS,"Radius of convergence (given) for eq  1           ",4,rad_given,4," ")
       omniout_float(ALWAYS,"Order of pole (given)                             ",4,$array_given_ord_poles[1][1],4," ")
       if (rad_given < $glob_least_given_sing)  then # if number 2
           $glob_least_given_sing =  rad_given
       end# end if 2
   elsif
   ($glob_type_given_pole == 3) then # if number 2
       omniout_str(ALWAYS,"NO POLE (given) for Equation 1")
   elsif
   ($glob_type_given_pole == 5) then # if number 3
       omniout_str(ALWAYS,"SOME POLE (given) for Equation 1")
   else
       omniout_str(ALWAYS,"NO INFO (given) for Equation 1")
   end# end if 3
   if ($array_rad_test_poles[1][1] < $glob_large_float)  then # if number 3
       omniout_float(ALWAYS,"Radius of convergence (ratio test) for eq  1      ",4,$array_rad_test_poles[1][1],4," ")
       if ($array_rad_test_poles[1][1]< $glob_least_ratio_sing) then # if number 4
           $glob_least_ratio_sing = $array_rad_test_poles[1][1]
       end# end if 4
       omniout_float(ALWAYS,"Order of pole (ratio test)                        ",4, $array_ord_test_poles[1][1],4," ")
   else
       omniout_str(ALWAYS,"NO POLE (ratio test) for Equation 1")
   end# end if 3
   if (($array_rad_test_poles[1][2] >  0.0) and ($array_rad_test_poles[1][2] < $glob_large_float))  then # if number 3
       omniout_float(ALWAYS,"Radius of convergence (three term test) for eq 1  ",4,$array_rad_test_poles[1][2],4," ")
       if ($array_rad_test_poles[1][2]< $glob_least_3_sing) then # if number 4
           $glob_least_3_sing = $array_rad_test_poles[1][2]
       end# end if 4
       omniout_float(ALWAYS,"Order of pole (three term test)                   ",4, $array_ord_test_poles[1][2],4," ")
   else
       omniout_str(ALWAYS,"NO REAL POLE (three term test) for Equation 1")
   end# end if 3
   if (($array_rad_test_poles[1][3] >  0.0) and ($array_rad_test_poles[1][3] < $glob_large_float))  then # if number 3
       omniout_float(ALWAYS,"Radius of convergence (six term test) for eq 1    ",4,$array_rad_test_poles[1][3],4," ")
       if ($array_rad_test_poles[1][3]< $glob_least_6_sing) then # if number 4
           $glob_least_6_sing = $array_rad_test_poles[1][3]
       end# end if 4
       omniout_float(ALWAYS,"Order of pole (six term test)                     ",4, $array_ord_test_poles[1][3],4," ")
   else
       omniout_str(ALWAYS,"NO COMPLEX POLE (six term test) for Equation 1")
   end# end if 3
end # End Function number 2
# Begin Function number 3
def my_check_sign( x0 ,xf)
   if (xf > x0) then # if number 3
       ret = 1.0
   else
       ret = -1.0
   end# end if 3
   return ( ret)
end # End Function number 3
# Begin Function number 4
def est_size_answer()
   min_size = $glob_estimated_size_answer
   if (float_abs($array_y[1]) < min_size) then # if number 3
       min_size = float_abs($array_y[1])
       omniout_float(ALWAYS,"min_size",32,min_size,32,"")
   end# end if 3
   if (min_size < 1.0) then # if number 3
       min_size = 1.0
       omniout_float(ALWAYS,"min_size",32,min_size,32,"")
   end# end if 3
   return ( min_size)
end # End Function number 4
# Begin Function number 5
def test_suggested_h()
   max_estimated_step_error  = 0.0
   no_terms = 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,"")
   est_tmp = float_abs($array_y[no_terms-3] + $array_y[no_terms - 2] * hn_div_ho + $array_y[no_terms - 1] * hn_div_ho_2 + $array_y[no_terms] * hn_div_ho_3)
   if (est_tmp >= max_estimated_step_error) then # if number 3
       max_estimated_step_error = est_tmp
   end# end if 3
   omniout_float(ALWAYS,"max_estimated_step_error",32,max_estimated_step_error,32,"")
   return ( max_estimated_step_error)
end # End Function number 5
# Begin Function number 6
def reached_interval()
   if (($glob_check_sign * $array_x[1]) >= ($glob_check_sign * $glob_next_display)) then # if number 3
       ret = true
   else
       ret = false
   end# end if 3
   return(ret)
end # End Function number 6
# Begin Function number 7
def display_alot(iter)
   #TOP DISPLAY ALOT
   if (reached_interval())  then # if number 3
       if (iter >= 0)  then # if number 4
           ind_var = $array_x[1]
           omniout_float(ALWAYS,"x[1]                             ",33,ind_var,20," ")
           analytic_val_y = exact_soln_y(ind_var)
           omniout_float(ALWAYS,"y[1] (analytic)                  ",33,analytic_val_y,20," ")
           term_no   =  1
           numeric_val = $array_y[term_no]
           abserr = float_abs(numeric_val - analytic_val_y)
           omniout_float(ALWAYS,"y[1] (numeric)                   ",33,numeric_val,20," ")
           if (float_abs(analytic_val_y) != 0.0)  then # if number 5
               relerr = abserr*100.0/float_abs(analytic_val_y)
               if (relerr > 0.0000000000000000000000000000000001) then # if number 6
                   $glob_good_digits = -int_trunc(log10(relerr)) + 3
               else
                   $glob_good_digits = 16
               end# end if 6
           else
               relerr =  -1.0
               $glob_good_digits = -1
           end# end if 5
exp(x) click to toggle source

Begin Function number 44

# File diffeq.rb, line 457
def exp(x)
   return(Math.exp(x))
end
expt(x,y) click to toggle source

Begin Function number 39

# File diffeq.rb, line 434
def expt(x,y)
   if ((x <= 0.0) and (y < 0.0)) then # if number 13
       puts "expt error x = " + x.to_s + "y = " + y.to_s
   end# end if 13
   return(x**y)
end
factorial_1(nnn) click to toggle source

Begin Function number 35

# File diffeq.rb, line 397
def factorial_1(nnn)
   if (nnn <= MAX_TERMS) then # if number 13
       if ($array_fact_1[nnn] == 0) then # if number 14
           ret = factorial_2(nnn)
           $array_fact_1[nnn] = ret
       else
           ret = $array_fact_1[nnn]
       end# end if 14
   else
       ret = factorial_2(nnn)
   end# end if 13
   return ( ret)
end
factorial_2(nnn) click to toggle source

Begin Function number 34

# File diffeq.rb, line 389
def factorial_2(nnn)
   if (nnn > 0)  then # if number 13
       return ( nnn * factorial_2(nnn - 1))
   else
       return ( 1.0)
   end# end if 13
end
factorial_3(mmm,nnn) click to toggle source

Begin Function number 36

# File diffeq.rb, line 411
def factorial_3(mmm,nnn)
   if ((nnn <= MAX_TERMS)  and  (mmm <= MAX_TERMS)) then # if number 13
       if ($array_fact_2[mmm][nnn] == 0) then # if number 14
           ret = factorial_1(mmm)/factorial_1(nnn)
           $array_fact_2[mmm][nnn] = ret
       else
           ret = $array_fact_2[mmm][nnn]
       end# end if 14
   else
       ret = factorial_2(mmm)/factorial_2(nnn)
   end# end if 13
   return ( ret)
end
float_abs(x) click to toggle source

Begin Function number 42

# File diffeq.rb, line 449
def float_abs(x)
   return(x.abs)
end
floor(x) click to toggle source

Begin Function number 46

# File diffeq.rb, line 465
def floor(x)
   return(x.floor)
end
int_abs(x) click to toggle source

Begin Function number 43

# File diffeq.rb, line 453
def int_abs(x)
   return(x.abs)
end
int_trunc(x) click to toggle source

Begin Function number 45

# File diffeq.rb, line 461
def int_trunc(x)
   return(x.to_i)
end
ln(x) click to toggle source

Begin Function number 59

# File diffeq.rb, line 517
def ln(x)
   return(Math.log(x))
end
log(x) click to toggle source

Begin Function number 58

# File diffeq.rb, line 513
def log(x)
   return(Math.log(x))
end
log10(x) click to toggle source

Begin Function number 60

# File diffeq.rb, line 521
def log10(x)
   return(Math.log10(x))
end
log_revs(file,revs) click to toggle source

Begin Function number 20

# File diffeq.rb, line 213
def log_revs(file,revs)
   file.printf(revs.to_s)
end
logditto(file) click to toggle source

Begin Function number 16

# File diffeq.rb, line 179
def logditto(file)
   file.printf("<td>")
   file.printf("ditto")
   file.printf("</td>")
end
logend(file) click to toggle source

Begin Function number 24

# File diffeq.rb, line 252
def logend(file)
   file.printf("</tr>")
end
logitem_float(file,x) click to toggle source

Begin Function number 21

# File diffeq.rb, line 217
def logitem_float(file,x)
   file.printf("<td>")
   file.printf(x.to_s)
   file.printf("</td>")
end
logitem_good_digits(file,rel_error) click to toggle source

Begin Function number 19

# File diffeq.rb, line 197
def logitem_good_digits(file,rel_error)
   file.printf("<td>")
   if (rel_error != -1.0) then # if number 8
       if (rel_error > + 0.0000000000000000000000000000000001) then # if number 9
           good_digits = 3-int_trunc(log10(rel_error))
           file.printf("%d",good_digits)
       else
           good_digits = 16
           file.printf("%d",good_digits)
       end# end if 9
   else
       file.printf("Unknown")
   end# end if 8
   file.printf("</td>")
end
logitem_h_reason(file) click to toggle source

Begin Function number 22

# File diffeq.rb, line 223
def logitem_h_reason(file)
   file.printf("<td>")
   if ($glob_h_reason  == 1) then # if number 8
       file.printf("Max H")
   elsif
   ($glob_h_reason == 2) then # if number 9
       file.printf("Display Interval")
   elsif
   ($glob_h_reason == 3) then # if number 10
       file.printf("Optimal")
   elsif
   ($glob_h_reason == 4) then # if number 11
       file.printf("Pole Accuracy")
   elsif
   ($glob_h_reason == 5) then # if number 12
       file.printf("Min H (Pole)")
   elsif
   ($glob_h_reason == 6) then # if number 13
       file.printf("Pole")
   else
       file.printf("Impossible")
   end# end if 13
   file.printf("</td>")
end
logitem_integer(file,n) click to toggle source

Begin Function number 17

# File diffeq.rb, line 185
def logitem_integer(file,n)
   file.printf("<td>")
   file.printf("%d",n)
   file.printf("</td>")
end
logitem_str(file,str) click to toggle source

Begin Function number 18

# File diffeq.rb, line 191
def logitem_str(file,str)
   file.printf("<td>")
   file.printf(str)
   file.printf("</td>")
end
logitem_time(fd,secs_in) click to toggle source

Begin Function number 11

# File diffeq.rb, line 77
def logitem_time(fd,secs_in)
   fd.printf("<td>")
   if (secs_in >= 0)  then # if number 2
       years_int  =  int_trunc(secs_in / $glob_sec_in_year)
       sec_temp  =  (secs_in % $glob_sec_in_year)
       days_int  =  int_trunc(sec_temp / $glob_sec_in_day)
       sec_temp  =  (sec_temp % $glob_sec_in_day)
       hours_int  =  int_trunc(sec_temp / $glob_sec_in_hour)
       sec_temp  =  (sec_temp % $glob_sec_in_hour)
       minutes_int  = int_trunc(sec_temp / $glob_sec_in_minute)
       sec_int  = (sec_temp % $glob_sec_in_minute)
       if  (years_int > 0)  then # if number 3
           fd.printf(years_int.to_s + " Years " + days_int.to_s + " Days " + hours_int.to_s + " Hours " + minutes_int.to_s + " Minutes " + sec_int.to_s + " Seconds")
       elsif
       (days_int > 0)  then # if number 4
           fd.printf(days_int.to_s + " Days " + hours_int.to_s + " Hours " + minutes_int.to_s + " Minutes " + sec_int.to_s + " Seconds")
       elsif
       (hours_int > 0)  then # if number 5
           fd.printf(hours_int.to_s + " Hours " + minutes_int.to_s + " Minutes " + sec_int.to_s + " Seconds")
       elsif
       (minutes_int > 0)  then # if number 6
           fd.printf(minutes_int.to_s + " Minutes " + sec_int.to_s + " Seconds")
       else
           fd.printf(sec_int.to_s + " Seconds")
       end# end if 6
   else
       fd.printf(" 0.0 Seconds")
   end# end if 5
   fd.printf("</td>")
end
logstart(file) click to toggle source

Begin Function number 23

# File diffeq.rb, line 248
def logstart(file)
   file.printf("<tr>")
end
omniout_float(iolevel,prelabel,prelen,value,vallen,postlabel) click to toggle source

Begin Function number 5

# File diffeq.rb, line 30
def omniout_float(iolevel,prelabel,prelen,value,vallen,postlabel)
   if ($glob_iolevel >= iolevel)  then # if number 1
       puts prelabel.ljust(30) + value.to_s + postlabel
   end# end if 1
end
omniout_float_arr(iolevel,prelabel,elemnt,prelen,value,vallen,postlabel) click to toggle source

Begin Function number 7

# File diffeq.rb, line 42
def omniout_float_arr(iolevel,prelabel,elemnt,prelen,value,vallen,postlabel)
   if ($glob_iolevel >= iolevel)  then # if number 1
       puts (prelabel.ljust(12) + "  " + elemnt.to_s + "  "  + value.to_s + " " + postlabel)
   end# end if 1
end
omniout_int(iolevel,prelabel,prelen,value,vallen,postlabel) click to toggle source

Begin Function number 6

# File diffeq.rb, line 36
def omniout_int(iolevel,prelabel,prelen,value,vallen,postlabel)
   if ($glob_iolevel >= iolevel)  then # if number 1
       puts prelabel.ljust(32) + value.to_s + postlabel
   end# end if 1
end
omniout_labstr(iolevel,label,str) click to toggle source

Begin Function number 4

# File diffeq.rb, line 24
def omniout_labstr(iolevel,label,str)
   if ($glob_iolevel >= iolevel)  then # if number 1
       puts label + str
   end# end if 1
end
omniout_str(iolevel,str) click to toggle source
before write_ats library and user def block

BEGIN ATS LIBRARY BLOCK

Begin Function number 2
# File diffeq.rb, line 12
def omniout_str(iolevel,str)
   if ($glob_iolevel >= iolevel)  then # if number 1
       puts str
   end# end if 1
end
omniout_str_noeol(iolevel,str) click to toggle source

Begin Function number 3

# File diffeq.rb, line 18
def omniout_str_noeol(iolevel,str)
   if ($glob_iolevel >= iolevel) then # if number 1
       printf("%s", str)
   end# end if 1
end
omniout_timestr(secs_in) click to toggle source

Begin Function number 12

# File diffeq.rb, line 108
def omniout_timestr(secs_in)
   if (secs_in >= 0)  then # if number 5
       years_int  =  int_trunc(secs_in / $glob_sec_in_year)
       sec_temp  =  (secs_in % $glob_sec_in_year)
       days_int  =  int_trunc(sec_temp / $glob_sec_in_day)
       sec_temp  =  (sec_temp % $glob_sec_in_day)
       hours_int  =  int_trunc(sec_temp / $glob_sec_in_hour)
       sec_temp  =  (sec_temp % $glob_sec_in_hour)
       minutes_int  = int_trunc(sec_temp / $glob_sec_in_minute)
       sec_int  = (sec_temp % $glob_sec_in_minute)
       if  (years_int > 0)  then # if number 6
           puts years_int.to_s + " Years " + days_int.to_s + " Days " + hours_int.to_s + " Hours " + minutes_int.to_s + " Minutes " + sec_int.to_s + " Seconds"
       elsif
       (days_int > 0)  then # if number 7
           puts days_int.to_s + " Days " + hours_int.to_s + " Hours " + minutes_int.to_s + " Minutes " + sec_int.to_s + " Seconds"
       elsif
       (hours_int > 0)  then # if number 8
           puts hours_int.to_s + " Hours " + minutes_int.to_s + " Minutes " + sec_int.to_s + " Seconds"
       elsif
       (minutes_int > 0)  then # if number 9
           puts minutes_int.to_s + " Minutes " + sec_int.to_s + " Seconds"
       else
           puts sec_int.to_s + " Seconds"
       end# end if 9
   else
       puts " 0.0 Seconds"
   end# end if 8
end
sin(x) click to toggle source

Begin Function number 47

# File diffeq.rb, line 469
def sin(x)
   return(Math.sin(x))
end
sinh(x) click to toggle source

Begin Function number 61

# File diffeq.rb, line 525
def sinh(x)
   return(Math.sinh(x))
end
sqrt(x) click to toggle source

Begin Function number 63

# File diffeq.rb, line 533
def sqrt(x)
   return(Math.sqrt(x))
end
tan(x) click to toggle source

Begin Function number 49

# File diffeq.rb, line 477
def tan(x)
   return(Math.tan(x))
end
tanh(x) click to toggle source

Begin Function number 62

# File diffeq.rb, line 529
def tanh(x)
   return(Math.tanh(x))
end
zero_ats_ar(arr_a) click to toggle source

Begin Function number 13

# File diffeq.rb, line 137
def zero_ats_ar(arr_a)
   iii  = 1
   while (iii <= MAX_TERMS) do # do number -1
       arr_a [iii] = 0.0
       iii  =  iii + 1
   end# end do number -1
end