Calculus and Coordinate systems EE 311 - Lecture 17 1. Calculus and coordinate systems 2. Cartesian system 3. Cylindrical system 4. Spherical system In electromagnetics, we will often need to perform integrals along lines, over surfaces, or throughout volumes These will require us to specify small changes in lengths, areas, or volumes in terms of our OCS coordinates In Cartesian coordinates this is easy because all coordinates (x, y, and z) are lengths However, in many OCS s, some of the coordinates are angles and not lengths, so we have to multiply these coordinates by factors to convert them into lengths before they can be used in line, surface, or volume integrals Consider our general OCS, with coordinates u1, u2, and u3 1 2 Vector surface area Differentials in an OCS We will be interested in small vector length changes: dl = û1 (h 1 du 1 ) + u2 ˆ (h 2 du 2 ) + u3 ˆ (h 3 du 3 ) which has magnitude dl = (h 1 du 1 ) 2 + (h 2 du 2 ) 2 + (h 3 du 3 ) 2 A differential volume can be written as dv = h 1 h 2 h 3 du 1 du 2 du 3 A differential area along a surface which has vector û1 as its normal can be written as ds 1 = h 2 h 3 du 2 du 3 Similarly, differential areas along surfaces with û2 or û3 as normals are ds 2 = h 1 h 3 du 1 du 3 and ds 3 = h 1 h 2 du 1 du 2 We ll write specific examples of these as we go... 3 In many cases, we will be interested in the amount of a vector flowing through a surface This will require defining a vector ds as a differential area times a unit vector normal to the surface The unit normal vector is usually chosen to be outward pointing for a closed surface Then A ds gives us the normal component of A at a point on the surface times a differential area. This can then be integrated over the surface area to get the total amount of A going out of the surface. +q n^ Imaginary spherical surface 4
Cartesian system Coordinates in a Cartesian system are (x, y, z), and all are real lengths. These numbers refer to the minimum distances of planes parallel to the yz, xz, and xy planes from the origin. Intersection of these three surfaces locates the point (x, y, z) Unit vectors are ˆx, ŷ, and ẑ, pointing in directions of increasing x, y, or z coordinates respectively. Note all are constant thoughout space ˆx ŷ = ẑ and so on as specified previously In all OCS s, a vector from the origin to a point P is defined as r P, a position vector for point P. In Cartesian coordinates for P = (x 1, y 1, z 1 ), r P = ˆxx 1 + ŷy 1 + ẑz 1 An arbitrary vector is written as A = ˆxA x + ŷa y + ẑa z, and dot and cross products follow rules previously given Cartesian system and example A general small vector can be written as dl = ˆxdx + ŷdy + ẑdz, dv = dx dy dz, ds x = dy dz, etc. Example: Point P is at coodinates (x = 1, y = 3, z = 4). Point Q is at coordinates (x = 2, y = 5, z = 6). Find a vector r PQ from point P to point Q. Solution: First find position vectors from the origin to points P and Q. Position vector r P = ˆx + 3ŷ + 4ẑ Position vector r Q = 2ˆx + 5ŷ + 6ẑ A vector from P to Q can be seen to be r Q r P since r P + (r Q r P ) = r Q by the head to tail rule Thus our vector r PQ = r Q r P which is (2ˆx + 5ŷ + 6ẑ) (ˆx + 3ŷ + 4ẑ) or = ˆx + 2ŷ + 2ẑ or 3 if we separate magnitude and direction ( ) ˆx+2ŷ+2ẑ 3 5 6 Geometry of previous example z z 2 P 1 (x 1, y 1, z 1 ) Another Cartesian example z 1 R 12 R 1 R 2 P 2 (x 2, y 2, z 2 ) A chest 1 m wide by.5 m thick by.25 m deep is filled with a material whose mass density increases exponentially as we get deeper in the box, according to O y 1 y 2 y ρ = e.1z x x 2 x 1 where ρ is the mass density in kg/m 3 and z = is the top of the box. What is the total mass of material in the box? 8 7
Solution To get the total mass we need to add up all the density times the volume throughout the box this is a volume integral! dv ρ = dx dy dz ρ in Cartesian coordinates..25m.5m m m dx dy dz e.1z = (.5) dz e z 1 o.25m.5m.25m.25m = (.5) ( 1e ) z 1 z= z=.25 = 5 ( 1 e.25) which is.13 kg! Note we had to integrate here because the mass density was not constant (i.e. total mass ρ times total volume!) 9 Vectors in cylindrical coordinates There are three unit vectors and each corresponds to a coordinate: ˆr, ˆφ, and ẑ These are defined so that ˆr ˆφ = ẑ, and so on; Note ẑ is the same as in Cartesian coordinates ˆr at point P points in the direction of increasing r, that is, along a line between the origin and the projection of point P into the xy plane; only has ˆx and ŷ components ˆφ at point P points in the direction of increasing φ; also only has ˆx and ŷ components and is perpendicular to ˆr x φ r -φ^ φ x^ φ 11 φ^ ^r y^ y Cylindrical system In cylindrical coordinates, we locate points at the intersection of a cylinder and two planes. The cylinder s axis is the z axis, one of the planes is parallel to the xy plane, and the other plane is the xz plane rotated by angle φ about the z axis Resulting coordinates are (r, φ, z), where r is the radius of the cylinder, φ is the xz plane rotation angle, and z is the distance of the plane parallel to the xy plane from the origin Note here that r and z are lengths, but φ is an angle x dz O z φ r dz r dφ dr 1 ds z = ^zr dr dφ dr r dφ ds φ = φ ^ dr dz d = r dr dφ dz ds r = r ^ r dφ dz Facts about cylindrical vectors Based on these definitions, a position vector to point P = (r, φ, z) in cylindrical coordinates (remember a position vector is a vector from the origin to point P) is always r P = rˆr + zẑ regardless of the value of φ! How can this be true? The above equation says the position vector to points at different φ s is the same! Reason: (VERY IMPORTANT) ˆr and ˆφ are not constant in space! Note they change direction depending on the point at which they are defined Thus, for example, ˆr defined at point P is not necessarily the same as ˆr defined at point Q! For this reason, if you ever see ˆr or ˆφ inside an integral, replace them with their Cartesian representations: ˆr = ˆx cos φ + ŷ sin φ, ˆφ = ˆxsin φ + ŷ cos φ 12 y
Cylindrical vectors and differentials The Cartesian representations of ˆr and ˆφ can be found by looking at the geometry in the xy plane Integrals can then be done, because ˆx and ŷ DO NOT VARY in space and can therefore be factored out of integrals Non-constant unit vectors are somewhat confusing, but in many cases they are useful for describing physical problems because the quantities we are interested in point only for example cylindrically outward (i.e. in the ˆr direction, with ˆr varying in space) To integrate over the volume of a cylinder, use dv = r dr dφ dz; to integrate over the surface of a cylinder use ds r = r dφ dz. To integrate over a circle use ds z = r dφ dr Cylindrical example Paint is distributed over the surface of a cylinder with radius 2 m and length 3 m in an unusual way, such that the mass of paint per unit area is given by cos 2 φ kg/m 2. Find the total mass of paint on the cylinder. 2 z = 3 z r = 2 d π/2 π/3 a c b n ^ = ^r y 13 x 14 Solution We want to find the total mass of paint on the surface of the cylinder, so we need to perform an integral over the surface of the cylinder. In cylindrical coordinates, a cylinder (aligned with the z axis) is normal to ˆr everywhere, so we are talking about an integral ds r = r dφ dz. We can write the total mass of paint as 3m 2π ds r ρ paint = dz dφ rρ paint = which is 6π kg! 3m 2π m m dφ (2m) cos 2 φ = 6 = 6 2π dφ 2π 1 + cos 2φ 2 dφ cos 2 φ Cylindrical coordinates will be useful for problems that involve circles or cylinders (note a line is a cylinder with radius ) IV. Spherical coordinate system In spherical coordinates, our 3 surfaces are a sphere, a cone, and a plane: the sphere is centered on the origin & has radius R The cone is aligned with the z axis, has its tip on the origin, and opens at half-angle θ The plane is the xz plane rotated about the z axis by angle φ Coordinates of a point P are (R, θ, φ). R is a length while θ z and φ are angles φ θ dr R dθ dφ R sin θ dφ d = R 2 sin θ dr dθ dφ Rdθ y 15 x 16
Vectors in spherical coordinates The three unit vectors are ˆR, ˆθ and ˆφ. Arranged so that ˆR ˆθ = ˆφ, etc ˆR at point P is a unit vector in the direction of a line from the origin outward to point P ˆθ at point P is a unit vector in the direction of increasing θ at point P ˆφ at point P is a unit vector in the direction of increasing φ at point P (note only has ˆx and ŷ components) A position vector in spherical coordinates at point P = (R, θ, φ) is always r P = R ˆR regardless of θ and φ Spherical unit vectors and differentials In spherical coordinates, all three unit vectors vary in space Thus it is wise if you see them in an integral to replace them with their Cartesian representations: ˆR = ˆxsinθ cos φ + ŷ sinθ sinφ + ẑ cos θ ˆθ = ˆxcos θ cos φ + ŷ cos θ sinφ ẑ sinθ ˆφ = ˆxsinφ + ŷ cos φ To integrate over the volume of a sphere use dv = R 2 sinθ dr dθ dφ; to integrate over the surface of a sphere use ds R = R 2 sinθ dθ dφ 17 18 Spherical coordinate example Calculate the volume of a sphere of radius R meters. Solution: Clearly this will involve a volume integral, with the total volume given by V = dv Using our spherical dv we find V = R 2 sin θ dr dθ dφ = R dr π dθ 2π ( ) R ( π dφ R 2 sin θ = 2π dr R 2 ) dθ sinθ 1. Conversion between systems 2. Vector integrals 3. Line integrals 4. Flux integrals 5. Gradient EE 311 - Lecture 18 = (2π) ( R 3 /3 ) (2) = 4πR 3 /3 as expected. Spherical coordinates will be useful in problems involving spheres (note a point is a sphere with radius zero!) 19 2
Conversion between coordinate systems Given the coordinates of a point in one system or the components of a vector, it is sometimes necessary to convert to a different coordinate system Converting vectors is more complicated than converting coordinates, but aside from the conversions of ˆR, ˆθ and ˆφ or ˆr and ˆφ to Cartesian coordinates mentioned earlier, we will rarely need to do this We will often need however to convert point coordinates, so we need to know how to do this Essentially just derive relationships using geometry Point coordinate conversion equations For Cartesian to cylindrical: r = x 2 + y 2 φ = tan 1 (y/x) z = z For cylindrical to Cartesian: x = r cos φ y = r sinφ z = z For Cartesian to spherical: R = ( ) x 2 + y 2 + z 2 θ = tan 1 x2 + y 2 z φ = tan 1 (y/x) For spherical to Cartesian: x = R sinθ cos φ y = R sinθ sin φ z = R cos θ 21 22 Point coordinate conversion example Point P is located at coordinates (R = 2, θ = 45, φ = 45 ) in a spherical coordinate system. Find the Cartesian coordinates of point P. Solution: Use the spherical to Cartesian equations: x = R sinθ cos φ = 2 sin45 cos 45 = 1 y = R sinθ sinφ = 2 sin 45 sin45 = 1 z = R cos θ = 2 cos 45 = 2 so P is (x = 1, y = 1, z = 2) in Cartesian coordinates. Vector integrals There are several types of integrals we can imagine involving vector functions, for example: [1] F dv, which adds up a vector function throughout a volume, V including directions. Result is a vector. [2] V dl, which adds up a scalar along a curve C, including C direction of curve. Result is a vector. [3] F dl, which adds up the component of a vector along the C direction of curve C. Result is a scalar. [4] A ds, which adds up the normal component of a vector over S surface S. Result is a scalar. 23 24
Line integrals Integrating a vector through a volume [1] is easy, just represent F in terms of its 3 scalar components (Cartesian vectors will work best!) and do each individually Example of [1] with F = ˆx + 2ŷ + 3xyẑ: = ˆx 1 dx 2 dy 1 dx 3 2 dz+2ŷ dy 3 1 dz (ˆx + 2ŷ + 3xy ẑ) dx 2 dy = 6ˆx + 12ŷ + 9ẑ 3 dz+3ẑ 1 dx 2 dy 3 dz xy [2] and [3] are both line integrals, and require us to specify (i.e. know the equation of) the curve C that we are integrating over Example of [2]: find V dl with V = xy over two different paths C in the xy plane between the origin and the point (x = 1, y = 1). First path: along the curve y = x 3. Second path: up y axis then over to (1,1). Solution: First note in Cartesian coordinates for a path in the xy plane, dl = ˆxdx + ŷdy 1.8.6 y.4 Path 1 y=x 3.2 Path 2 25 26.2.4.6.8 1 x Integral over path 1 We want to perform C 1 xy dl = C 1 xy (ˆxdx + ŷdy) from (,) to (1,1) on the curve C 1 : y = x 3 Note we can t just separate this into one dx and one dy because x and y are changing simultaneously as we move along C 1 The trick is to re-write this as ( ) C 1 xy dx ˆx + ŷ dy dx because we know y = x 3 on C 1, so dy = 3x 2 dx and thus dy dx = 3x2 Plugging this in we get C 1 xy(ˆx + ŷ3x 2 )dx = ˆx 1 dx xy + 3ŷ 1 dx x3 y Now use y = x 3 on C 1 to get ˆx 1 dx x4 + 3ŷ 1 = 1 5 ˆx + 3 7ŷ dx x6 Integral over path 2 Path two has two legs: on the first, x = and y varies from to 1. One the second, y = 1 and x varies from to 1 This gives C 2 xy dl = ŷ 1 dy y () + ˆx 1 dx x(1) The answer is thus 1 2 ˆx Note in this example we got two different answers for the integral depending which path we chose! This is called a path dependent integral 27 28
Example of line integral [3] Find the integral F dl, where F = xy (ˆx + ŷ) over the same two C paths as in the previous example. Again dl ( = ˆxdx + ) ŷdy, so F dl = xy (dx + dy) = xy dx 1 + dy dx On C 1, y = x 3 and dy dx = 3x2, so C 1 F dl = 1 dx (xy) ( 1 + 3x 2) = 1 dx ( x 4 + 3x 6) = 1 5 + 3 7 = 22 35 Note we obtain a scalar result in this case! On C 2, we have two legs, 1 dy () + 1 dx xy = 1 dx x = 1 2 Again this is a path dependent integral Of these two types of line integrals, we will encounter [3] much more often. We will also usually work with line integrals that are path independent, i.e. the same answer is obtained for an integral between two points no matter what path is taken Flux integrals Integral [4] is a flux integral because it adds up the amount of some vector flowing through or out of a surface The distinction between through and out of can be made because we can think of two types of surfaces: closed or open. A closed surface completely encloses some volume of space (for example a cylindrical or spherical surface) while an open surface does not (for example a plane) For closed surfaces, we take the amount of the vector flowing out of the surface, meaning we add up the outward normal component of the vector over the surface For an open surface we add up the amount flowing through by choosing either the upward or downward pointing normal to the surface, and integrating this component of the vector over the surface 29 3 Example of a flux integral A few useful normal vectors: Normal vectors An outward vector normal to a spherical surface (centered on the origin) is ˆR An outward vector normal to the body of a cylinder (aligned with the z axis) is ˆr An outward normal on the top end cap of a cylinder is ẑ An outward normal on the bottom end cap is ẑ Note the flux integral S A ds can also be written as S A ˆnds, where ds is now scalar, to emphasize we are taking the normal component of A. For closed surfaces we also sometimes write S A ds Find (ˆx xy) ds, where S is a closed cylindrical surface of radius S 3 m and length 2 m. The cylinder is aligned with the z axis, and the bottom of the cylinder is at z =. This flux integral will have three parts, since we need to do the integrals over the cylinder body, top, and bottom end caps On the top cap, ˆn = ẑ, on the bottom cap, ˆn = ẑ, and on the cylinder body ˆn = ˆr Note however that the function we are integrating here has no ẑ component, thus (ˆx xy) ds is zero on the top and bottom end caps The integral over the body can then be written as 2 dz 2π dφ (3) (xy ˆx ˆr). Note that we are using ds r = r dφ dz with r = 3 here Now get ˆr out of the integral! Change ˆr = ˆxcos φ + ŷ sinφ to find ˆx ˆr = cos φ 31 32
Also use x = r cos φ, y = r sinφ and r = 3 for our cylinder to get 2 dz 2π dφ (3 cos φ)(3 sinφ)(3) cos φ This is 27 2 dz 2π dφ cos 2 φ sinφ = 54 3 cos3 φ 2π =! A note on symmetry (IMPORTANT): Notice that we could have realized that we should get for the previous integral 2π cos 2 φ sinφ just by thinking about symmetry properties of the integrand Since cos 2 φ between π and 2π is identical to itself from to π, but sinφ becomes the negative of itself over this range, the integration from to π exactly cancels that from π to 2π Thus we could get as an answer without doing any integration at all! Thinking about the symmetry of an integral before trying to do it can simplify things immeasurably Gradient Now we move to talking about derivatives of scalar and vector functions in 3d space First let s consider the derivative of a scalar function V (x, y, z) of 3d space. How can we do this? Start by thinking about a surface (called surface 1) where V (x, y, z) has a constant value, say V. If V (x, y, z) is continuous this should always be construct-able Now think about a nearby surface (called surface 2) where V (x, y, z) = V + V, a slightly different value Pick a point P 1 on surface 1 and follow the normal to surface 1 at this point (call it dn) until surface 2 is intersected. Call the intersection point P 2 We an also consider another point P 3 on surface 2, obtained by starting at P 1 and following an arbitrary vector dl until surface 2 is intersected 33 Figure for Gradient Surface where V(x,y,z)=V + Vector dl Surface where V(x,y,z)=V P 3 P 2 Normal at point P 1 34 Definition of gradient Now consider the rate of change of V with distance. We can choose V or V V. It turns out that is always <= to V dl dn dl dn as V becomes small This means the shortest distance between surfaces 1 and 2 is along the normals to surface 1. This makes sense because moving from surface 1 in a direction that is tangential to surface 1 does not change V Due to this unique nature of the normal direction, we can define the gradient of a scalar function V (x, y, z) as grad V = ˆn dv dn where dn has been replaced by dn. The gradient thus represents the maximum rate of change of V dv (i.e. dn ) times a unit vector in a direction normal to the surfaces of constant V (1) 35 36
Example of gradient Properties of gradient The gradient operates on a scalar function and produces a vector rate of change grad V is sometimes also written as V The gradient points in the direction of the maximum rate of increase of V We can use the gradient to find the change in V along any other direction dl as well, by V = V dl The gradient in our three coordinate systems is Cartesian: V = ˆx V x + ŷ V y + ẑ V z Cylindrical: V = ˆr V r + ˆφ 1 V r φ + ẑ V z Spherical: V = V ˆR R + ˆθ 1 V R θ + ˆφ 1 V R sin θ φ Example: Find (x 2 + y 2 ). Note we take gradient of a scalar! (x 2 + y 2 ) = ˆx (x2 + y 2 ) x + ŷ (x2 + y 2 ) y = ˆx2x + ŷ2y + ẑ (x2 + y 2 ) z Note the answer is a vector! Note also that 2 (ˆxx + ŷy) = 2r (ˆx cos φ + ŷ sin φ) = 2rˆr. This makes sense because surfaces of constant x 2 + y 2 are cylinders! 37 38 Fundamentials of electrostatics Electrostatics is the study of electric forces between charges at rest; electric forces are produced by charges EE 311 - Lecture 19 Charge is measured in Coulombs (C) in the MKS system, and occurs in discrete multiples of the charge on an electron 1.6 1 19 C Charge can be neither created or destroyed, so the principle of conservation of electric charge always applies 1. Fundamentals of electrostatics 2. Coulomb s Law 3. Electric Fields We can define a volume charge density as q ρ V = lim v v in C/m 3, where q is the amount of charge contained in volume v (2) Since the charge on an electron is very small, we usually regard ρ V as a continuous point function of space; can be positive or negative! 39 4
Surface and line charges We can also spread charges out over surfaces or lines A surface charge density has units C/m 2 and is defined as q ρ S = lim s s where s is a small piece of surface area A line charge density has units C/m and is defined as q ρ L = lim l l where l is a small piece of length If we want to find the total charge, Q tot, in a volume containing a volume charge density, we just integrate over the volume: Q tot = dv ρ V (5) Similarly to get the total charge on a surface, integrate ρ S over the surface area, or the total charge on a line is obtained by integrating ρ L over length V (3) (4) Coulomb s law Coulomb s law describes the force the occurs between two point charges By point charges we mean that the objects carrying the charge are very small compared to the distance between the charges If we call the two charges q 1 and q 2 at points P 1 and P 2, the (vector) force exerted by q 1 on q 2 is F e21 = ˆR 12 k q 1q 2 R 2 12 In this equation, ˆR 12 is a unit vector from q 1 to q 2, which is a unit vector in direction r P2 r P1 R 2 12 is the distance between q 1 and q 2 squared Note the force is repulsive if q 1 and q 2 have the same sign, while it is attractive if q 1 and q 2 have opposite signs (6) 41 Coulomb s law and electric fields Finally in Coulomb s law, the constant k is given by 1 4πǫ 9 1 9 m/f, where ǫ = 8.854 1 12 F/m is known as the permittivity of free space We could work out the units of k also by looking at units on both sides of the equation: N = C 2 /m 2 [k], so k must have units Nm 2 /C 2, same as m/f Coulomb s law tells us about forces between charges if we know their quantities and locations The concept of an electric field, E, allows us to talk about electric effects by knowing only about one of the charges! An electric field is defined as: E = Note the units of E are N/C or Volts/m F 2,test lim (7) q test + q test 42 Electric fields E is thus the force per unit charge experienced by a small positive test charge q test when placed in E E is a vector function of 3d space Given the definition of E, the force on a stationary charge q in an electric field is given by F = qe Using Coulomb s law, we can find the electric field at point P 2 produced by a point charge q 1 at point P 1 : E(P 2 ) = F e1,test q test = ˆR 12 k q 1 R 2 12 A new way of writing this: find field at a point whose position vector is R generated by a point charge q at position vector R : (8) E(R) = q ( R R ) 4πǫ R R 3 (9) The field points radially outward from a positive charge; radially inward toward a negative charge 43 44
Example electric field calculation A 2 nc point charge is located at (x = 1 m, y = 1 m, z = 1 m) in a Cartesian coordinate system. Find the electric field at the origin produced by this point charge, and the force on a 1 nc point charge placed at the origin. Solution: Use expression for point charge field. Observation point is the origin, so R =. The point charge is located at (1,1,1), so R = ˆx + ŷ + ẑ. Thus R R = ˆx ŷ ẑ, with magnitude 3. Thus E(R = ) = 2 1 9 ( ˆx ŷ ẑ) 4πǫ ( 3 ) 3 (1) = ( 3.46) (ˆx + ŷ + ẑ) (11) N/C. Note directed away from the positive charge! Force on the 1 nc point charge at the origin is qe = 1 9 ( 3.46) (ˆx + ŷ + ẑ). Note attractive! Principle of Superposition The equations of electrostatics are linear, which means that they satisfy the principle of superposition This means that the solution for multiple sources is simply the solution for each individual source added together For example, the electric field produced by multiple point charges can be found by adding the fields produced by each individual point charge: E tot = 1 4πǫ N i=1 q i ( R Ri ) R R i 3 (12) for point charges q i at locations R i with i = 1 to N If we continue this process for charge distributions rather than a set of point charges, we can arrive at integral expressions for the total field. We are not convering these computations here 45 46 Basic Laws of Electrostatics Our study of electrostatics will proceed in terms of electric fields only. Fields are useful because only sources, not receivers, are needed The two basic laws (or fundamental postulates ) of electrostatics in free space can be expressed in terms of integrals of E: S E ds = C V dv ρ V ǫ = Q tot ǫ (13) E dl = (14) The first of these is known as Gauss Law, while the second states that the line integral of E around a closed path yields zero. Both of these can be derived starting just from our Coulomb s law definition of the field of a single charge. 47