crinit.red 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. %**********************************************************************
  2. module crackinit$
  3. %**********************************************************************
  4. % Initialisation
  5. % Author: Andreas Brand 1993, continued by Thomas Wolf
  6. %
  7. % $Id: crinit.red,v 1.22 1998/06/25 18:18:27 tw Exp tw $
  8. %
  9. symbolic fluid '(REDUCEFUNCTIONS_
  10. cont_ odesolve_ print_ print_more print_all
  11. facint_ potint_ freeint_ level_ poly_only safeint_ solvealg_
  12. logoprint_ independence_ tr_gensep tr_decouple homogen_
  13. tr_genint tr_main contradiction_ stop_ fname_ nfct_ fnew_
  14. ftem_ genint_ gensep_ new_gensep ineq_ time_ adjust_fnc
  15. subst_0 subst_1 subst_2 subst_3 subst_4 cost_limit5
  16. pdelimit_0 pdelimit_1 pdelimit_2 pdelimit_3 pdelimit_4
  17. length_inc tr_redlength proc_list_ full_proc_list_ to_do_list
  18. !*batch_mode printmenu_ expert_mode repeat_mode
  19. dec_hist dec_hist_list depl_copy_
  20. nequ_ eqname_ allflags_ prop_list maxalgsys_ stepcounter_
  21. batchcount_ crackrules_ userrules_ rulelist_ history_
  22. explog_ trig1_ trig2_ trig3_ trig4_ trig5_ trig6_ trig7_ trig8_
  23. max_red_len max_factor orderings_ tr_orderings simple_orderings
  24. lex_ collect_sol)$
  25. switch batch_mode$
  26. symbolic operator setcrackflags$
  27. symbolic procedure setcrackflags$
  28. <<REDUCEFUNCTIONS_:= '(ABS ACOS ACOSD ACOSH ACOT ACOTD ACOTH ACSC ACSCD
  29. ACSCH ASEC ASECD ASECH ASIN ASIND ASINH ATAN
  30. ATAND ATANH ATAN2 ATAN2D CBRT COS COSD COSH COT
  31. COTD COTH CSC CSCD CSCH EXP FACTORIAL HYPOT LN
  32. LOG LOGB LOG10 SEC SECD SECH SIN SIND SINH SQRT
  33. TAN TAND TANH PLUS DIFFERENCE DF MINUS TIMES
  34. QUOTIENT EXPT INT)$
  35. crackrules_:=nil$
  36. userrules_:=nil$
  37. to_do_list:=nil$
  38. allflags_:='(to_eval to_int to_sep to_gensep to_decoup to_diff)$
  39. prop_list:='(val fcts vars nvars level derivs fcteval_lin fcteval_nca
  40. fcteval_nli printlength length rational nonrational
  41. allvarfcts starde dec_with dec_with_rl dec_info rl_with
  42. terms orderings)$
  43. full_proc_list_:='(
  44. to_do
  45. subst_level_0
  46. subst_level_05
  47. subst_level_45
  48. separation
  49. quick_integration
  50. factorization
  51. subst_derivative
  52. length_reduction_1
  53. subst_level_1
  54. subst_level_3
  55. full_integration
  56. integration
  57. gen_separation
  58. subst_level_5
  59. subst_level_2
  60. subst_level_33
  61. subst_level_35
  62. subst_level_4
  63. add_differentiated_pdes
  64. length_reduction_2
  65. decoupling
  66. add_diff_star_pdes
  67. multintfac
  68. alg_solve_deriv
  69. alg_solve_system
  70. undo_subst_derivative
  71. stop_batch
  72. )$
  73. proc_list_:=setdiff(full_proc_list_,
  74. '(add_differentiated_pdes
  75. multintfac
  76. subst_level_45
  77. subst_level_5
  78. alg_solve_system
  79. stop_batch
  80. length_reduction_1))$
  81. %stepcounter_:=0$ % counter for solving steps
  82. !*batch_mode:=t$ % running crack in batchmode
  83. printmenu_:=nil$ % print interactive mode menu
  84. expert_mode:=nil$ % "half automatic" when running crack in non batch mode
  85. repeat_mode:=nil$ % "repeat mode" when running crack in non batch mode
  86. if not fixp nfct_ then
  87. nfct_:=1$ % index of new functions and constants initialized
  88. level_:=nil$ % actual level of crack recursion
  89. cont_:=nil$ % interactive user control for integration or
  90. % substitution oflarge expressions is disabled
  91. independence_:=nil$% interactive control of linear independence disabled
  92. genint_:=15$ % if =nil then generalized integration disabled
  93. % else the maximal number of new functions and extra
  94. % equations due to generalized integration
  95. facint_:=1000$ % =nil then no search for integrating factors
  96. % otherwise max product terms*kernels for investigation
  97. potint_:=t$ % allowing `potential integration'
  98. safeint_:=t$ % uses only solutions of ODEs with non-vanishing denom.
  99. freeint_:=t$ % Do only integrations if expl. part is integrable
  100. odesolve_:=10$ % maximal length of a de (number of terms) to be
  101. % integrated as ode
  102. max_factor:=400$ % maximal number of terms to be factorized
  103. gensep_:=1000$ % max. size of expressions to separate in a
  104. % generalized way
  105. new_gensep:=nil$ % whether or not a new form of gensep should be used
  106. subst_0:=2$ % maximal length of an expression to be substituted
  107. subst_1:=8$ %
  108. subst_2:=100$ %
  109. subst_3:=20$ %
  110. subst_4:=10^3$ %
  111. cost_limit5:=100$ % maximal number of extra terms generated by a subst.
  112. max_red_len:=50000$% maximal product of lengths of two equ.s to be
  113. % combined with length-reducing decoupling
  114. pdelimit_0:=nil$ % maximal product length(pde)*length(subst_expr)
  115. pdelimit_1:=10^3$ % nil=no length limit
  116. pdelimit_2:=10^4$ %
  117. pdelimit_3:=10^3$ %
  118. pdelimit_4:=10^5$ %
  119. %same_length:=2$ %
  120. %same_fcts:=10$ %
  121. %same_derivs:=10$ %
  122. length_inc:=1.0$ % factor by which the length of an expression may
  123. % grow during decoupling
  124. tr_main:=t$ % Trace main procedure
  125. tr_gensep:=nil$ % Trace generalized separation
  126. tr_genint:=nil$ % Trace generalized integration
  127. tr_decouple:=nil$ % Trace decoupling process
  128. tr_redlength:=nil$ % Trace length reduction
  129. tr_orderings:=nil$ % Trace orderings stuff
  130. homogen_:=nil$ % Test for homogeneity of each equation (for debugging)
  131. solvealg_:=nil$ % Use SOLVE for algebraic equations
  132. print_more:=t$ % Print more informations about the pdes
  133. print_all:=nil$ % Print all informations about the pdes
  134. fname_:='c_$ % name of new functions and constants (integration)
  135. nequ_:=1$ % index of new equations initialized
  136. eqname_:='e$ % name of new equations
  137. logoprint_:=t$ % print logo for crack call
  138. poly_only:=nil$ % all equations are polynomials only
  139. time_:=nil$ % print the time needed for running crack
  140. print_:=12$ % maximal length of an expression to be printed
  141. dec_hist:=0$ % length of pde history list during decoupling
  142. maxalgsys_:=20$ % max. number of equations to be solved in specialsol
  143. adjust_fnc:=nil$ % if t then free constants/functions are scaled and
  144. % redundant ones are droped to simplify the result
  145. orderings_:=nil$ % Stores the orderings list, nil initially
  146. simple_orderings:=t$ % Turn off orderings support except for trivial case
  147. lex_:=nil$ % if t then use lexicographic instead of tot. degree
  148. collect_sol:=t$ % whether solutions found shall be collected and
  149. % returned together at the end or not (to save memory)
  150. put('to_do,'description,
  151. list("To do list"))$
  152. put('subst_level_0,'description,
  153. list("Substitution:",
  154. if subst_0 then " subst. expr.<=",subst_0,
  155. if pdelimit_0 then ", pde<=",pdelimit_0,
  156. ", fcts. of less vars."))$
  157. put('subst_level_05,'description,
  158. list("Substitution:",
  159. if subst_0 then " subst. expr.<=",subst_0,
  160. if pdelimit_0 then ", pde<=",pdelimit_0,
  161. ", alg. expressions."))$
  162. put('subst_level_1,'description,
  163. list("Substitution:",
  164. if subst_1 then " subst. expr.<=",subst_1,
  165. if pdelimit_1 then ", pde<=",pdelimit_1,
  166. ", fcts. of less vars."))$
  167. put('subst_level_2,'description,
  168. list("Substitution:",
  169. if subst_2 then " subst. expr.<=",subst_2,
  170. if pdelimit_2 then ", pde<=",pdelimit_2,
  171. ", fcts. of less vars."))$
  172. put('subst_level_3,'description,
  173. list("Substitution:",
  174. if subst_3 then " subst. expr.<=",subst_3,
  175. if pdelimit_3 then ", pde<=",pdelimit_3))$
  176. put('subst_level_33,'description,
  177. list("Substitution:",
  178. if subst_4 then " subst. expr.<=",subst_4,
  179. if pdelimit_4 then ", pde<=",pdelimit_4,
  180. " no cases, f-indep. coeff."))$
  181. put('subst_level_35,'description,
  182. list("Substitution:",
  183. if subst_4 then " subst. expr.<=",subst_4,
  184. if pdelimit_4 then ", pde<=",pdelimit_4," no cases"))$
  185. put('subst_level_4,'description,
  186. list("Substitution:",
  187. if subst_4 then " subst. expr.<=",subst_4,
  188. if pdelimit_4 then ", pde<=",pdelimit_4))$
  189. put('subst_level_45,'description,
  190. list("Substitution of zero minimal growth, no cases"))$
  191. put('subst_level_5,'description,
  192. list("Unlimited substitution of minimal growth"))$
  193. put('subst_derivative,'description,
  194. list("Substitution of derivatives by new functions"))$
  195. put('undo_subst_derivative,'description,
  196. list("Undo Substitutions of derivatives by new functions"))$
  197. put('factorization,'description,
  198. list("Factorization",
  199. " and investigation of resulting subcases"))$
  200. put('separation,'description,
  201. list("Direct separation"))$
  202. put('quick_integration,'description,
  203. list("Integration of a first order de with at",
  204. " most two terms."))$
  205. put('full_integration,'description,
  206. list("Integration of a pde such that",
  207. " a function can be subst."))$
  208. put('integration,'description,
  209. list("Integration"))$
  210. put('multintfac,'description,
  211. list("Find an integrating factor for a set of pde's"))$
  212. put('length_reduction_2,'description,
  213. list("Length reducing decoupling steps"))$
  214. put('decoupling,'description,
  215. list("Do one decoupling step"))$
  216. put('gen_separation,'description,
  217. list("Indirect separation"))$
  218. put('add_differentiated_pdes,'description,
  219. list("Differentiate pdes with nonlinear leading derivs"))$
  220. put('add_diff_star_pde,'description,
  221. list("Differentiate star - pdes"))$
  222. put('length_reduction_1,'description,
  223. list("Length reducing algebraic combinations of equations"))$
  224. put('alg_solve_deriv,'description,
  225. list("Solving an algebraic equation."))$
  226. put('alg_solve_system,'description,
  227. list("Solving equations for fnct.s or deriv.s algebraically"))$
  228. put('stop_batch,'description,
  229. list("Stop batch mode"))$
  230. ini_let_rules()
  231. >>$
  232. algebraic procedure ini_let_rules$
  233. begin
  234. explog_:= {
  235. cot(~x) => 1/tan(x),
  236. e**(~x+~y) => e**x*e**y,
  237. sqrt(e)**(~x+~y) => sqrt(e)**x*sqrt(e)**y,
  238. e**((~x+~y)/~z) => e**(x/z)*e**(y/z),
  239. sqrt(e)**((~x+~y)/~z) => sqrt(e)**(x/z)*sqrt(e)**(y/z),
  240. sqrt(e)**(log(~y)/~x) => y**(1/x/2),
  241. sqrt(e)**(-log(~y)/~x) => y**(-1/x/2),
  242. sqrt(e)**(~x*log(~y)/~z) => y**(x/z/2),
  243. sqrt(e)**(-~x*log(~y)/~z) => y**(-x/z/2),
  244. sqrt(e)**((~x*log(~y))/~z) => y**(x/z/2),
  245. e**(log(~y)/~x) => y**(1/x),
  246. e**(~x*log(~y)/~z) => y**(x/z),
  247. e**((~x*log(~y))/~z) => y**(x/z),
  248. int(df(~y,~x)/~y,~x) => log(y) } $
  249. trig1_:={sin(~x)**2 => 1-cos(x)**2}$
  250. trig2_:={cosh(~x)**2 => (sinh(x)**2 + 1)}$
  251. trig3_:={tan(~x/2) => (1-cos(x))/sin(x)}$
  252. trig4_:={cot(~x/2) => (1+cos(x))/sin(x)}$
  253. trig5_:={cos(2*~x) => 1-2*sin(x)**2}$
  254. trig6_:={sin(2*~x) => 2*cos(x)*sin(x)}$
  255. trig7_:={sinh(2*~x) => 2*sinh(x)*cosh(x)}$
  256. trig8_:={cosh(2*~x) => 2*cosh(x)**2-1}$
  257. end$
  258. endmodule$
  259. end$