liepde.tst 8.7 KB

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