LAPLACE.LOG 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819
  1. REDUCE 3.6, 15-Jul-95, patched to 6 Mar 96 ...
  2. % Title: Examples of Laplace Transforms.
  3. % Author: L. Kazasov.
  4. % Date: 24 October 1988.
  5. order p;
  6. % Elementary functions with argument k*x, where x is object var.
  7. laplace(1,x,p);
  8. 1
  9. ---
  10. p
  11. laplace(c,x,p);
  12. c
  13. ---
  14. p
  15. laplace(sin(k*x),x,p);
  16. k
  17. ---------
  18. 2 2
  19. p + k
  20. laplace(sin(x/a),x,p);
  21. 1
  22. -----------------
  23. -1 2 2
  24. a *(p *a + 1)
  25. laplace(sin(17*x),x,p);
  26. 17
  27. ----------
  28. 2
  29. p + 289
  30. laplace(sinh x,x,p);
  31. 1
  32. --------
  33. 2
  34. p - 1
  35. laplace(cosh(k*x),x,p);
  36. - p
  37. ------------
  38. 2 2
  39. - p + k
  40. laplace(x,x,p);
  41. 1
  42. ----
  43. 2
  44. p
  45. laplace(x**3,x,p);
  46. 6
  47. ----
  48. 4
  49. p
  50. off mcd;
  51. laplace(e**(c*x) + a**x, x, s);
  52. -1 -1
  53. - ((log(a) - s) + (c - s) )
  54. laplace(e**x - e**(a*x) + x**2, x, p);
  55. -3 -1 -1
  56. 2*p + ( - p + a) + (p - 1)
  57. laplace(one(k*t) + sin(a*t) - cos(b*t) - e**t, t, p);
  58. 2 2 -1 -1 2 2 -1 -1
  59. - p*(p + b ) + p + (p + a ) *a - (p - 1)
  60. laplace(sqrt(x),x,p);
  61. - 3/2
  62. 1/2*sqrt(pi)*p
  63. laplace(x**(1/2),x,p);
  64. - 3/2
  65. 1/2*sqrt(pi)*p
  66. on mcd;
  67. laplace(x**(-1/2),x,p);
  68. sqrt(pi)
  69. ----------
  70. sqrt(p)
  71. laplace(x**(5/2),x,p);
  72. 15*sqrt(pi)
  73. --------------
  74. 3
  75. 8*sqrt(p)*p
  76. laplace(-1/4*x**2*c*sqrt(x), x, p);
  77. - 15*sqrt(pi)*c
  78. ------------------
  79. 3
  80. 32*sqrt(p)*p
  81. % Elementary functions with argument k*x - tau,
  82. % where k>0, tau>=0, x is object var.
  83. laplace(cos(x-a),x,p);
  84. p
  85. ---------------
  86. p*a 2
  87. e *(p + 1)
  88. laplace(one(k*x-tau),x,p);
  89. 1
  90. --------------
  91. (p*tau)/k
  92. e *p
  93. laplace(sinh(k*x-tau),x,p);
  94. - k
  95. -------------------------
  96. (p*tau)/k 2 2
  97. e *( - p + k )
  98. laplace(sinh(k*x),x,p);
  99. - k
  100. ------------
  101. 2 2
  102. - p + k
  103. laplace((a*x-b)**c,x,p);
  104. c
  105. a *gamma(c + 1)
  106. -----------------
  107. c (p*b)/a
  108. p *e *p
  109. % But ...
  110. off mcd;
  111. laplace((a*x-b)**2,x,p);
  112. -3 2 2 2
  113. p *(p *b - 2*p*a*b + 2*a )
  114. on mcd;
  115. laplace(sin(2*x-3),x,p);
  116. 2
  117. -------------------
  118. (3*p)/2 2
  119. e *(p + 4)
  120. on lmon;
  121. laplace(sin(2*x-3),x,p);
  122. 2
  123. -------------------
  124. (3*p)/2 2
  125. e *(p + 4)
  126. off lmon;
  127. off mcd;
  128. laplace(cosh(t-a) - sin(3*t-5), t, p);
  129. - p*a 2 -1 - 5/3*p 2 -1
  130. e *p*(p - 1) - 3*e *(p + 9)
  131. on mcd;
  132. % More complicated examples - multiplication of functions.
  133. % We use here on lmon - a new switch that forces all
  134. % trigonometrical functions which depend on object var
  135. % to be represented as exponents.
  136. laplace(x*e**(a*x)*cos(k*x), x, p);
  137. 2 2 2
  138. p - 2*p*a + a - k
  139. -------------------------------------------------------------------------
  140. 4 3 2 2 2 2 3 2 4 2 2 4
  141. p - 4*p *a + 6*p *a + 2*p *k - 4*p*a - 4*p*a*k + a + 2*a *k + k
  142. laplace(x**(1/2)*e**(a*x), x, p);
  143. - sqrt(pi)
  144. --------------------------
  145. 2*sqrt(p - a)*( - p + a)
  146. laplace(-1/4*e**(a*x)*(x-k)**(-1/2), x, p);
  147. a*k
  148. - sqrt(pi)*e
  149. --------------------
  150. p*k
  151. 4*e *sqrt(p - a)
  152. laplace(x**(5/2)*e**(a*x), x, p);
  153. - 15*sqrt(pi)
  154. ----------------------------------------------
  155. 3 2 2 3
  156. 8*sqrt(p - a)*( - p + 3*p *a - 3*p*a + a )
  157. laplace((a*x-b)**c*e**(k*x)*const/2, x, p);
  158. 1 (b*k)/a c
  159. - ---*e *a *gamma(c + 1)*const
  160. 2
  161. ---------------------------------------
  162. (p*b)/a c
  163. e *(p - k) *( - p + k)
  164. off mcd;
  165. laplace(x*e**(a*x)*sin(7*x)/c*3, x, p);
  166. 2 2 -2 -1
  167. 42*(p - 2*p*a + a + 49) *c *(p - a)
  168. on mcd;
  169. laplace(x*e**(a*x)*sin(k*x-tau), x, p);
  170. (a*tau)/k 2 2 2 (p*tau)/k
  171. (e *(p *tau - 2*p*a*tau + 2*p*k + a *tau - 2*a*k + k *tau))/(e
  172. 4 3 2 2 2 2 3 2 4 2 2 4
  173. *(p - 4*p *a + 6*p *a + 2*p *k - 4*p*a - 4*p*a*k + a + 2*a *k + k ))
  174. % The next is unknown if lmon is off.
  175. laplace(sin(k*x)*cosh(k*x), x, p);
  176. *** Laplace for cosh(x*k)*sin(x*k) not known - try ON LMON
  177. laplace(cosh(k*x)*sin(k*x),x,p)
  178. laplace(x**(1/2)*sin(k*x), x, p);
  179. *** Laplace for sqrt(x)*sin(x*k) not known - try ON LMON
  180. laplace(sqrt(x)*sin(k*x),x,p)
  181. on lmon;
  182. % But now is OK.
  183. laplace(x**(1/2)*sin(a*x)*cos(a*b), x, p);
  184. (sqrt(pi)*cos(a*b)
  185. *( - sqrt(p - a*i)*p + sqrt(p + a*i)*p + sqrt(p - a*i)*a*i + sqrt(p + a*i)*a*i)
  186. 2 2
  187. )/(4*sqrt(p + a*i)*sqrt(p - a*i)*i*(p + a ))
  188. laplace(sin(x)*cosh(x), x, p);
  189. 2
  190. p + 2
  191. --------
  192. 4
  193. p + 4
  194. laplace(sin(k*x)*cosh(k*x), x, p);
  195. 2 2
  196. k*(p + 2*k )
  197. ---------------
  198. 4 4
  199. p + 4*k
  200. % Off exp leads to very messy output in this case.
  201. % off exp; laplace(sin(k*x-t)*cosh(k*x-t), x, p); on exp;
  202. laplace(sin(k*x-t)*cosh(k*x-t), x, p);
  203. 2 2
  204. k*(p + 2*k )
  205. ----------------------
  206. (p*t)/k 4 4
  207. e *(p + 4*k )
  208. laplace(cos(x)**2,x,p);
  209. 2
  210. p + 2
  211. ------------
  212. 2
  213. p*(p + 4)
  214. laplace(c*cos(k*x)**2,x,p);
  215. 2 2
  216. c*(p + 2*k )
  217. ---------------
  218. 2 2
  219. p*(p + 4*k )
  220. laplace(c*cos(2/3*x)**2, x, p);
  221. 2 8
  222. c*(p + ---)
  223. 9
  224. ---------------
  225. 2 16
  226. p*(p + ----)
  227. 9
  228. laplace(5*sinh(x)*e**(a*x)*x**3, x, p);
  229. 3 2 2 3 8 7 6 2 6
  230. (120*(p - 3*p *a + 3*p*a + p - a - a))/(p - 8*p *a + 28*p *a - 4*p
  231. 5 3 5 4 4 4 2 4 3 5 3 3
  232. - 56*p *a + 24*p *a + 70*p *a - 60*p *a + 6*p - 56*p *a + 80*p *a
  233. 3 2 6 2 4 2 2 2 7 5
  234. - 24*p *a + 28*p *a - 60*p *a + 36*p *a - 4*p - 8*p*a + 24*p*a
  235. 3 8 6 4 2
  236. - 24*p*a + 8*p*a + a - 4*a + 6*a - 4*a + 1)
  237. off exp;
  238. laplace(sin(2*x-3)*cosh(7*x-5), x, p);
  239. 2 11 2 11 11
  240. p *e + p + 14*p*e - 14*p + 53*e + 53
  241. -------------------------------------------------------------------------
  242. (3*p + 1)/2 5
  243. e *(p + 7 + 2*i)*(p + 7 - 2*i)*(p - 7 + 2*i)*(p - 7 - 2*i)*e
  244. on exp;
  245. laplace(sin(a*x-b)*cosh(c*x-d), x, p);
  246. *** Laplace for - 1/4*one((x*a - b)/a)*one((x*c - d)/c)*i**(-1) not known
  247. *** Laplace for 1/4*one((x*a - b)/a)*one((x*c - d)/c)*i**(-1) not known
  248. b*i a*x - b c*x - d 2*c*x 2*d
  249. - e *one(---------)*one(---------)*(e + e )
  250. a c
  251. laplace(-------------------------------------------------------,x,p)
  252. a*i*x + c*x + d
  253. 4*e *i
  254. a*i*x a*x - b c*x - d 2*c*x 2*d
  255. e *one(---------)*one(---------)*(e + e )
  256. a c
  257. + laplace(------------------------------------------------------,x,p)
  258. b*i + c*x + d
  259. 4*e *i
  260. % To solve this problem we must tell the program which one-function
  261. % is rightmost shifted. However, in REDUCE 3.4, this rule is still
  262. % not sufficient.
  263. for all x let one(x-b/a)*one(x-d/c) = one(x-b/a);
  264. laplace(sin(a*x-b)*cosh(c*x-d), x, p);
  265. (2*b*c)/a 2 2*d 2 (2*b*c)/a 2*d (2*b*c)/a 2
  266. (a*(e *p + e *p + 2*e *p*c - 2*e *p*c + e *a
  267. (2*b*c)/a 2 2*d 2 2*d 2 (p*b + a*d + b*c)/a
  268. + e *c + e *a + e *c ))/(2*e
  269. 4 2 2 2 2 4 2 2 4
  270. *(p + 2*p *a - 2*p *c + a + 2*a *c + c ))
  271. for all x clear one(x-b/a)*one(x-d/c) ;
  272. off lmon;
  273. % Floating point arithmetic.
  274. % laplace(3.5/c*sin(2.3*x-4.11)*e**(1.5*x), x, p);
  275. on rounded;
  276. laplace(3.5/c*sin(2.3*x-4.11)*e**(1.5*x), x, p);
  277. 117.461059957
  278. ----------------------------------------------------
  279. 1.78695652174*p 2
  280. 2.71828182846 *c*(p - 3.0*p + 7.54)
  281. laplace(x**2.156,x,p);
  282. gamma(3.156)
  283. --------------
  284. 3.156
  285. p
  286. laplace(x**(-0.5),x,p);
  287. gamma(0.5)
  288. ------------
  289. 0.5
  290. p
  291. off rounded;
  292. laplace(x**(-0.5),x,p);
  293. sqrt(pi)
  294. ----------
  295. sqrt(p)
  296. on rounded;
  297. laplace(x*e**(2.35*x)*cos(7.42*x), x, p);
  298. 2
  299. p - 4.7*p - 49.5339
  300. ---------------------------------------------------------
  301. 4 3 2
  302. p - 9.4*p + 143.2478*p - 569.44166*p + 3669.80312521
  303. laplace(x*e**(2.35*x)*cos(7.42*x-74.2), x, p);
  304. 3 2
  305. (160664647206.0*p - 1.11661929808e+12*p + 1.14319162408e+13*p
  306. 10.0*p
  307. - 2.36681205089e+13)/(2.71828182846
  308. 4 3 2
  309. *(p - 9.4*p + 143.2478*p - 569.44166*p + 3669.80312521))
  310. % Higher precision works, but uses more memory.
  311. % precision 20; laplace(x**2.156,x,p);
  312. % laplace(x*e**(2.35*x)*cos(7.42*x-74.2), x, p);
  313. off rounded;
  314. % Integral from 0 to x, where x is object var.
  315. % Syntax is intl(<expr>,<var>,0,<obj.var>).
  316. laplace(c1/c2*intl(2*y**2,y,0,x), x,p);
  317. 4*c1
  318. -------
  319. 4
  320. p *c2
  321. off mcd;
  322. laplace(intl(e**(2*y)*y**2+sqrt(y),y,0,x),x,p);
  323. -1 -3 - 3/2
  324. p *(2*(p - 2) + 1/2*sqrt(pi)*p )
  325. on mcd;
  326. laplace(-2/3*intl(1/2*y*e**(a*y)*sin(k*y),y,0,x), x, p);
  327. 2 2
  328. k*( - ---*p + ---*a)
  329. 3 3
  330. -----------------------------------------------------------------------------
  331. 4 3 2 2 2 2 3 2 4 2 2 4
  332. p*(p - 4*p *a + 6*p *a + 2*p *k - 4*p*a - 4*p*a*k + a + 2*a *k + k )
  333. % Use of delta function and derivatives.
  334. laplace(-1/2*delta(x), x, p);
  335. 1
  336. - ---
  337. 2
  338. laplace(delta(x-tau), x, p);
  339. 1
  340. --------
  341. p*tau
  342. e
  343. laplace(c*cos(k*x)*delta(x),x,p);
  344. c
  345. laplace(e**(a*x)*delta(x), x, p);
  346. 1
  347. laplace(c*x**2*delta(x), x, p);
  348. 0
  349. laplace(-1/4*x**2*delta(x-pi), x, p);
  350. 1 2
  351. - ---*pi
  352. 4
  353. ------------
  354. p*pi
  355. e
  356. laplace(cos(2*x-3)*delta(x-pi),x,p);
  357. cos(3)
  358. --------
  359. p*pi
  360. e
  361. laplace(e**(-b*x)*delta(x-tau), x, p);
  362. 1
  363. --------------
  364. tau*(p + b)
  365. e
  366. on lmon;
  367. laplace(cos(2*x)*delta(x),x,p);
  368. 1
  369. laplace(c*x**2*delta(x), x, p);
  370. 0
  371. laplace(c*x**2*delta(x-pi), x, p);
  372. 2
  373. c*pi
  374. -------
  375. p*pi
  376. e
  377. laplace(cos(a*x-b)*delta(x-pi),x,p);
  378. cos(a*pi - b)
  379. ---------------
  380. p*pi
  381. e
  382. laplace(e**(-b*x)*delta(x-tau), x, p);
  383. 1
  384. --------------
  385. tau*(p + b)
  386. e
  387. off lmon;
  388. laplace(2/3*df(delta x,x),x,p);
  389. 2
  390. ---*p
  391. 3
  392. off exp;
  393. laplace(e**(a*x)*df(delta x,x,5), x, p);
  394. 5
  395. - ( - p + a)
  396. on exp;
  397. laplace(df(delta(x-a),x), x, p);
  398. p
  399. ------
  400. p*a
  401. e
  402. laplace(e**(k*x)*df(delta(x),x), x, p);
  403. p - k
  404. laplace(e**(k*x)*c*df(delta(x-tau),x,2), x, p);
  405. k*tau 2 2
  406. e *c*(p - 2*p*k + k )
  407. ----------------------------
  408. p*tau
  409. e
  410. on lmon;
  411. laplace(e**(k*x)*sin(a*x)*df(delta(x-t),x,2),x,p);
  412. k*t 1 2*a*i*t 2 1 2 2*a*i*t 2*a*i*t
  413. (e *(---*e *p - ---*p - e *p*a*i - e *p*k - p*a*i + p*k
  414. 2 2
  415. 1 2*a*i*t 2 2*a*i*t 1 2*a*i*t 2 1 2
  416. - ---*e *a + e *a*i*k + ---*e *k + ---*a + a*i*k
  417. 2 2 2
  418. 1 2 t*(p + a*i)
  419. - ---*k ))/(e *i)
  420. 2
  421. off lmon;
  422. % But if tau is positive, Laplace transform is not defined.
  423. laplace(e**(a*x)*delta(x+tau), x, p);
  424. *** Laplace for delta(x + tau) not known - try ON LMON
  425. a*x
  426. laplace(e *delta(tau + x),x,p)
  427. laplace(2*c*df(delta(x+tau),x), x, p);
  428. *** Laplace for df(delta(x + tau),x) not known - try ON LMON
  429. laplace(2*df(delta(tau + x),x)*c,x,p)
  430. laplace(e**(k*x)*df(delta(x+tau),x,3), x, p);
  431. *** Laplace for df(delta(x + tau),x,3) not known - try ON LMON
  432. k*x
  433. laplace(e *df(delta(tau + x),x,3),x,p)
  434. % Adding new let rules for Laplace operator. Note the syntax.
  435. for all x let laplace(log(x),x) = -log(gam*il!&)/il!&;
  436. laplace(-log(x)*a/4, x, p);
  437. 1
  438. ---*log(p*gam)*a
  439. 4
  440. ------------------
  441. p
  442. laplace(-log(x),x,p);
  443. log(p*gam)
  444. ------------
  445. p
  446. laplace(a*log(x)*e**(k*x), x, p);
  447. log(gam*(p - k))*a
  448. --------------------
  449. - p + k
  450. for all x clear laplace(log(x),x);
  451. operator f;
  452. for all x let
  453. laplace(df(f(x),x),x) = il!&*laplace(f(x),x) - sub(x=0,f(x));
  454. for all x,n such that numberp n and fixp n let
  455. laplace(df(f(x),x,n),x) = il!&**n*laplace(f(x),x) -
  456. for i:=n-1 step -1 until 0 sum
  457. sub(x=0, df(f(x),x,n-1-i)) * il!&**i ;
  458. for all x let laplace(f(x),x) = f(il!&);
  459. laplace(1/2*a*df(-2/3*f(x)*c,x), x,p);
  460. 1 1
  461. a*c*( - ---*p*f(p) + ---*f(0))
  462. 3 3
  463. laplace(1/2*a*df(-2/3*f(x)*c,x,4), x,p);
  464. 1 4 1 3 1 2
  465. a*c*( - ---*p *f(p) + ---*p *f(0) + ---*p *sub(x=0,df(f(x),x))
  466. 3 3 3
  467. 1 1
  468. + ---*p*sub(x=0,df(f(x),x,2)) + ---*sub(x=0,df(f(x),x,3)))
  469. 3 3
  470. laplace(1/2*a*e**(k*x)*df(-2/3*f(x)*c,x,2), x,p);
  471. 1 2 2 1 1 2
  472. a*c*( - ---*p *f(p - k) + ---*p*f(p - k)*k + ---*p*f(0) - ---*f(p - k)*k
  473. 3 3 3 3
  474. 1 1
  475. - ---*f(0)*k + ---*sub(x=0,df(f(x),x)))
  476. 3 3
  477. clear f;
  478. % Or if the boundary conditions are known and assume that
  479. % f(i,0)=sub(x=0,df(f(x),x,i)) the above may be overwritten as:
  480. operator f;
  481. for all x let
  482. laplace(df(f(x),x),x) = il!&*laplace(f(x),x) - f(0,0);
  483. for all x,n such that numberp n and fixp n let
  484. laplace(df(f(x),x,n),x) = il!&**n*laplace(f(x),x) -
  485. for i:=n-1 step -1 until 0 sum il!&**i * f(n-1-i,0);
  486. for all x let laplace(f(x),x) = f(il!&);
  487. let f(0,0)=0, f(1,0)=1, f(2,0)=2, f(3,0)=3;
  488. laplace(1/2*a*df(-2/3*f(x)*c,x), x,p);
  489. 1
  490. - ---*p*f(p)*a*c
  491. 3
  492. laplace(1/2*a*df(-2/3*f(x)*c,x,4), x,p);
  493. 1 4 1 2 2
  494. a*c*( - ---*p *f(p) + ---*p + ---*p + 1)
  495. 3 3 3
  496. clear f(0,0), f(1,0), f(2,0), f(3,0);
  497. clear f;
  498. % Very complicated examples.
  499. on lmon;
  500. laplace(sin(a*x-b)**2, x, p);
  501. (p*b)/a 2 (p*b)/a 2 (p*b)/a 2
  502. - e *p + e *p + 4*e *a
  503. ----------------------------------------------
  504. (2*p*b)/a 2 2
  505. 2*e *p*(p + 4*a )
  506. off mcd;
  507. laplace(x**3*(sin x)**4*e**(5*k*x)*c/2, x,p);
  508. -4 -4 -4
  509. c*(3/16*( - p + 4*i + 5*k) + 3/16*(p + 4*i - 5*k) - 3/4*( - p + 2*i + 5*k)
  510. -4 -4
  511. - 3/4*(p + 2*i - 5*k) + 9/8*( - p + 5*k) )
  512. a:=(sin x)**4*e**(5*k*x)*c/2;
  513. 5*k*x 4
  514. a := 1/2*e *sin(x) *c
  515. laplace(x**3*a,x,p);
  516. -4 -4 -4
  517. c*(3/16*( - p + 4*i + 5*k) + 3/16*(p + 4*i - 5*k) - 3/4*( - p + 2*i + 5*k)
  518. -4 -4
  519. - 3/4*(p + 2*i - 5*k) + 9/8*( - p + 5*k) )
  520. clear a;
  521. on mcd;
  522. % And so on, but is very time consuming.
  523. % laplace(e**(k*x)*x**2*sin(a*x-b)**2, x, p);
  524. % for all x let one(a*x-b)*one(c*x-d) = one(c*x-d);
  525. % laplace(x*e**(-2*x)*cos(a*x-b)*sinh(c*x-d), x, p);
  526. % for all x clear one(a*x-b)*one(c*x-d) ;
  527. % laplace(x*e**(c*x)*sin(k*x)**3*cosh(x)**2*cos(a*x), x, p);
  528. off lmon;
  529. % Error messages.
  530. laplace(sin(-x),x,p);
  531. ***** Laplace induces one( - x) which is not allowed
  532. laplace( - sin(x),x,p)
  533. on lmon;
  534. laplace(sin(-a*x), x, p);
  535. ***** Laplace induces one( - x*a) which is not allowed
  536. laplace( - sin(a*x),x,p)
  537. off lmon;
  538. laplace(e**(k*x**2), x, p);
  539. *** Laplace for e**(x**2*k) not known - try ON LMON
  540. 2
  541. k*x
  542. laplace(e ,x,p)
  543. laplace(sin(-a*x+b)*cos(c*x+d), x, p);
  544. *** Laplace for - cos(x*c + d)*sin(x*a - b) not known - try ON LMON
  545. laplace( - cos(c*x + d)*sin(a*x - b),x,p)
  546. laplace(x**(-5/2),x,p);
  547. *** Laplace for x**( - 5/2) not known - try ON LMON
  548. 1
  549. laplace(------------,x,p)
  550. 2
  551. sqrt(x)*x
  552. % With int arg, can't be shifted.
  553. laplace(intl(y*e**(a*y)*sin(k*y-tau),y,0,x), x, p);
  554. *** Laplace for sin(x*k - tau) not allowed
  555. a*x
  556. laplace(e *sin(k*x - tau)*x,x,p)
  557. ------------------------------------
  558. p
  559. laplace(cosh(x**2), x, p);
  560. *** Laplace for cosh(x**2) not known - try ON LMON
  561. 2
  562. laplace(cosh(x ),x,p)
  563. laplace(3*x/(x**2-5*x+6),x,p);
  564. *** Laplace for (x**2 - 5*x + 6)**(-1) not known - try ON LMON
  565. 3*x
  566. laplace(--------------,x,p)
  567. 2
  568. x - 5*x + 6
  569. laplace(1/sin(x),x,p);
  570. *** Laplace for sin(x)**(-1) not known - try ON LMON
  571. 1
  572. laplace(--------,x,p)
  573. sin(x)
  574. % But ...
  575. laplace(x/sin(-3*a**2),x,p);
  576. - 1
  577. --------------
  578. 2 2
  579. p *sin(3*a )
  580. % Severe errors.
  581. % laplace(sin x,x,cos y);
  582. % laplace(sin x,x,y+1);
  583. % laplace(sin(x+1),x+1,p);
  584. Comment Examples of Inverse Laplace transformations;
  585. symbolic(ordl!* := nil);
  586. % To nullify previous order declarations.
  587. order t;
  588. % Elementary ratio of polynomials.
  589. invlap(1/p, p, t);
  590. 1
  591. invlap(1/p**3, p, t);
  592. 2
  593. t
  594. ----
  595. 2
  596. invlap(1/(p-a), p, t);
  597. t*a
  598. e
  599. invlap(1/(2*p-a),p,t);
  600. (t*a)/2
  601. e
  602. ----------
  603. 2
  604. invlap(1/(p/2-a),p,t);
  605. 2*t*a
  606. 2*e
  607. invlap(e**(-k*p)/(p-a), p, t);
  608. t*a
  609. e
  610. ------
  611. a*k
  612. e
  613. invlap(b**(-k*p)/(p-a), p, t);
  614. t*a
  615. e
  616. ------
  617. a*k
  618. b
  619. invlap(1/(p-a)**3, p, t);
  620. t*a 2
  621. e *t
  622. ---------
  623. 2
  624. invlap(1/(c*p-a)**3, p, t);
  625. (t*a)/c 2
  626. e *t
  627. -------------
  628. 3
  629. 2*c
  630. invlap(1/(p/c-a)**3, p, t);
  631. t*a*c 2 3
  632. e *t *c
  633. --------------
  634. 2
  635. invlap((c*p-a)**(-1)/(c*p-a)**2, p, t);
  636. (t*a)/c 2
  637. e *t
  638. -------------
  639. 3
  640. 2*c
  641. invlap(c/((p/c-a)**2*(p-a*c)), p, t);
  642. t*a*c 2 3
  643. e *t *c
  644. --------------
  645. 2
  646. invlap(1/(p*(p-a)), p, t);
  647. t*a
  648. e - 1
  649. ----------
  650. a
  651. invlap(c/((p-a)*(p-b)), p, t);
  652. t*a t*b
  653. c*(e - e )
  654. -----------------
  655. a - b
  656. invlap(p/((p-a)*(p-b)), p, t);
  657. t*a t*b
  658. e *a - e *b
  659. -----------------
  660. a - b
  661. off mcd;
  662. invlap((p+d)/(p*(p-a)), p, t);
  663. t*a -1 t*a -1
  664. e *a *d + e - a *d
  665. invlap((p+d)/((p-a)*(p-b)), p, t);
  666. -1 t*a t*a t*b t*b
  667. (a - b) *(e *a + e *d - e *b - e *d)
  668. invlap(1/(e**(k*p)*p*(p+1)), p, t);
  669. - t + k
  670. - e + one(t - k)
  671. on mcd;
  672. off exp;
  673. invlap(c/(p*(p+a)**2), p, t);
  674. t*a
  675. - (a*t + 1 - e )*c
  676. -----------------------
  677. t*a 2
  678. e *a
  679. on exp;
  680. invlap(1, p, t);
  681. delta(t)
  682. invlap(c1*p/c2, p, t);
  683. df(delta(t),t)*c1
  684. -------------------
  685. c2
  686. invlap(p/(p-a), p, t);
  687. t*a
  688. delta(t) + e *a
  689. invlap(c*p**2, p, t);
  690. df(delta(t),t,2)*c
  691. invlap(p**2*e**(-a*p)*c, p, t);
  692. sub(t=t - a,df(delta(t),t,2))*c
  693. off mcd;
  694. invlap(e**(-a*p)*(1/p**2-p/(p-1))+c/p, p, t);
  695. t - a
  696. t - delta(t - a) - e - a + c
  697. on mcd;
  698. invlap(a*p**2-2*p+1, p, x);
  699. delta(x) + df(delta(x),x,2)*a - 2*df(delta(x),x)
  700. % P to non-integer power in denominator - i.e. gamma-function case.
  701. invlap(1/sqrt(p), p, t);
  702. 1
  703. ------------------
  704. sqrt(t)*sqrt(pi)
  705. invlap(1/sqrt(p-a), p, t);
  706. t*a
  707. e
  708. ------------------
  709. sqrt(t)*sqrt(pi)
  710. invlap(c/(p*sqrt(p)), p, t);
  711. 2*sqrt(t)*c
  712. -------------
  713. sqrt(pi)
  714. invlap(c*sqrt(p)/p**2, p, t);
  715. 2*sqrt(t)*c
  716. -------------
  717. sqrt(pi)
  718. invlap((p-a)**(-3/2), p, t);
  719. t*a
  720. 2*sqrt(t)*e
  721. ----------------
  722. sqrt(pi)
  723. invlap(sqrt(p-a)*c/(p-a)**2, p, t);
  724. t*a
  725. 2*sqrt(t)*e *c
  726. ------------------
  727. sqrt(pi)
  728. invlap(1/((p-a)*b*sqrt(p-a)), p, t);
  729. t*a
  730. 2*sqrt(t)*e
  731. ----------------
  732. sqrt(pi)*b
  733. invlap((p/(c1-3)-a)**(-3/2), p, t);
  734. t*a*c1
  735. 2*sqrt(t)*e *sqrt(c1 - 3)*(c1 - 3)
  736. -----------------------------------------
  737. 3*t*a
  738. sqrt(pi)*e
  739. invlap(1/((p/(c1-3)-a)*b*sqrt(p/(c1-3)-a)), p, t);
  740. t*a*c1
  741. 2*sqrt(t)*e *sqrt(c1 - 3)*(c1 - 3)
  742. -----------------------------------------
  743. 3*t*a
  744. sqrt(pi)*e *b
  745. invlap((p*2-a)**(-3/2), p, t);
  746. (t*a)/2
  747. sqrt(t)*e
  748. ------------------
  749. sqrt(pi)*sqrt(2)
  750. invlap(sqrt(2*p-a)*c/(p*2-a)**2, p, t);
  751. (t*a)/2
  752. sqrt(t)*e *sqrt(2)*c
  753. ----------------------------
  754. 2*sqrt(pi)
  755. invlap(c/p**(7/2), p, t);
  756. 2
  757. 8*sqrt(t)*t *c
  758. ----------------
  759. 15*sqrt(pi)
  760. invlap(p**(-7/3), p, t);
  761. 1/3
  762. t *t
  763. ------------
  764. 7
  765. gamma(---)
  766. 3
  767. invlap(gamma(b)/p**b,p,t);
  768. b
  769. t
  770. ----
  771. t
  772. invlap(c*gamma(b)*(p-a)**(-b),p,t);
  773. b t*a
  774. t *e *c
  775. -----------
  776. t
  777. invlap(e**(-k*p)/sqrt(p-a), p, t);
  778. t*a
  779. e
  780. ---------------------------
  781. a*k
  782. sqrt(pi)*e *sqrt(t - k)
  783. % Images that give elementary object functions.
  784. % Use of new switches lmon, lhyp.
  785. invlap(k/(p**2+k**2), p, t);
  786. 2*t*i*k
  787. e - 1
  788. --------------
  789. t*i*k
  790. 2*e *i
  791. % This is made more readable by :
  792. on ltrig;
  793. invlap(k/(p**2+k**2), p, t);
  794. sin(t*k)
  795. invlap(p/(p**2+1), p, t);
  796. cos(t)
  797. invlap((p**2-a**2)/(p**2+a**2)**2, p, t);
  798. t*cos(t*a)
  799. invlap(p/(p**2+a**2)**2, p, t);
  800. t*sin(t*a)
  801. ------------
  802. 2*a
  803. invlap((p-a)/((p-a)**2+b**2), p, t);
  804. t*a
  805. e *cos(t*b)
  806. off ltrig;
  807. on lhyp;
  808. invlap(s/(s**2-k**2), s, t);
  809. cosh(t*k)
  810. invlap(e**(-tau/k*p)*p/(p**2-k**2), p, t);
  811. cosh(t*k - tau)
  812. off lhyp;
  813. % But it is not always possible to convert expt. functions, e.g.:
  814. on lhyp;
  815. invlap(k/((p-a)**2-k**2), p, t);
  816. sinh(t*k)*(cosh(t*a) + sinh(t*a))
  817. off lhyp;
  818. on ltrig;
  819. invlap(e**(-tau/k*p)*k/(p**2+k**2), p, t);
  820. 2*t*i*k 2*i*tau
  821. e - e
  822. ---------------------
  823. i*(t*k + tau)
  824. 2*e *i
  825. off ltrig;
  826. % In such situations use the default switches:
  827. invlap(k/((p-a)**2-k**2), p, t);
  828. t*a 2*t*k
  829. e *(e - 1)
  830. -------------------
  831. t*k
  832. 2*e
  833. % i.e. e**(a*t)*cosh(k*t).
  834. invlap(e**(-tau/k*p)*k/(p**2+k**2), p, t);
  835. 2*t*i*k 2*i*tau
  836. e - e
  837. ---------------------
  838. i*(t*k + tau)
  839. 2*e *i
  840. % i.e. sin(k*t-tau).
  841. % More complicated examples.
  842. off exp,mcd;
  843. invlap((p+d)/(p**2*(p-a)), p, t);
  844. t*a -2
  845. - ((d*t + 1)*a + d - e *(a + d))*a
  846. invlap(e**(-tau/k*p)*c/(p*(p-a)**2), p, t);
  847. -1
  848. - (k *tau - t)*a -1 -1 -2
  849. - (e *((k *tau - t)*a + 1) - one(t - k *tau))*a *c
  850. invlap(1/((p-a)*(p-b)*(p-c)), p, t);
  851. t*b 2 -1 t*c 2 -1
  852. - (e *(a*b - a*c - b + b*c) - e *(a*b - a*c - b*c + c )
  853. t*a 2 -1
  854. - e *(a - a*b - a*c + b*c) )
  855. invlap((p**2+g*p+d)/(p*(p-a)**2), p, t);
  856. t*a -2 -2 t*a -1
  857. - (e *(a *d - 1) - a *d - e *(a + a *d + g)*t)
  858. on exp,mcd;
  859. invlap(k*c**(-b*p)/((p-a)**2+k**2), p, t);
  860. t*a 2*b*i*k 2*t*i*k
  861. e *( - c + e )
  862. -------------------------------
  863. t*i*k a*b + b*i*k
  864. 2*e *c *i
  865. on ltrig;
  866. invlap(c/(p**2*(p**2+a**2)), p, t);
  867. c*(t*a - sin(t*a))
  868. --------------------
  869. 3
  870. a
  871. invlap(1/(p**2-p+1), p, t);
  872. t/2 sqrt(3)*t
  873. 2*e *sin(-----------)
  874. 2
  875. -------------------------
  876. sqrt(3)
  877. invlap(1/(p**2-p+1)**2, p, t);
  878. t/2 sqrt(3)*t sqrt(3)*t
  879. 2*e *( - 3*t*cos(-----------) + 2*sqrt(3)*sin(-----------))
  880. 2 2
  881. ---------------------------------------------------------------
  882. 9
  883. invlap(2*a**2/(p*(p**2+4*a**2)), p, t);
  884. - cos(2*t*a) + 1
  885. -------------------
  886. 2
  887. % This is (sin(a*t))**2 and you can get this by using the let rules :
  888. for all x let sin(2*x)=2*sin x*cos x, cos(2*x)=(cos x)**2-(sin x)**2,
  889. (cos x)**2 =1-(sin x)**2;
  890. invlap(2*a**2/(p*(p**2+4*a**2)), p, t);
  891. 2
  892. sin(t*a)
  893. for all x clear sin(2*x),cos(2*x),cos(x)**2;
  894. off ltrig;
  895. on lhyp;
  896. invlap((p**2-2*a**2)/(p*(p**2-4*a**2)),p,t);
  897. cosh(2*t*a) + 1
  898. -----------------
  899. 2
  900. off lhyp;
  901. % Analogously, the above is (cosh(a*t))**2.
  902. % Floating arithmetic.
  903. invlap(2.55/((0.5*p-2.0)*(p-3.3333)), p, t);
  904. (33333*t)/10000 4*t
  905. 51000*( - e + e )
  906. ------------------------------------
  907. 6667
  908. on rounded;
  909. invlap(2.55/((0.5*p-2.0)*(p-3.3333)), p, t);
  910. 4.0*t 3.3333*t
  911. 7.64961751912*2.71828182846 - 7.64961751912*2.71828182846
  912. invlap(1.5/sqrt(p-0.5), p, t);
  913. 0.5*t
  914. 1.5*2.71828182846
  915. ------------------------
  916. 0.5
  917. t *gamma(0.5)
  918. invlap(2.75*p**2-0.5*p+e**(-0.9*p)/p, p, t);
  919. 2.75*df(delta(t),t,2) - 0.5*df(delta(t),t) + one(t - 0.9)
  920. invlap(1/(2.0*p-3.0)**3, p, t);
  921. 1.5*t 2
  922. 0.0625*2.71828182846 *t
  923. invlap(1/(2.0*p-3.0)**(3/2), p, t);
  924. 0.5 1.5*t
  925. 0.353553390593*t *2.71828182846
  926. ----------------------------------------
  927. gamma(1.5)
  928. invlap(1/(p**2-5.0*p+6), p, t);
  929. 3.0*t 2.0*t
  930. 2.71828182846 - 2.71828182846
  931. off rounded;
  932. % Adding new let rules for the invlap operator. note the syntax:
  933. for all x let invlap(log(gam*x)/x,x) = -log(lp!&);
  934. invlap(-1/2*log(gam*p)/p, p, t);
  935. log(t)
  936. --------
  937. 2
  938. invlap(-e**(-a*p)*log(gam*p)/(c*p), p, t);
  939. log(t - a)
  940. ------------
  941. c
  942. for all x clear invlap(1/x*log(gam*x),x);
  943. % Very complicated examples and use of factorizer.
  944. off exp,mcd;
  945. invlap(c**(-k*p)*(p**2+g*p+d)/(p**2*(p-a)**3), p, t);
  946. - (log(c)*k - t)*a -4
  947. (e - 1)*(a*g + 3*d)*a
  948. - (log(c)*k - t)*a 2 -1 -2
  949. + 1/2*e *( - t + log(c)*k) *(a *g + a *d + 1)
  950. - (log(c)*k - t)*a -3
  951. + (e *(a*g + 2*d) + d)*(log(c)*k - t)*a
  952. on exp,mcd;
  953. invlap(1/(2*p**3-5*p**2+4*p-1), p, t);
  954. t t/2 t
  955. e *t + 2*e - 2*e
  956. on ltrig,lhyp;
  957. invlap(1/(p**4-a**4), p, t);
  958. - sin(t*a) + sinh(t*a)
  959. -------------------------
  960. 3
  961. 2*a
  962. invlap(1/((b-3)*p**4-a**4*(2+b-5)), p, t);
  963. - sin(t*a) + sinh(t*a)
  964. -------------------------
  965. 3
  966. 2*a *(b - 3)
  967. off ltrig,lhyp;
  968. % The next three examples are the same:
  969. invlap(c/(p**3/8-9*p**2/4+27/2*p-27)**2,p,t);
  970. 6*t 5
  971. 243*e *t *c
  972. ---------------
  973. 40
  974. invlap(c/(p/2-3)**6,p,t);
  975. 6*t 5
  976. 8*e *t *c
  977. -------------
  978. 15
  979. off exp;
  980. a:=(p/2-3)**6;
  981. 6
  982. (p - 6)
  983. a := ----------
  984. 64
  985. on exp;
  986. invlap(c/a, p, t);
  987. 6*t 5
  988. 8*e *t *c
  989. -------------
  990. 15
  991. clear a;
  992. % The following two examples are the same :
  993. invlap(c/(p**4+2*p**2+1)**2, p, t);
  994. 2*t*i 3 3 2*t*i 2 2 2*t*i 2*t*i
  995. (c*(e *t + t + 6*e *t *i - 6*t *i - 15*e *t - 15*t - 15*e *i
  996. t*i
  997. + 15*i))/(96*e )
  998. invlap(c/((p-i)**4*(p+i)**4),p,t);
  999. 2*t*i 3 3 2*t*i 2 2 2*t*i 2*t*i
  1000. (c*(e *t + t + 6*e *t *i - 6*t *i - 15*e *t - 15*t - 15*e *i
  1001. t*i
  1002. + 15*i))/(96*e )
  1003. % The following three examples are the same :
  1004. invlap(e**(-k*p)/(2*p-3)**6, p, t);
  1005. (3*t)/2 5 4 3 2 2 3 4 5
  1006. e *(t - 5*t *k + 10*t *k - 10*t *k + 5*t*k - k )
  1007. ------------------------------------------------------------
  1008. (3*k)/2
  1009. 7680*e
  1010. invlap(e**(-k*p)/(4*p**2-12*p+9)**3, p, t);
  1011. (3*t)/2 5 4 3 2 2 3 4 5
  1012. e *(t - 5*t *k + 10*t *k - 10*t *k + 5*t*k - k )
  1013. ------------------------------------------------------------
  1014. (3*k)/2
  1015. 7680*e
  1016. invlap(e**(-k*p)/(8*p**3-36*p**2+54*p-27)**2, p, t);
  1017. (3*t)/2 5 4 3 2 2 3 4 5
  1018. e *(t - 5*t *k + 10*t *k - 10*t *k + 5*t*k - k )
  1019. ------------------------------------------------------------
  1020. (3*k)/2
  1021. 7680*e
  1022. % Error messages.
  1023. invlap(e**(a*p)/p, p, t);
  1024. *** Invlap for e**(p*a)/p not known
  1025. a*p
  1026. e
  1027. invlap(------,p,t)
  1028. p
  1029. invlap(c*p*sqrt(p), p, t);
  1030. *** Invlap for sqrt(p)*p not known
  1031. invlap(sqrt(p)*c*p,p,t)
  1032. invlap(sin(p), p, t);
  1033. *** Invlap for sin(p) not known
  1034. invlap(sin(p),p,t)
  1035. invlap(1/(a*p**3+b*p**2+c*p+d),p,t);
  1036. *** Invlap for (p**3*a + p**2*b + p*c + d)**(-1) not known
  1037. 1
  1038. invlap(-----------------------,p,t)
  1039. 3 2
  1040. a*p + b*p + c*p + d
  1041. invlap(1/(p**2-p*sin(p)+a**2),p,t);
  1042. *** Invlap for (p**2 - p*sin(p) + a**2)**(-1) not known
  1043. - 1
  1044. invlap(--------------------,p,t)
  1045. 2 2
  1046. sin(p)*p - a - p
  1047. on rounded;
  1048. invlap(1/(p**3-1), p, t);
  1049. *** Invlap for (p**3 - 1)**(-1) not known
  1050. 1
  1051. invlap(--------,p,t)
  1052. 3
  1053. p - 1
  1054. off rounded;
  1055. % Severe errors:
  1056. %invlap(1/(p**2+1), p+1, sin(t) );
  1057. %invlap(p/(p+1)**2, sin(p), t);
  1058. end;
  1059. (TIME: laplace 8570 8939)