Mon Mar 9 16:38:23 MST 1998 euler% math Mathematica 3.0 for Solaris Copyright 1988-96 Wolfram Research, Inc. -- Terminal graphics initialized -- In[1]:= In[2]:= In[3]:= (* ----------[ M a t h e m a t i c a ]---------- *) 0. Second In[4]:= (* ---------- Initialization ---------- *) 0. Second In[5]:= (* ---------- Vector Analysis ---------- *) 0. Second In[6]:= << Calculus`VectorAnalysis` 0.19 Second In[7]:= (* Vector norm => sqrt(15) *) 0. Second In[8]:= norm[v_]:= First[Sqrt[v . Conjugate[Transpose[{v}]]]] 0. Second In[9]:= norm[{1 + I, -2, 3*I}] 0.02 Second Out[9]= Sqrt[15] In[10]:= Clear[norm] 0. Second In[11]:= (* Cross product: (2, 2, -3) x (1, 3, 1) => (11, -5, 4) *) 0. Second In[12]:= Cross[{2, 2, -3}, {1, 3, 1}] 0. Second Out[12]= {11, -5, 4} In[13]:= (* (a x b) . (c x d) => (a . c) (b . d) - (a . d) (b . c) *) 0. Second In[14]:= Cross[a, b] . Cross[c, d] 0. Second Out[14]= Cross[a, b] . Cross[c, d] In[15]:= (* => (2 y z^3 - 2 x^2 y^2 z, x y, 2 x y^2 z^2 - x z) *) 0. Second In[16]:= SetCoordinates[Cartesian[x, y, z]]; 0. Second In[17]:= Curl[{x*y*z, x^2*y^2*z^2, y^2*z^3}] 0.01 Second 2 2 3 2 2 Out[17]= {-2 x y z + 2 y z , x y, -(x z) + 2 x y z } In[18]:= (* DEL . (f x g) => g . (DEL x f) - f . (DEL x g) *) 0. Second In[19]:= Div[Cross[f, g]] 0. Second Out[19]= Div[Cross[f, g]] In[20]:= (* 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. *) 0. Second In[21]:= Div[{ar[r, theta, phi], atheta[r, theta, phi], aphi[r, theta, phi]}, Spherical[r, theta, phi]] 0.02 Second Out[21]= (Csc[theta] (r atheta[r, theta, phi] Cos[theta] + (0,0,1) > 2 r ar[r, theta, phi] Sin[theta] + r aphi [r, theta, phi] + (0,1,0) > r Sin[theta] atheta [r, theta, phi] + 2 (1,0,0) 2 > r Sin[theta] ar [r, theta, phi])) / r In[22]:= Expand[%] 0. Second 2 ar[r, theta, phi] atheta[r, theta, phi] Cot[theta] Out[22]= ------------------- + -------------------------------- + r r (0,0,1) (0,1,0) Csc[theta] aphi [r, theta, phi] atheta [r, theta, phi] > ------------------------------------- + ---------------------------- + r r (1,0,0) > ar [r, theta, phi] In[23]:= (* 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] *) 0. Second In[24]:= SetCoordinates[Spherical[r, theta, phi]]; 0.01 Second In[25]:= D[{r[t]*rhat[theta[t], phi[t]], 0, 0}, t] 0. Second Out[25]= {rhat[theta[t], phi[t]] r'[t] + (0,1) > r[t] (phi'[t] rhat [theta[t], phi[t]] + (1,0) > theta'[t] rhat [theta[t], phi[t]]), 0, 0} In[26]:= (* Scalar potential => x^2 y + y + 2 z^3 *) 0. Second In[27]:= (*ScalarPotential[{2*x*y, x^2 + 1, 6*z^2}]*) 0. Second In[28]:= (* 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. *) 0. Second In[29]:= (*VectorPotential[{2*y*z^3 - 2*x^2*y^2*z, x*y, 2*x*y^2*z^2 - x*z}] Curl[%]*) 0. Second In[30]:= (* 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. Second In[31]:= << LinearAlgebra`Orthogonalization` 0.01 Second In[32]:= {{0, 1, 2, 1}, {0, 1, 3, 1}, {1, 1, 1, 0}, {1, 3, 6, 2}} 0. Second Out[32]= {{0, 1, 2, 1}, {0, 1, 3, 1}, {1, 1, 1, 0}, {1, 3, 6, 2}} In[33]:= GramSchmidt[%, Normalized -> False] 0.01 Second 1 1 1 1 1 Out[33]= {{0, 1, 2, 1}, {0, -(-), -, -(-)}, {1, -, 0, -(-)}, {0, 0, 0, 0}} 3 3 3 2 2 In[34]:= (* ---------- Quit ---------- *) 0. Second In[35]:= Quit[] real 3.48 user 1.09 sys 0.35