liepde.tst 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. off echo, dfprint$ % FJW
  2. % To run this demo you need liepde.red and crack.red.
  3. % Either read in the files with
  4. % in "crack"$
  5. % in "liepde.red"$
  6. % or, to speed up the computation compile them before
  7. % faslout "crack"$
  8. % in "crack"$
  9. % faslend$
  10. % faslout "liepde"$
  11. % in "liepde.red"$
  12. % faslend$
  13. % and then load them with
  14. % load crack,liepde$
  15. %
  16. lisp(depl!*:=nil)$ % clearing of all dependences
  17. setcrackflags()$
  18. lisp(print_:=nil)$
  19. lisp <<
  20. write"-------------------------------------------------------"$terpri()$
  21. write"The following runs demonstrate the program LIEPDE for the"$terpri()$
  22. write"computation of infinitesimal symmetries. Times given"$terpri()$
  23. write"below refer to a 8 MB session under LINUX on a 133 MHz"$terpri()$
  24. write"Pentium PC with the CRACK version of April 1998."$terpri()$
  25. >>$
  26. lisp(prelim_:=nil)$ % not necessary as this is the default value
  27. lisp(individual_:=nil)$ % not necessary as this is the default value
  28. lisp <<
  29. write"-------------------------------------------------------"$terpri()$
  30. write"The first example is a single ODE with a parametric"$terpri()$
  31. write"function f=f(x) for which point symmetries are to be"$terpri()$
  32. write"determined."$terpri()$
  33. write"(Time ~ 6 sec.)"$terpri()$
  34. write"-------------------------------------------------------"$terpri()$
  35. >>$
  36. lisp(freeint_:=nil)$ % This enables the solution of differential equ.s in
  37. % which unevaluated integrals remain. This becomes
  38. % necessary in this example through the parametric
  39. % function f=f(x)
  40. depend y,x$
  41. depend f,x$
  42. liepde({df(y,x,2)=-(y+3*f)*df(y,x)+y**3-f*y**2-(2*f**2+df(f,x))*y,
  43. {y}, {x}},
  44. {"point"},{})$
  45. nodepnd {y,f}$
  46. lisp(freeint_:=t)$ % Because the simplification of differential
  47. % expressions which involve unevaluated integrals
  48. % may provide difficulties such solutions involving
  49. % unevaluated integrals are disabled.
  50. lisp <<
  51. write"-------------------------------------------------------"$terpri()$
  52. write"The following example demonstrates a number of things."$terpri()$
  53. write"The Burgers equation is investigated concerning third"$terpri()$
  54. write"order symmetries. The equation is used to substitute"$terpri()$
  55. write"df(u,t) and all derivatives of df(u,t). This computation"$terpri()$
  56. write"also shows that any equations that remain unsolved are"$terpri()$
  57. write"returned, like in this case the heat quation."$terpri()$
  58. write"(Time ~ 15 sec.)"$terpri()$
  59. write"-------------------------------------------------------"$terpri()$
  60. >>$
  61. nodepnd {u}$
  62. depend u,t,x$
  63. liepde({df(u,t)=df(u,x,2)+df(u,x)**2,{u},{t,x}},{"general",3},{})$
  64. lisp <<
  65. write"-------------------------------------------------------"$terpri()$
  66. write"Now the same equation is investigated, this time only"$terpri()$
  67. write"df(u,x,2) and its derivatives are substituted. As a"$terpri()$
  68. write"consequence less jet-variables (u-derivatives of lower"$terpri()$
  69. write"order) are generated in the process of formulating the"$terpri()$
  70. write"symmetry conditions. Less jet-variables in which the"$terpri()$
  71. write"conditions have to be fulfilled identically means less"$terpri()$
  72. write"overdetermined conditions and more solutions which to"$terpri()$
  73. write"compute takes longer than before."$terpri()$
  74. write"(Time ~ 85 sec.)"$terpri()$
  75. write"-------------------------------------------------------"$terpri()$
  76. >>$
  77. liepde({df(u,x,2)=df(u,t)-df(u,x)**2,{u},{t,x}},{"general",3},{})$
  78. nodepnd {u}$
  79. lisp <<
  80. write"-------------------------------------------------------"$terpri()$
  81. write"The following example includes the Karpman equations"$terpri()$
  82. write"for three unknown functions in 4 variables. "$terpri()$
  83. terpri()$
  84. write"If point symmetries are to be computed for a single"$terpri()$
  85. write"equation or a system of equations of higher than first"$terpri()$
  86. write"order then there is the option to formulate at first"$terpri()$
  87. write"preliminary conditions for each equation, have CRACK"$terpri()$
  88. write"solving these conditions before the full set of conditions"$terpri()$
  89. write"is formulated and solved. This strategy is adopted if a"$terpri()$
  90. write"lisp flag prelim_ has the value t. The default value"$terpri()$
  91. write"is nil. "$terpri()$
  92. terpri()$
  93. write"Similarly, if a system of equations is to be investigated"$terpri()$
  94. write"and a flag individual_ has the value t then symmetry"$terpri()$
  95. write"conditions are formulated and investigated for each"$terpri()$
  96. write"individual equation successively. The default value is nil."$terpri()$
  97. terpri()$
  98. write"It is advantageous to split a large set of conditions"$terpri()$
  99. write"into smaller sets to be investigated successively if"$terpri()$
  100. write"each set is sufficiently overdetermined to be solvable"$terpri()$
  101. write"quickly. Then any substitutions are done in the smaller"$terpri()$
  102. write"set and the next set of conditions is shorter. For"$terpri()$
  103. write"example, for the Karpman equations below the speedup for"$terpri()$
  104. write"prelim_:=t; individual_:=t; is a factor of 10."$terpri()$
  105. write"(Time ~ 1 min.)"$terpri()$
  106. write"-------------------------------------------------------"$terpri()$
  107. >>$
  108. lisp(prelim_:=t)$
  109. lisp(individual_:=t)$
  110. depend r,x,y,z,t;
  111. depend f,x,y,z,t;
  112. depend v,x,y,z,t;
  113. on time$
  114. liepde({
  115. first
  116. solve(
  117. {df(r,t) + w1*df(r,z)
  118. + s1*(df(r,x)*df(f,x)+df(r,y)*df(f,y)+r*df(f,x,2)/2+r*df(f,y,2)/2)
  119. + s2*(df(r,z)*df(f,z)+r*df(f,z,2)/2),
  120. df(f,t) + w1*df(f,z)
  121. - (s1*(df(r,x,2)/r+df(r,y,2)/r-df(f,x)**2-df(f,y)**2) +
  122. s2*(df(r,z,2)/r-df(f,z)**2))/2 + a1*v,
  123. df(v,t,2) - w2**2*(df(v,x,2)+df(v,y,2)+df(v,z,2))
  124. - 2*a2*r*(df(r,x,2)+df(r,y,2)+df(r,z,2))
  125. - 2*a2*(df(r,x)**2+df(r,y)**2+df(r,z)**2)},
  126. {df(v,x,2), df(r,x,2), df(f,x,2)}
  127. )
  128. , {r,f,v}, {x,y,z,t}},
  129. {"point"},
  130. {})$
  131. off time$
  132. nodepnd {r,f,v}$
  133. lisp <<
  134. write"-------------------------------------------------------"$terpri()$
  135. write"In the following example a system of two equations (by"$terpri()$
  136. write"V.Sokolov) is investigated concerning a special ansatz for"$terpri()$
  137. write"4th order symmetries. The ansatz for the symmetries includes"$terpri()$
  138. write"two unknown functions f,g. Because x is the second variable"$terpri()$
  139. write"in the list of variables {t,x}, the name u!`2 stands for"$terpri()$
  140. write"df(u,x)."$terpri()$
  141. write"Because higher order symmetries are investigated we have"$terpri()$
  142. write"to set prelim_:=nil. The symmetries to be calculated are"$terpri()$
  143. write"lengthy and therefore conditions are not very overdetermined."$terpri()$
  144. write"In that case CRACK can take long to solve a single "$terpri()$
  145. write"subset of conditions. The complete set of conditions would"$terpri()$
  146. write"have been more overdetermined and easier to solve. Therefore"$terpri()$
  147. write"the advantage of first formulating all conditions and then"$terpri()$
  148. write"solving them together with one CRACK call is that having"$terpri()$
  149. write"more equations, the chance of finding short integrable"$terpri()$
  150. write"equations among then is higher, i.e. CRACK has more freedom"$terpri()$
  151. write"in optimizing the computation. Therefore individual_:=nil"$terpri()$
  152. write"is more appropriate in this example."$terpri()$
  153. terpri()$
  154. write"Because 4th order conditions are to be computed the"$terpri()$
  155. write"`binding stack size' is increased."$terpri()$
  156. write"(Time ~ 5 min.)"$terpri()$
  157. write"-------------------------------------------------------"$terpri()$
  158. >>$
  159. lisp(prelim_:=nil)$
  160. lisp(individual_:=nil)$
  161. lisp(if getd 'set_bndstk_size then % FJW -- PSL only!
  162. set_bndstk_size(7000))$ %
  163. nodepnd {u,v}$
  164. depend u,x,t;
  165. depend v,x,t;
  166. des:={df(u,t)=+df(u,x,2) + (u + v)*df(u,x) + u*df(v,x),
  167. df(v,t)=-df(v,x,2) + (u + v)*df(v,x) + v*df(u,x)
  168. }$
  169. nodepnd {f,g}$
  170. depend f,t,x,u,v,u!`2,v!`2,u!`2!`2,v!`2!`2,u!`2!`2!`2,v!`2!`2!`2$
  171. depend g,t,x,u,v,u!`2,v!`2,u!`2!`2,v!`2!`2,u!`2!`2!`2,v!`2!`2!`2$
  172. liepde({des,{u,v},{t,x}},
  173. {xi_t=0,
  174. xi_x=0,
  175. eta_u=+df(u,x,4)+f,
  176. eta_v=-df(v,x,4)+g
  177. },
  178. {f,g}
  179. )$
  180. nodepnd {f,g}$
  181. end$