Mon Feb 22 23:05:39 MST 1999 aquarius% macsyma Starting Macsyma math engine with no window system... /opt/local/macsyma_422/macsyma.422 local This is Macsyma 422.0 for Sparc (Solaris 2.x) computers. Copyright (c) 1982 - 1998 Macsyma Inc. All rights reserved. Portions copyright (c) 1982 Massachusetts Institute of Technology. All rights reserved. Type "DESCRIBE(TRADE_SECRET);" to see important legal notices. Type "HELP();" for more information. /aquarius/data2/opt/local/macsyma_422/system/init.lsp being loaded. /aquarius/home/wester/macsyma-init.lsp being loaded. (c1) (c2) /* ----------[ M a c s y m a ]---------- */ /* ---------- Initialization ---------- */ symbol_display_case: lower_case$ Time= 0 msecs (c3) showtime: all$ Time= 0 msecs (c4) prederror: false$ Time= 0 msecs (c5) load(ndiff)$ /aquarius/data2/opt/local/macsyma_422/share/ndiff.so being loaded. Time= 80 msecs (c6) /* ---------- Partial Differential Equations ---------- */ /* This is the heat equation */ heat: 'diff(u, t) - 'diff(u, x, 2) = 0; Time= 0 msecs 2 du d u (d6) -- - --- = 0 dt 2 dx (c7) /* This is the similarity form of the proposed solution */ s: f(x/sqrt(t))/sqrt(t); Time= 0 msecs x f(-------) sqrt(t) (d7) ---------- sqrt(t) (c8) /* Substitute s into the heat equation */ subst(u = s, heat)$ Time= 0 msecs (c9) ev(%, diff); Time= 20 msecs (2) x (1) x x f (-------) x f (-------) f(-------) sqrt(t) sqrt(t) sqrt(t) (d9) - ------------- - --------------- - ---------- = 0 3/2 2 3/2 t 2 t 2 t (c10) /* Change to the similarity variable z = x/sqrt(t) */ subst(x = z*sqrt(t), %); Time= 0 msecs (2) (1) f (z) z f (z) f(z) (d10) - ------- - --------- - ------ = 0 3/2 3/2 3/2 t 2 t 2 t (c11) /* Combine over a common denominator */ ratsimp(%); Time= 10 msecs (2) (1) 2 f (z) + z f (z) + f(z) (d11) - ---------------------------- = 0 3/2 2 t (c12) /* Eliminate the denominator */ % * denom(lhs(%)); Time= 0 msecs (2) (1) (d12) - 2 f (z) - z f (z) - f(z) = 0 (c13) /* Rewrite the differential equation in MACSYMA's normal notation */ convert_to_de(%); Time= 0 msecs 2 d d (d13) - 2 (--- (f(z))) - z (-- (f(z))) - f(z) = 0 2 dz dz (c14) /* Now, solve the ordinary differential equation */ ode2(%, f(z), z); /aquarius/data2/opt/local/macsyma_422/ode/ode2.so being loaded. Time= 550 msecs 2 z 2 - -- z 4 %i z - -- sqrt(%pi) %i %k1 %e erf(----) 4 2 (d14) f(z) = %k2 %e - --------------------------------- 2 (c15) /* Finally, transform back to the original variables */ 's = subst(x/sqrt(t), z, rhs(%))/sqrt(t); Time= 10 msecs 2 x 2 - --- x 4 t %i x - --- sqrt(%pi) %i %k1 %e erf(---------) 4 t 2 sqrt(t) %k2 %e - --------------------------------------- 2 (d15) s = ----------------------------------------------------- sqrt(t) (c16) /* If we set %k1 = 0 and %k2 = 1/(2 sqrt(pi)) in the previous expression, we will obtain the usual fundamental solution of the heat equation */ subst([%k1 = 0, %k2 = 1/(2*sqrt(%pi))], %); Time= 10 msecs 2 x - --- 4 t %e (d16) s = ------------------- 2 sqrt(%pi) sqrt(t) (c17) /* ---------- Quit ---------- */ quit(); Bye. real 4.47 user 1.02 sys 1.09