Electricity an Magnetism Computer Lab #: Vector algebra an calculus We are going to learn how to use MathCa. First we use MathCa as a calculator. Type: 54.4+.-(/5+4/5)^= To get the power we type hat. 54.4. 4 55.64 5 5 To get square root type \. For instance type: \/ space bar+.^=..6 Next we learn how to efine functions an variables. An important operator is the assign operator. Type colon. It shows as := Another important operator is until. Type semi-colon. It shows.. f( x) sin x sin x x 4π4 π. 4π sin 5x sin 7x sin x To type greek letters, e. g. π, you either use the Greek Symbol Toolbar or type the corresponing English letter followe by control g. To graph the function efine above click on the graph palette an choose xy plot. Then click on Format Graph an ajust the graph format to the esire form. 5 f( x) 5 9 9 5 5 x Copyright @Miron Kaufman 7
We raw a sphere using a D parametric graph. We use spherical coorinates. xrθ ( ϕ) rcos( ϕ) sin( θ) yrθ ( ϕ) rsin( ϕ) sin( θ) zrθ ( ϕ) rcos( θ) i 4 j 4 r θ π i ϕ π j i 4 j 4 X ij xrθ ϕ i j Y ij yrθ ϕ i j Z ij zrθ ϕ i j Now chose Graph Surface Plot. In the place holer type (X,Y,Z). ( XY Z) Besie assign (efinition) := an evaluate numerically = operators, we can also use evalua symbolicaly (from evaluation toolbar). Compute volume of sphere: π π R r sin( θ) r ϕ θ 4πR Compute area of sphere: π π R sin( θ) ϕ θ 4πR Copyright @Miron Kaufman 7
We graph next a cyliner, by using cylinrical coorinates. s x( sϕ ζ) scos( ϕ) y( sϕ ζ) ssin( ϕ) z( sϕ ζ) ζ i 4 j 4 ϕ π i j ζ i 4 j X ij xsϕ ζ i j Y ij ysϕ ζ i j Z ij zsϕ ζ i j ( XY Z) Compute volume of cyliner: Compute lateral area of cyliner: H π R s s ϕ z H π R ϕ z πhr πhr Copyright @Miron Kaufman 7
Creating a vector: Use the insert matrix comman. V V Dot prouct: VV Note that the ot prouct oes not work with vectors efine as rows: V ( ) V4 ( 4 ) V V4 Cross prouct: Z Y Z Y The cross prouct oes not work unless the vectors have three elements: 5 Transpose: Z T ( ) Y T ( ) Z T Y T Z T Y T Note that the cross an ot proucts o not work with vectors efine as rows. Copyright @Miron Kaufman 7 4
Matrices, Determinants: M M T M M T M Note that if eterminant of matrix is zero there is no inverse. M M T M 6 M T 6.5 M.5.5.5.5.5.5.5 Note the eterminant of transpose matrix equals eterminant of original matrix. MM M M This is ientity matrix. M.6 M M M 5 MM 8 6 4 MM 7 6 5 6 5 8 Matrix prouct is not commutative. MM 68 M M 68 Determinant of prouct equals prouct of eterminants. Copyright @Miron Kaufman 7 5
Vector Triple Prouct: A.5 B.. 5. C.5.5.5 We verify Ax(BxC)= (A*C)B-(A*B)C.65 B C 6.8 A ( B C).95 AB 9.5 AC.5 ( AC ) B ( AB ) C 5.7 4.65.9 5.7 4.65.9 We verify (AxB)xC = (A*C)B - (B*C)A.8 A B 7.85 ( A B) C AC.5 BC 4. 4. ( AC )B ( BC) A 9.45. 4.75 9.45. 4.75 Scalar Triple Prouct: Equals the volume of the parallelipipe generate by A, B, C. We verify A*(BxC) = C*(AxB) = B*(AxC) = (AxB)*C A( B C) 45.5 C( A B) 45.5 B( C A) 45.5 ( A B) C 45.5 6 Copyright @Miron Kaufman 7
Graient, Divergence, Curl, Laplacean: To insert the graient (el) operator, press [Ctrl] [Shift] G: Type the variable vector in the lower placeholer, an type the function in the upper placeholer. To illustrate this we consier the potential of a point-like charge Q locate at the origin. Up to a multiplicative constant Q/ε, it is: V( R) R R R To evaluate the graient we nee to use the evaluate symbolically operator (you fin it in Evaluation Toolbar an in Symbolic Toolbar). VR ( ) R R R R R R R R R R R R R Copyright @Miron Kaufman 7 7
The electric fiel is the negative of graient of potential: Exy ( z ) x x y z y x y z z x y z The ivergence operator * an the curl operator x are efine next. iv( Ax y z ) x Ax ( yz ) y Ax ( yz ) z Ax ( yz ) curl( Ax y z ) y Ax ( yz ) z Ax ( yz ) z Ax ( yz ) x Ax ( yz ) x Ax ( yz ) y Ax ( yz ) For the electrical fiel E of a point charge at location away from charge location: the Gauss law is *E= an the Faraay law is xe =. Also the potential V, E = - V, satisfies the Laplace equation V =. We verify this next. iv( Exxyyzz) simplify laplacean( Fx y z ) V( xy z ) x y z Fx ( yz ) x Fx ( yz ) y curl( Exxyyzz) Fx ( yz ) z laplacean( Vxxyyzz) simplify Copyright @Miron Kaufman 7 8
By using vector fiel graph we can visualize the lines of electric fiel. Ex( xy z ) x x y z Ey( xy z ) y x y z Ez( xy z ) z x y z i j X ij ex ij i. 6 Ex X Y ij ij Ex X Y ij ij Y ij j EyX Y ij ij. 6 ey ij The reason we a the -6 to the coorinates X an Y is to evaluate the fiel away from the origin (where the charge particle is locate) where E is infinite. Ex X Y ij ij Ey X Y ij ij EyX Y ij ij ( exey) Copyright @Miron Kaufman 7 9
Griffiths Ch. Problem Calculate the graients of the following functions. xxyy xxyy xx yy zz 4 zz xx yy zz 4 zz e xx sin( yy) ln( zz) xxyyzz xx yy 4zz xx yy zz 4 xx yy zz 4 4xx yy zz e xx sin( yy) ln( zz) e xx cos( yy) ln( zz) e xx sin( yy) zz Copyright @Miron Kaufman 7
Griffiths Ch. Problems 5, 8 Calculate ivergence an curl of the following functions. va( xy z ) x x z xz iv( vaxxyyzz) curl( vaxxyyzz) 6xxzz zz zz vb( xy z ) xy y z z x iv( vbxxyyzz) xx yy zz curl( vbxxyyzz) yy zz xx vc( xy z ) y x y z y z iv( vcxxyyzz) xx yy curl( vcxxyyzz) Copyright @Miron Kaufman 7