Thu Feb 25 19:37:31 MST 1999 aquarius% maple |\^/| Maple V Release 5.1 (WMI Campus Wide License) ._|\| |/|_. Copyright (c) 1981-1998 by Waterloo Maple Inc. All rights \ MAPLE / reserved. Maple and Maple V are registered trademarks of <____ ____> Waterloo Maple Inc. | Type ? for help. # ----------[ M a p l e ]---------- #interface(echo = 3); # ---------- Initialization ---------- > readlib(showtime): > on; # ---------- Partial Differential Equations ---------- # This is the heat equation O1 := heat:= diff(u(x, t), t) - diff(u(x, t), x$2) = 0; / 2 \ /d \ |d | |-- u(x, t)| - |--- u(x, t)| = 0 \dt / | 2 | \dx / time = 0.03, bytes = 40202 # This is the similarity form of the proposed solution O2 := s:= f(x/sqrt(t))/sqrt(t); x f(----) 1/2 t ------- 1/2 t time = 0.12, bytes = 281678 # Substitute s into the heat equation O3 := eval(subs(u(x, t) = s, heat)); x x (2) x D(f)(----) x f(----) (D )(f)(----) 1/2 1/2 1/2 t t t - 1/2 ------------ - 1/2 ------- - --------------- = 0 2 3/2 3/2 t t t time = 0.04, bytes = 51262 # Change to the similarity variable z = x/sqrt(t) O4 := subs(x = z*sqrt(t), %); (2) D(f)(z) z f(z) (D )(f)(z) - 1/2 --------- - 1/2 ---- - ------------ = 0 3/2 3/2 3/2 t t t time = 0.01, bytes = 15314 # Combine over a common denominator O5 := normal(%); (2) D(f)(z) z + f(z) + 2 (D )(f)(z) - 1/2 --------------------------------- = 0 3/2 t time = 0.02, bytes = 19858 # Eliminate the denominator O6 := % * denom(lhs(%)); (2) -D(f)(z) z - f(z) - 2 (D )(f)(z) = 0 time = 0.04, bytes = 26250 # Now, solve the ordinary differential equation O7 := sol:= dsolve(%, f(z)); bytes used=1056076, alloc=851812, time=0.70 bytes used=2058992, alloc=1572576, time=1.50 bytes used=3059312, alloc=2227816, time=2.64 2 2 1/2 2 _C2 exp(- 1/4 z ) z erf(1/2 (-z ) ) f(z) = _C1 exp(- 1/4 z ) + ------------------------------------- 2 1/2 (-z ) time = 2.51, bytes = 2613466 # Finally, transform back to the original variables O8 := s:= 's': time = 0.01, bytes = 7210 O9 := s = subs(z = x/sqrt(t), rhs(sol))/sqrt(t); 2 / 2 \1/2 x | x | 2 _C2 exp(- 1/4 ----) x erf(1/2 |- ----| ) x t \ t / _C1 exp(- 1/4 ----) + ------------------------------------------ t / 2 \1/2 1/2 | x | t |- ----| \ t / s = ---------------------------------------------------------------- 1/2 t time = 0.00, bytes = 6030 # If we set _C1 = 1/(2 sqrt(pi)) and _C2 = 0 in the previous expression, # we will obtain the usual fundamental solution of the heat equation O10 := subs({_C1 = 1/(2*sqrt(Pi)), _C2 = 0}, %); 2 x exp(- 1/4 ----) t s = 1/2 --------------- 1/2 1/2 Pi t time = 0.03, bytes = 25846 # ---------- Quit ---------- O11 := quit bytes used=3351300, alloc=2227816, time=2.94 real 3.93 user 3.00 sys 0.95