Mon Feb 23 12:24:22 MST 1998 aquarius% mupad *----* MuPAD 1.4.0 -- Multi Processing Algebra Data Tool /| /| *----* | Copyright (c) 1997 - 98 by SciFace Software GmbH | *--|-* All rights reserved. |/ |/ *----* Licensed to: Michael Wester >> # ----------[ M u P A D ]---------- # >> # ---------- Initialization ---------- # >> TEXTWIDTH:= 80: >> read("../../Time.mupad"): >> # ---------- Transforms ---------- # >> # Laplace and inverse Laplace transforms # >> # => s/[s^2 + (w - 1)^2] (Re s > |Im(w - 1)|) &> [Gradshteyn and Ryzhik 17.13(33)] # >> transform::laplace(cos((w - 1)*t), t, s); s ------------- 2 2 s + (w - 1) Time: 7180 msec Type: "_mult" >> transform::ilaplace(%, s, t); 2 1/2 cos(t (w - 2 w + 1) ) Time: 2490 msec Type: "cos" >> # => w/(s^2 - 4 w^2) (Re s > |Re w|) [Gradshteyn and Ryzhik 17.13(84)] # >> transform::laplace(sinh(w*t)*cosh(w*t), t, s); s - w s + w ----------------- - ----------------- 2 2 2 2 2 ((s - w) - w ) 2 ((s + w) - w ) Time: 980 msec Type: "_plus" >> Factor(%); w ------------------- (s - 2 w) (s + 2 w) Time: 1870 msec Type: "_mult" >> # e^(-6 sqrt(s))/s (Re s > 0) [Gradshteyn and Ryzhik 17.13(102)] # >> transform::laplace(erf(3/sqrt(t)), t, s); / / 3 \ \ laplace| erf| ---- |, t, s | | | 1/2 | | \ \ t / / Time: 260 msec Type: "transform::laplace" >> # Solve y'' + y = 4 [H(t - 1) - H(t - 2)], y(0) = 1, y'(0) = 0 where H is the &> Heaviside (unit step) function (the RHS describes a pulse of magnitude 4 and &> duration 1). See David A. Sanchez, Richard C. Allen, Jr. and Walter T. &> Kyner, _Differential Equations: An Introduction_, Addison-Wesley Publishing &> Company, 1983, p. 211. First, take the Laplace transform of the ODE &> => s^2 Y(s) - s + Y(s) = 4/s [e^(-s) - e^(-2 s)] &> where Y(s) is the Laplace transform of y(t) # >> transform::laplace(y''(t) + y(t) = 4*(heaviside(t - 1) - heaviside(t - 2)), &> t, s); 2 laplace(y(t), t, s) - D(y)(0) - s y(0) + s laplace(y(t), t, s) = 4 exp(-s) 4 exp(-2 s) --------- - ----------- s s Time: 10930 msec Type: "_equal" >> subs(%, [y(0) = 1, D(y)(0) = 0]); 2 4 exp(-s) 4 exp(-2 s) laplace(y(t), t, s) - s + s laplace(y(t), t, s) = --------- - ----------- s s Time: 180 msec Type: "_equal" >> # Now, solve for Y(s) and then take the inverse Laplace transform &> => Y(s) = s/(s^2 + 1) + 4 [1/s - s/(s^2 + 1)] [e^(-s) - e^(-2 s)] &> => y(t) = cos t + 4 {[1 - cos(t - 1)] H(t - 1) - [1 - cos(t - 2)] H(t - 2)} # >> op(linsolve([%], [transform::laplace(y(t), t, s)])); 2 s + 4 exp(-s) - 4 exp(-2 s) laplace(y(t), t, s) = ---------------------------- 3 s + s Time: 3960 msec Type: "_equal" >> transform::ilaplace(%, s, t); / 1 \ y(t) = cos(t) + 4 ilaplace| ---------------, s, t | - | 3 | \ exp(s) (s + s ) / / 1 \ 4 ilaplace| ----------------, s, t | | 2 3 | \ exp(s) (s + s ) / Time: 910 msec Type: "_equal" >> # What is the Laplace transform of an infinite square wave? &> => 1/s + 2 sum( (-1)^n e^(- s n a)/s, n = 1..infinity ) &> [Sanchez, Allen and Kyner, p. 213] # >> transform::laplace(1 + 2*sum((-1)^n*heaviside(t - n*a), n = 1..infinity), t, s); 1 n - + 2 laplace(sum((-1) heaviside(t - a n), n = 1..infinity), t, s) s Time: 2200 msec Type: "_plus" >> # Fourier transforms => sqrt(2 pi) delta(z) [Gradshteyn and Ryzhik 17.23(1)] &> # >> transform::fourier(1, x, z); 2 PI dirac(z) Time: 1420 msec Type: "_mult" >> # => e^(-z^2/36) / [3 sqrt(2)] [Gradshteyn and Ryzhik 17.23(13)] # >> transform::fourier(exp(-9*x^2), x, z); / 2 \ / PI \1/2 | z | | -- | exp| - -- | \ 9 / \ 36 / Time: 270 msec Type: "_mult" >> simplify(%); / 2 \ 1/2 | z | PI exp| - -- | \ 36 / ----------------- 3 Time: 1730 msec Type: "_mult" >> # => sqrt(2 / pi) (9 - z^2)/(9 + z^2)^2 [Gradshteyn and Ryzhik 17.23(11)] # >> transform::fourier(abs(x)*exp(-3*abs(x)), x, z); / abs(x) \ transform::fourier| ------------, x, z | | 3 | \ exp(abs(x)) / Time: 3450 msec Type: "function" >> # Mellin transforms &> => pi cot(pi s) (0 < Re s < 1) [Gradshteyn and Ryzhik 17.43(5)] # >> transform::mellin(1/(1 - x), x, s); / 1 \ transform::mellin| -----, x, s | \ 1 - x / Time: 810 msec Type: "function" >> # => 2^(s - 4) gamma(s/2)/gamma(4 - s/2) (0 < Re s < 1) &> [Gradshteyn and Ryzhik 17.43(16)] # >> transform::mellin(besselJ(3, x)/x^3, x, s); transform::mellin(besselJ(3, x), x, s - 3) Time: 280 msec Type: "function" >> # Z transforms. See _CRC Standard Mathematical Tables_, Twenty-first Edition, &> The Chemical Rubber Company, 1973, p. 518. &> Z[H(t - m T)] => z/[z^m (z - 1)] (H is the Heaviside (unit step) function) # >> heaviside(t - 3); heaviside(t - 3) Time: 680 msec Type: "heaviside" >> heaviside(t - m); heaviside(t - m) Time: 790 msec Type: "heaviside" >> # ---------- Quit ---------- # >> quit real 47.56 user 42.71 sys 1.01