Mon Feb 22 22:00:43 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) /* ---------- Vector Analysis ---------- */ /* Vector norm => sqrt(15) */ mat_norm([1 + %i, -2, 3*%i]); /aquarius/data2/opt/local/macsyma_422/matrix/mathfuns.so being loaded. /aquarius/data2/opt/local/macsyma_422/matrix/simpfuns.so being loaded. Time= 130 msecs (d5) sqrt(15) (c6) load(vect)$ /aquarius/data2/opt/local/macsyma_422/share/vect.so being loaded. Time= 470 msecs (c7) /* Cross product: (2, 2, -3) x (1, 3, 1) => (11, -5, 4) */ vect_express([2, 2, -3] ~ [1, 3, 1]); Time= 0 msecs (d7) [11, - 5, 4] (c8) declare([a, b, c, d, f, g], nonscalar)$ Time= 0 msecs (c9) /* (a x b) . (c x d) => (a . c) (b . d) - (a . d) (b . c) */ (a ~ b) . (c ~ d); Time= 20 msecs (d9) a . b ~ c ~ d (c10) vectorsimp(%), expandall; Time= 260 msecs (d10) (a . c) (b . d) - (a . d) (b . c) (c11) /* => (2 y z^3 - 2 x^2 y^2 z, x y, 2 x y^2 z^2 - x z) */ vect_express(curl [x*y*z, x^2*y^2*z^2, y^2*z^3]); Time= 10 msecs d 2 3 d 2 2 2 d d 2 3 (d11) [-- (y z ) - -- (x y z ), -- (x y z) - -- (y z ), dy dz dz dx d 2 2 2 d -- (x y z ) - -- (x y z)] dx dy (c12) ev(%, diff); Time= 10 msecs 3 2 2 2 2 (d12) [2 y z - 2 x y z, x y, 2 x y z - x z] (c13) /* DEL . (f x g) => g . (DEL x f) - f . (DEL x g) */ div (f ~ g); Time= 0 msecs (d13) DIV (f ~ g) (c14) vectorsimp(%), expandall; Time= 10 msecs (d14) DIV (f ~ g) (c15) remove([a, b, c, d, f, g], nonscalar)$ Time= 0 msecs (c16) /* Express DEL . a in spherical coordinates (r, theta, phi) for a = (a_r(r, theta, phi), a_theta(r, theta, phi), a_phi(r, theta, phi)). Here, phi is in the x-y plane and theta is the angle with the z-axis. => 1/r^2 d/dr[r^2 a_r] + 1/[r sin(theta)] d/dtheta[sin(theta) a_theta] + 1/[r sin(theta)] da_phi/dphi => da_r/dr + (2 a_r)/r + 1/r da_theta/dtheta + a_theta/[r tan(theta)] + 1/[r sin(theta)] da_phi/dphi See Keith R. Symon, _Mechanics_, Third Edition, Addison-Wesley Publishing Company, 1971, p. 103. */ vect_coordsys(spherical)$ /aquarius/data2/opt/local/macsyma_422/share/vect_ort.so being loaded. /aquarius/data2/opt/local/macsyma_422/matrix/matfuncs.so being loaded. /aquarius/data2/opt/local/macsyma_422/share/trigsimp.so being loaded. Time= 4800 msecs (c17) vect_coords; Time= 0 msecs (d17) [r, phi, theta] (c18) depends([a_r, a_theta, a_phi], [r, theta, phi]); Time= 0 msecs (d18) [a_r(r, theta, phi), a_theta(r, theta, phi), a_phi(r, theta, phi)] (c19) vect_express(div [a_r, a_phi, a_theta]); Time= 0 msecs d 2 d d -- (a_r r sin(theta)) + ------ (a_theta r sin(theta)) + ---- (a_phi r) dr dtheta dphi (d19) ----------------------------------------------------------------------- 2 r sin(theta) (c20) expand(ev(%, 'diff)); Time= 10 msecs da_phi da_theta ------ -------- a_theta cos(theta) dphi dtheta 2 a_r da_r (d20) ------------------ + ------------ + -------- + ----- + ---- r sin(theta) r sin(theta) r r dr (c21) remove([a_r, a_theta, a_phi], dependency)$ Time= 0 msecs (c22) /* Express dR/dt in spherical coordinates (r, theta, phi) where R is the position vector r*Rhat(theta, phi) with Rhat being the unit vector in the direction of R => (dr/dt, r dtheta/dt, r sin(theta) dphi/dt) [Symon, p. 98] */ depends([r, theta, phi], t, rhat, [theta, phi])$ Time= 0 msecs (c23) vect_express(diff([r*rhat, 0, 0], t)); Time= 10 msecs drhat dtheta dphi drhat dr (d23) [r (------ ------ + ---- -----) + -- rhat, 0, 0] dtheta dt dt dphi dt (c24) remove([r, theta, phi, rhat], dependency, ".", commutative)$ Time= 0 msecs (c25) vect_coordsys(cartesian3d)$ Time= 30 msecs (c26) /* Scalar potential => x^2 y + y + 2 z^3 */ scalar_potential([2*x*y, x^2 + 1, 6*z^2]); Time= 80 msecs 3 2 (d26) 2 z + (x + 1) y (c27) /* Vector potential => (x y z, x^2 y^2 z^2, y^2 z^3) is one possible solution. See Harry F. Davis and Arthur David Snider, _Introduction to Vector Analysis_, Third Edition, Allyn and Bacon, Inc., 1975, p. 97. */ vector_potential([2*y*z^3 - 2*x^2*y^2*z, x*y, 2*x*y^2*z^2 - x*z]); Time= 390 msecs 4 2 2 2 y z - 2 x y z (d27) [x y z, - -----------------, 0] 2 (c28) vect_express(curl(%))$ Time= 20 msecs (c29) ratsimp(ev(%, diff)); Time= 20 msecs 3 2 2 2 2 (d29) [2 y z - 2 x y z, x y, 2 x y z - x z] (c30) /* Orthogonalize the following vectors (Gram-Schmidt). See Lee W. Johnson and R. Dean Riess, _Introduction to Linear Algebra_, Addison-Wesley Publishing Company, 1981, p. 104 => [[0 1 2 1], [0 -1 1 -1], [2 1 0 -1]]^T */ [[0, 1, 2, 1], [0, 1, 3, 1], [1, 1, 1, 0], [1, 3, 6, 2]]; Time= 0 msecs (d30) [[0, 1, 2, 1], [0, 1, 3, 1], [1, 1, 1, 0], [1, 3, 6, 2]] (c31) gramschmidt(%); /aquarius/data2/opt/local/macsyma_422/matrix/eigen.so being loaded. Time= 190 msecs 1 1 1 1 1 (d31) [[0, 1, 2, 1], [0, - -, -, - -], [1, -, 0, - -]] 3 3 3 2 2 (c32) /* ---------- Quit ---------- */ quit(); Bye. real 10.94 user 6.95 sys 1.34