conlaw4.red 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. % CONLAW version 4, to calculate conservation laws of systems
  2. % of PDEs by calculating characteristic functions
  3. % by Thomas Wolf, June 1999
  4. %----------------------------------------------------------------------
  5. symbolic fluid '(print_ logoprint_ potint_ facint_ adjust_fnc)$
  6. %-------------
  7. symbolic procedure newil(il,mo,nx)$
  8. if (null il) or (length il<mo) then cons(1,il) else
  9. if car il<nx then cons(add1 car il,cdr il) else
  10. <<while il and (car il = nx) do il:=cdr il;
  11. if null il then nil
  12. else cons(add1 car il,cdr il)>>$
  13. %-------------
  14. symbolic procedure sortli(l)$
  15. % sort a list of numbers
  16. begin scalar l1,l2,l3,m,n$
  17. return
  18. if null l then nil
  19. else <<
  20. n:=car l$
  21. l2:=list car l$
  22. l:=cdr l$
  23. while l do <<
  24. m:=car l$
  25. if m>n then l1:=cons(car l,l1)
  26. else if m<n then l3:=cons(car l,l3)
  27. else l2:=cons(car l,l2)$
  28. l:=cdr l
  29. >>$
  30. append(sortli(l1),append(l2,sortli(l3)))
  31. >>
  32. end$
  33. %-------------
  34. %symbolic operator combi$
  35. symbolic procedure combi(ilist)$
  36. % ilist is a list of indexes (of variables of a partial derivative)
  37. % and returns length!/k1!/k2!../ki! where kj! is the multiplicity of j.
  38. begin
  39. integer n0,n1,n2,n3;
  40. n1:=1;
  41. % ilist:=cdr ilist;
  42. while ilist do
  43. <<n0:=n0+1;n1:=n1*n0;
  44. if car ilist = n2 then <<n3:=n3+1; n1:=n1/n3>>
  45. else <<n2:=car ilist; n3:=1>>;
  46. ilist:=cdr ilist>>;
  47. return n1
  48. end$
  49. %-------------
  50. symbolic procedure derili(il)$
  51. % make a derivative index list from a list of numbers
  52. if null il then nil else
  53. begin scalar h1,h2,h3$
  54. h1:=sortli(il);
  55. while h1 do <<
  56. h2:=reval algebraic mkid(!`,lisp car h1);
  57. h3:=if h3 then mkid(h2,h3)
  58. else h2;
  59. h1:=cdr h1
  60. >>;
  61. return h3
  62. end$
  63. %-------------
  64. algebraic procedure conlaw4(problem,runmode)$
  65. begin
  66. scalar contrace,eqlist,ulist,xlist,dequ,cllist,divlist,
  67. sb,densord,flist,eqord,maxord,dulist,revdulist,vl,expl,
  68. deplist,e1,e2,e3,n,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,
  69. condi,soln,potold,adjustold,udens,gensepold,
  70. inequ0,inequ,logoold,treqlist,fl,facold,u,nodep,cpu,
  71. gc,cpustart,gcstart,nontriv,cf0,rtnlist,paralist,solns,
  72. found,clcopy,extraline,nondiv,nx,nde,nonconstc,
  73. mindensord,mindensord0,maxdensord,rules$
  74. backup_reduce_flags()$
  75. lisp <<adjustold:=adjust_fnc; adjust_fnc:=t;
  76. logoold:=logoprint_; logoprint_:=t;
  77. potold:=potint_; potint_:=t;
  78. facold:=facint_; facint_:=1000>>;
  79. cpustart:=lisp time()$ gcstart:=lisp gctime()$
  80. % contrace:=t;
  81. %--- extracting input data
  82. eqlist:= reverse maklist first problem;
  83. ulist := maklist second problem;
  84. xlist := maklist third problem;
  85. nx:=length xlist;
  86. nde:=length eqlist;
  87. if contrace then write"eqlist=",eqlist,
  88. " ulist=",ulist," xlist=",xlist;
  89. mindensord:=part(runmode,1)$
  90. maxdensord:=part(runmode,2)$
  91. expl :=part(runmode,3)$
  92. flist :=part(runmode,4)$
  93. inequ0 :=part(runmode,5)$
  94. problem:=runmode:=0;
  95. %--- initial printout
  96. lisp(if logoprint_ then <<terpri()$
  97. write "--------------------------------------------------",
  98. "------------------------"$ terpri()$terpri()$
  99. write "This is CONLAW4 - a program for calculating conservation",
  100. " laws of DEs"; terpri()
  101. >> else terpri());
  102. if nde = 1
  103. then write "The DE under investigation is :"
  104. else write "The DEs under investigation are :";
  105. for each e1 in reverse eqlist do write e1;
  106. lisp<<terpri()$write "for the function(s): "$
  107. fctprint cdr reval ulist;terpri()>>$
  108. write"======================================================"$
  109. %--- nodep is a list of derivatives the Q do not depend on
  110. nodep:=first lhsli(eqlist)$
  111. %--- Here comes a test that lhs's are properly chosen
  112. chksub(eqlist,ulist)$
  113. %--- Checking whether an ansatz for characteristic functions
  114. %--- has been made, then denominator of equations is not dropped
  115. for n:=1:nde do
  116. if not lisp(null get(mkid('q_,n),'avalue)) then cf0:=t;
  117. eqlist:=reverse for each e1 in eqlist collect
  118. if part(e1,0)=EQUAL then if cf0 then lhs e1 - rhs e1
  119. else num(lhs e1 - rhs e1)
  120. else if cf0 then e1 else num e1;
  121. if contrace then write"ulist=",ulist," eqlist=",eqlist;
  122. %--- initializations to be done only once
  123. rtnlist:={};
  124. nondiv:=lisp intern gensym(); % as a marker if p-computation was not succ.
  125. %------ the list of parameters of the equation to be determined
  126. paralist:={};
  127. for each e1 in flist do
  128. if not freeof(eqlist,e1) then paralist:=cons(e1,paralist);
  129. %------ determination of the order of the input equations
  130. eqord:=0;
  131. mindensord0:=mindensord;
  132. for each e1 in eqlist do
  133. for each e2 in ulist do <<
  134. h1:=totdeg(e1,e2);
  135. if h1>eqord then eqord:=h1
  136. >>;
  137. for n:=1:nde do <<
  138. h1:=mkid(q_,n);
  139. if not lisp(null get(mkid('q_,n),'avalue)) then <<
  140. for each e2 in ulist do <<
  141. h2:=totdeg(h1,e2);
  142. if h2>eqord then eqord:=h2;
  143. if h2>mindensord then mindensord:=h2
  144. >>;
  145. cf0:=t;
  146. >>
  147. >>;
  148. if contrace then write"eqord=",eqord;
  149. if maxdensord<mindensord then maxdensord:=mindensord;
  150. %------ all transformations into jet-space
  151. sb:=subdif1(xlist,ulist,eqord)$
  152. if contrace then write"sb=",sb;
  153. treqlist:=eqlist;
  154. for each e1 in sb do <<
  155. treqlist:=sub(e1,treqlist);
  156. nodep:=sub(e1,nodep)
  157. >>;
  158. if contrace then write"treqlist=",treqlist,
  159. "nodep=",nodep;
  160. if cf0 then
  161. for n:=1:nde do <<
  162. h1:=mkid(q_,n);
  163. if not lisp(null get(mkid('q_,n),'avalue)) then <<
  164. for each e1 in sb do h1:=sub(e1,h1);
  165. lisp(mkid('q_,n)):=h1;
  166. >>
  167. >>;
  168. for each e1 in sb do inequ0:=sub(e1,inequ0);
  169. %--- investigate conservation laws of increasing order
  170. for densord:=mindensord:maxdensord do <<
  171. nodepnd(ulist);
  172. cpu:=lisp time()$ gc:=lisp gctime()$
  173. if cf0 then
  174. lisp<<write"A special ansatz of order ",densord,
  175. " for the characteristic"$terpri()$
  176. write"function(s) is investigated.";terpri()
  177. >> else
  178. lisp<<
  179. write"Currently conservation laws with characteristic";
  180. terpri();
  181. write"function(s) of order ",densord," are determined";
  182. terpri();
  183. write"======================================================"$
  184. >>;
  185. %--- repeated initializations
  186. %--- maxord is maximal derivative in condition
  187. maxord:=eqord % from the total derivatives
  188. + 1 % for safety
  189. + if eqord>densord then eqord
  190. else densord$
  191. %######## possibly to be increased due to substitutions
  192. if contrace then write"maxord=",maxord;
  193. if {}=fargs first ulist then
  194. for each e1 in ulist do depnd(e1,{xlist});
  195. sb:=subdif1(xlist,ulist,maxord)$
  196. nodepnd ulist;
  197. if contrace then write"sb=",sb;
  198. dulist:=ulist . reverse for each e1 in sb collect
  199. for each e2 in e1 collect rhs e2;
  200. sb:=0;
  201. revdulist:=reverse dulist; % dulist with decreasing order
  202. udens:=part(dulist,densord+1); % derivatives of order densord
  203. vl:=for each e1 in dulist join e1;
  204. if contrace then write"vl=",vl," udens=",udens;
  205. if not flist then fl:={}
  206. else fl:=flist;
  207. %--- initializing characteristic functions cf, the list of functions fl
  208. deplist:=lisp(cons('LIST,setdiff(cdr ulist,cdr nodep))) .
  209. for n:=1:densord collect listdifdif2(nodep,part(dulist,n+1));
  210. if expl then deplist:=xlist . deplist;
  211. deplist:=reverse deplist;
  212. cf:={};
  213. for n:=1:nde do <<
  214. h1:=mkid(q_,n);
  215. if lisp(null get(mkid('q_,n),'avalue)) then <<
  216. nodepnd({h1});
  217. depnd(h1, deplist);
  218. fl:=cons(h1,fl);
  219. >>;
  220. cf:=cons(h1,cf);
  221. >>;
  222. cf:=reverse cf;
  223. if contrace then write"fl=",fl;
  224. if contrace then lisp (write" depl*=",depl!*);
  225. %--- generation of the conditions
  226. condi:={};
  227. for each u in ulist do <<
  228. if contrace then write"function=",u;
  229. h1:=treqlist;
  230. h2:=cf;
  231. h3:=0;
  232. while h1 neq {} do << % sum over all equations
  233. if contrace then write"equation :",first h1;
  234. for each e1 in vl do % sum over u and all its derivatives
  235. if lisp(reval algebraic(u) =
  236. car combidif algebraic(e1)) then
  237. << % for u and all its derivatives
  238. % e2:=df(first h1, e1); % in CONLAW2
  239. e2:=df(first(h2)*first(h1), e1);
  240. if e2 neq 0 then <<
  241. if contrace then write"e1=",e1;
  242. % dequ:=first h2 * e2; % in CONLAW2
  243. dequ:=e2;
  244. e2:=1;
  245. for each e3 in lisp
  246. cons('LIST,cdr combidif(algebraic e1)) do
  247. <<dequ:=totdif(dequ,part(xlist,e3),e3,dulist)$
  248. e2:=-e2;
  249. if contrace then write"dequ=",dequ," e3=",e3>>;
  250. h3:=h3+e2*dequ;
  251. if contrace then write"h3=",h3;
  252. >>;
  253. >>;
  254. h1:=rest h1;h2:=rest h2
  255. >>;
  256. condi:=cons(h3,condi)
  257. >>;
  258. if contrace then write"condi=",condi;
  259. vl:=reverse append(xlist,vl); % now the full list
  260. inequ:=inequ0;
  261. %--- inequ is to stop crack if order of cf is too low
  262. if (densord neq 0) and
  263. ((cf0=nil) or (mindensord0 neq 0)) then <<
  264. % investigation should stop if
  265. % cf is independent of highest order derivatives
  266. dequ:=0;
  267. for each e1 in cf do <<
  268. h1:=udens;
  269. while h1 neq {} do <<
  270. dequ:=dequ+df(e1,first h1)*(lisp intern gensym());
  271. h1:=rest h1
  272. >>;
  273. >>;
  274. inequ:=cons(dequ,inequ)
  275. >>;
  276. if contrace then write"inequ=",inequ;
  277. if (not lisp(null get('cl_condi,'avalue))) and
  278. (part(cl_condi,0)=LIST) then
  279. condi:=append(condi,cl_condi)$
  280. %--- freeing some space
  281. sb:=revdulist:=deplist:=e1:=e2:=e3:=
  282. n:=h1:=h2:=h3:=soln:=u:=dequ:=0;
  283. %--- the real calculation
  284. if lisp(!*time) then
  285. write "time to formulate condition: ", lisp time() - cpu,
  286. " ms GC time : ", lisp gctime() - gc," ms"$
  287. solns:=crack(condi,inequ,fl,vl);
  288. %--- postprocessing
  289. lisp terpri()$
  290. found:=nil;
  291. while solns neq {} do <<
  292. divlist:={};
  293. cllist:={};
  294. soln:=first solns;
  295. solns:=rest solns;
  296. condi:=first soln;
  297. cfcopy:=sub(second soln,cf);
  298. h1:=third soln;
  299. if contrace then <<
  300. write"cfcopy=",cfcopy;
  301. write"soln=",soln;
  302. write"third soln=",h1;
  303. >>;
  304. fl:={};
  305. h2:={};
  306. for each e1 in h1 do <<
  307. if not freeof(condi,e1) then fl:=cons(e1,fl);
  308. % fl to output remaining conditions later
  309. if freeof(paralist,e1) then h2:=cons(e1,h2)
  310. >>;
  311. h1:=parti_fn(h2,condi)$
  312. if contrace then write"h1(partitioned)=",h1;
  313. extraline:=nil;
  314. nonconstc:={};
  315. while h1 neq {} do <<
  316. e1:=first h1;h1:=rest h1;
  317. for each h4 in e1 do
  318. if fargs h4 neq {} then <<
  319. nonconstc:=cons(h4,nonconstc);
  320. lisp <<
  321. write"The function "$
  322. fctprint list reval h4$
  323. write" is not constant!";
  324. extraline:=t;
  325. terpri()
  326. >>
  327. >>;
  328. dequ:=0; % to compute rhs
  329. h2:=treqlist; % "
  330. if paralist then h2:=sub(second soln,h2); % "
  331. if contrace then write"h2=",h2; % "
  332. nontriv:=nil;
  333. h3:=for each e2 in cfcopy collect <<
  334. e3:=for each h4 in e1 sum fdepterms(e2,h4);
  335. dequ:=dequ+e3*first h2; h2:=rest h2; % computes rhs
  336. if e3 neq 0 then nontriv:=t;
  337. e3
  338. >>;
  339. if nontriv then <<
  340. found:=t;
  341. cllist:=cons(<<if contrace then write"h3-1=",h3," dequ=",dequ;
  342. sb:=absorbconst(h3,e1)$
  343. if (sb neq nil) and (sb neq 0) then <<
  344. h3:=sub(sb,h3);
  345. dequ:=sub(sb,dequ)
  346. >>;
  347. if contrace then write"h3-2=",h3," dequ=",dequ;
  348. if (length(e1)=1) and (fargs first e1 = {}) then <<
  349. h4:=first e1;
  350. dequ:=sub(h4=1,dequ);
  351. sub(h4=1,h3)
  352. >> else h3
  353. >>,
  354. cllist);
  355. divlist:=cons(dequ,divlist)
  356. >>
  357. >>;
  358. if contrace then <<
  359. write"characteristic functions found so far:";
  360. write cllist;
  361. >>$
  362. if condi neq {} then <<
  363. write"There are remaining conditions: ",
  364. condi;
  365. lisp <<
  366. write"for the functions: ";
  367. fctprint cdr reval algebraic fl;terpri();
  368. write"Corresponding CLs might not be shown below as they";
  369. terpri()$write"could be of too low order.";terpri()>>;
  370. extraline:=t;
  371. >>;
  372. if extraline then lisp <<
  373. write"======================================================"$
  374. terpri()
  375. >>;
  376. %--- Dropping conservation laws of too low order
  377. if (densord > 0) and
  378. ((cf0=nil) or (mindensord0 neq 0)) then <<
  379. h1:={};
  380. h2:={};
  381. for each e1 in cllist do <<
  382. h5:=udens;
  383. while (h5 neq {}) and
  384. freeof(e1,first h5) do h5:=rest h5;
  385. if h5 neq {} then <<
  386. h1:=cons(e1,h1);
  387. h2:=cons(first divlist,h2)
  388. >>;
  389. divlist:=rest divlist;
  390. >>;
  391. cllist:=h1;
  392. divlist:=h2
  393. >>;
  394. if contrace then write"cllist=",cllist;
  395. if cllist neq {} then <<
  396. %--- Below h1 is the list of W^i in the Anco/Bluman formula
  397. h1:=for e1:=1:(length cllist) collect
  398. intcurrent1(part(divlist,e1),ulist,xlist,dulist,nx,
  399. eqord,densord);
  400. %--- Backsubstitution of e.g. u`1`1 --> df(u,x,2)
  401. for each e1 in ulist do depnd(e1,{xlist});
  402. on evallhseqp;
  403. sb:=subdif1(xlist,ulist,maxord)$
  404. sb:=for each e1 in sb join
  405. for each e2 in e1 collect(rhs e2 = lhs e2);
  406. off evallhseqp;
  407. cllist:=sub(sb,cllist);
  408. h1:=sub(sb,h1);
  409. if not lisp(freeof(h1,'SUB)) then h1:={}
  410. else <<
  411. %--- lambda integration of h1 to compute P_i
  412. h2:=lisp intern gensym()$
  413. h10:=ulist;
  414. while h10 neq {} do
  415. if not lisp(freeof(h1,'SUB)) then h10:={}
  416. else <<
  417. e1:=first h10; h10:=rest h10;
  418. h1:=sub(e1=h2*e1,h1)
  419. >>;
  420. if not lisp(freeof(h1,'SUB)) then h1:={}
  421. else
  422. h1:=for each e1 in h1 collect << % i.e. for each cl
  423. h10:=sub(sb,first divlist); divlist:=rest divlist;
  424. % at first try direct integration to compute p
  425. h9:=intcurrent2(h10,append(nonconstc,ulist),xlist);
  426. if second h9 = 0 then h9:=first h9
  427. else << % no success --> use lambda-integration
  428. h9:=nondiv;
  429. h8:=t; % whether intcurrent1 is still ok
  430. %--- at first the term h10 = T^i/x^i in conca.tex
  431. for each e2 in ulist do <<
  432. if h8 then h10:=err_catch_sub(e2,0,h10);
  433. if h10 eq nil then h8:=nil
  434. >>$
  435. if contrace then write"h10-1=",h10$
  436. if h8 and (h10 neq 0) then <<
  437. for each e2 in xlist do <<
  438. if h8 then h10:=err_catch_sub(e2,h2*e2,h10);
  439. if h10 eq nil then h8:=nil
  440. >>$
  441. if h8 then <<
  442. if contrace then write"h10-2=",h10$
  443. %--- the following is to catch errors in:
  444. %--- int(h10*h2**(nx-1),h2)
  445. h10:=if not lisp freeof(h10,'SUB) then nil else
  446. err_catch_int(h10*h2**(nx-1),h2)$
  447. if contrace then write"h10-3=",h10$
  448. if h10 eq nil then h6:=nil
  449. else
  450. %--- the following is to catch errors in:
  451. %--- sub(h2=1,h10)-sub(h2=0,h10)
  452. h6:=err_catch_sub(h2,1,h10);
  453. if contrace then write"h6=",h6$
  454. if h6 eq nil then h7:=nil
  455. else h7:=err_catch_sub(h2,0,h10);
  456. if contrace then write"h7=",h7$
  457. if h7 eq nil then h8:=nil
  458. else h10:=h6-h7
  459. >>
  460. >>$
  461. if contrace then write"h10-4=",h10$
  462. h4:={}; % h4 becomes the inverse list of P^i
  463. h11:=0;
  464. while h8 and (e1 neq {}) do <<
  465. h11:=h11+1;
  466. e2:=first e1;
  467. e1:=rest e1;
  468. if contrace then write"e2=",e2$
  469. h3:=err_catch_int(e2/h2,h2)$
  470. if contrace then write"h3-1=",h3$
  471. %--- the following is to catch errors in:
  472. %--- sub(h2=1,h3)-sub(h2=0,h3)
  473. h6:=err_catch_sub(h2,1,h3);
  474. if h6 eq nil then h7:=nil
  475. else h7:=err_catch_sub(h2,0,h3);
  476. if h7 eq nil then h8:=nil
  477. else h4:=cons(h6-h7+h10*part(xlist,h11),h4)
  478. >>;
  479. if h8 then h9:=reverse h4
  480. >>;
  481. h9
  482. >>
  483. >>;
  484. if contrace then write"h1-1=",h1$
  485. if h1={} then <<
  486. lisp <<
  487. write"The conserved quantities could not be found."$
  488. terpri()
  489. >>$
  490. if condi neq {} then lisp <<
  491. write"For that the remaining conditions should be solved.";
  492. terpri()
  493. >>;
  494. lisp <<
  495. write"The adjoined symmetries are:"$terpri()
  496. >>$
  497. for each e1 in cllist do write e1$
  498. >>$
  499. if contrace then <<
  500. write"h1=",h1;write"cllist=",cllist;write"eqlist=",eqlist
  501. >>;
  502. while h1 neq {} do <<
  503. h2:=first h1;
  504. h3:=first cllist;
  505. rtnlist:=cons({h3,h2},rtnlist);
  506. %--- conditions on parameters
  507. if paralist neq {} then
  508. for each e2 in second soln do
  509. if not freeof(paralist,lhs e2) then
  510. <<write e2,",";lisp(terpri())>>$
  511. %--- the conservation laws
  512. %--- Test whether actually only an adjoint symmetry has been
  513. %--- computed and not a conservation law
  514. h4:=eqlist;
  515. if paralist neq {} then h4:=sub(second soln,h4);
  516. h8:=0;
  517. if h2 neq nondiv then <<
  518. h5:=h4;
  519. for each e1 in h3 do <<
  520. h8:=h8 + e1*(first h5)$
  521. h5:=rest h5
  522. >>$
  523. for e1:=1:nx do <<
  524. h8:=h8-df(part(h2,e1),part(xlist,e1))$ % for test purposes
  525. >>;
  526. if h8 neq 0 then h2:=nondiv
  527. >>;
  528. write"Conservation law:";
  529. if h2 neq nondiv then <<
  530. if nx=2 then
  531. h2:=first simppl({h2},ulist,first xlist,second xlist)$
  532. print_claw(h4,h3,h2,xlist)$
  533. %--- factoring out diff operators?
  534. h6:={};
  535. for each h5 in nonconstc do
  536. if not freeof(h3,h5) then h6:=cons(h5,h6);
  537. if h6 neq {} then partintdf(h4,h3,h2,xlist,h6,vl,sb)
  538. >> else <<
  539. while h3 neq {} do <<
  540. if length h3 < length first cllist then write "+"$
  541. write"(",first h3,") * (",first h4,")"$
  542. h3:=rest h3; h4:=rest h4
  543. >>$
  544. lisp <<
  545. write"should be a divergence but the program was"$
  546. terpri()$
  547. write"not able to find the conserved current."$
  548. terpri()$
  549. >>
  550. >>$
  551. h1:=rest h1;
  552. cllist:=rest cllist;
  553. write"======================================================"$
  554. >>$
  555. >>; % if cllist neq {} then <<
  556. nodepnd(ulist);
  557. >>; % while solns neq {} do <<
  558. if found=nil then <<
  559. write"There is no conservation law of this order.";
  560. write"======================================================"$
  561. >>
  562. >>; % for densord:=mindensord:maxdensord
  563. if fargs first ulist = {} then
  564. for each e1 in ulist do depnd(e1,{xlist});
  565. if lisp(!*time) then
  566. write "time to run conlaw4: ", lisp time() - cpustart,
  567. " ms GC time : ", lisp gctime() - gcstart," ms"$
  568. lisp <<adjust_fnc:=adjustold;
  569. logoprint_:=logoold;
  570. %gensep_:=gensepold;
  571. potint_:=potold;
  572. facint_:=facold>>;
  573. recover_reduce_flags()$
  574. return rtnlist
  575. end$ % of conlaw4
  576. end$