{'fraction_non_alphanumeric': 0.03157506757310181, 'fraction_numerical': 0.004791547219264477, 'mean_word_length': 4.216620380260628, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Introduction to Electromagnetism

The purpose of this course is to provide an introduction to Electromagnetic Theory. The foundations of electrodynamics starting from the nature of electrical force up to the level of Maxwell equations solutions are presented. It starts with the introduction of the concept of a field, which plays a very important role in the understanding of electricity and magnetism. In addition, moving electric charge is discussed as a topic of special importance in accelerator physics.


Introduction to fields
We start by looking at the gravitational force exerted by the earth on a particle, which allows to introduce the concept of a field. From Newton it is known that if a force F (here and later the bold notation for vectors is used) acts on a particle of mass m, then the particle will experience an acceleration g: By measuring the forces acting on the particle, we discover that at each different position in space the acceleration is different. This implies that the magnitude of the force changes at each different position in space at a different time.
In physics, a field is a dynamical quantity that has a value at each location in space and at each instant in time. This means that instead of saying that the earth exerts a force on a falling object, it is more useful to say that the earth sets up a gravitational force field. A force in modern physics, means an intricate interplay between particles and fields.
To describe the force between charged particles an electric field is introduce by copying the description of the gravitational force field. As charged particles exert forces on each other, we write the same as for the gravitational field: The charge q replaces the mass m. q is a single number associated with the object that experiences the field. The electric field E is what replaces the gravitational field g. So we have replaced a number with a number m → q and a field with a field (g → E). We are splitting things up into a source that produces a field and an object that experiences the field.
To describe the force of electromagnetism, we need to introduce two fields, each of which is a three-dimensional vector. They are called the electric field E, which is described above, and the magnetic field B.
E(x, t); B(x, t) The charged particles create both electric and magnetic fields. The electric and magnetic fields guide the charged particles. This motion, in turn, changes the fields that the particles create. Roughly speaking, an electric field accelerates a particle in the direction E, while a magnetic field causes a particle to move in circles in the plane perpendicular to B.

Charge and Current
We measure the charge q in Coulomb, and charge can be positive or negative. In SI units the charge of a single proton is about 1.6 × 10 −19 C.
Often in particle physics we simply count charge as q = ne with n ∈ Z. Then electrons have charge −1, while protons have charge +1 and neutrons have charge 0.
To move from the dynamics of point particles onto the dynamics of continuous objects known as fields, the charge density is introduced, ρ(x, t) defined as charge per unit volume. The total charge Q in a given region V is then simply In most situations, smooth charge densities are considered, which can be thought of as arising from averaging over many point-like particles.
Electric fields are produced by the static charges, magnetic fields is set up by currents, i.e. moving charges. To describe the movement of charge from one place to another a quantity known as the current density is used J (x, t). It is defined as follows: for every surface S, the integral counts the charge per unit time passing through surface S, (dS is the unit normal to S). The quantity I is called the current. In this sense, the current density is the current-per-unit-area.

Conservation Law
The most important property of electric charge is that it is conserved, i.e. the total charge in a system cannot change.
The property of local conservation means that ρ can change in time only if there is a compensating current flowing into or out of that region. This is expressed in the continuity equation To see why the continuity equation captures the right physics, it is best to consider the change in the total charge Q contained in some region V The minus sign is there to ensure that if the net flow of current is outwards, then the total charge decreases.
If there is no current flowing out of the region, then dQ dt = 0. This is the statement of (global) conservation of charge. In many applications V is taken to be all of space with both charges and currents localised in some compact region. This ensures that the total charge remains constant.

Lorentz Force
The position r(t) of a particle of charge q is dictated by the electric and magnetic fields through the Lorentz force law. The force acting on a charge q, which is at rest within an electric field, is Also the force acting on a small wire element dl, carrying electric current I, which is placed in a magnetic field, is F = IdlB.
These two suggest that for a charge q moving with velocityṙ, the total force acting (Lorentz force) on it: The Lorentz force law can be also written in terms of the charge distribution ρ(x, t) and the current density J (x, t). In terms of the force density f (x, t), which is the force acting on a small volume at point x, the Lorentz force law reads: f = ρE + J × B.

Maxwell's Equations
Maxwell's equations are the basis for understanding of all electromagnetic phenomena. They describe space-and time-dependent electric and magnetic fields, and how they are generated by charges and currents. Maxwell's equations also describe light and other forms of electromagnetic radiation. They are commonly expressed in a differential form or in an integral form.

Differential form
Electric charges whose density is ρ are the sources of the electric field E. This is expressed by the Gauss law: Field lines of B are closed, so the net magnetic charge inside a closed surface S is always zero. This is equivalent to the statement that there are no magnetic monopoles. Instead, there are only magnetic dipoles, made of a positive magnetic charge and a negative magnetic charge tied together so they can never be separated. Mathematically this is expressed by the equation:
The electromotive force around a closed circuit is proportional to the rate of change of flux of the field B through the circuit (Faraday's law). Faraday's law describes time-varying magnetic fields, and how they produce electric fields. In differential form this law is expressed by the following formula:
Electric currents with density J are the sources of the magnetic induction field B. This is expressed by the Ampère's law, which describes how time-varying electric fields produce magnetic fields: These equations involve two constants 0 and µ 0 that are not themselves of much physical significance, their values appropriate to SI units are fixed by experiment.
The first is the electric constant: It can be thought of as characterising the strength of the electric interactions. The other is the magnetic constant:

Integral form
For better understanding of Maxwell equations, we rewrite them in integral form by using Stokes' theorem: If we rewrite the first Maxwell equation, the Gauss law, in integral form by integrating over fixed volumes using the divergence theorem or fixed surfaces using Stokes' theorem we get: The integral of the charge density over V is simply the total charge Q = V d 3 xρ contained in the region. The integral of the electric field over S is called the flux through S.

1)
The left-hand side is the flux of E out of volume V . It does not matter what shape the surface S takes. As long as it surrounds a total charge Q, the flux through the surface will always be Q 0 .
for any closed surface S = ∂V . This can be interpreted as the statement that there are no magnetic 'charges' or magnetic monopoles.
The electromotive force is the tangential component of the force per unit charge, integrated along the wire. Another way to think about it is as the work done on a unit charge moving around the curve C. If there is a non-zero emf present then the charges will be accelerated around the wire, giving rise to a current.
Finally, the same is repeated for the Ampère's law: Hence, in the case of steady current (no time dependence), Stokes' theorem implies where I = S J · dS is the flux of J through an open surface S bounded by C or the total current through S (or C) (see Fig. 1).

Discontinuity formulas
With the help of Maxwell's equations, boundary conditions of electromagnetic fields at the interface between different materials can be derived. For a surface S with unit normal n which separates regions V ± of space, with n pointing from S into V + -if it carries the charge density σ per unit area, then − is the difference of the electric fields on both sides of S. n·v and n∧v give the normal and tangential components of any vector v, and the tangential component satisfies n · n ∧ v = 0.
-if it carries the current density s per unit length (charge crossing unit length in S in unit time).
If we replace ∇ by n| + − in Maxwell's equations, then we expect that n · J | + − = 0 at a surface of discontinuity, one that may carry surface density of charge.
These formulas can be applied to deriving

Electrostatics
Now we look at the condition where there are no currents (electrostatics). We assume that the charges are pinned in place and there are forces between charges.
Since nothing moves, we are looking for time independent solutions to Maxwell's equations with J = 0. This means that we can consistently set B = 0 and we are left with two of Maxwell's equations:

Coulomb Force
It can be shown that Gauss law reproduces the more familiar the Coulomb force law. For a particle of some radius R with a spherically symmetric charge distribution centered at the origin (see Fig. 2), the electric field E(x) = E(r)r (r -radial unit vector) at some radius r > R will be calculated the following way: where the factor of 4πr 2 has arisen simply because it is the area of the Gaussian sphere. So the electric field outside a spherically symmetric distribution of charge Q is From the Lorentz force law we know that a test charge q moving in the region r > R experiences a force This is, as it is well known, the Coulomb force between two static charged particles. Notice that 1/ 0 characterises the strength of the force. If the two charges have the same sign, so that Qq > 0, the force is repulsive, pushing the test charge away from the origin. If the charges have opposite signs, Qq < 0, the force is attractive, pointing towards the origin. We see that Gauss law reproduces the Coulomb force.

Electrostatic Potential
From the equation ∇ × E = 0 we can see that the electric field can be written as the gradient of some function: The scalar φ is called the electrostatic potential or scalar potential. If we revert to the original differential form of Gauss law, this takes the form of the Poisson equation: In regions of space, where the charge density vanishes, we are left solving the Laplace equation: where the operator ∇ 2 is called Laplacian: Solutions to the Laplace equation are said to be harmonic functions.

Principle of superposition
The Poisson equation is linear in both φ and ρ. This means that if we know the potential φ 1 for some charge distribution ρ 1 and the potential φ 2 for another charge distribution ρ 2 , then the potential for ρ 1 + ρ 2 is simply φ 1 + φ 2 . It means that the electric field for a bunch of charges is just the sum of the fields generated by each charge. This is called the principle of superposition for charges.
Similarly, the electric field is just the sum of the electric fields made by the two point charges. This follows from the linearity of the equations and is a simple application of the principle of superposition.

Continuous distribution of charges
Derivation of the potential due to a point charge together with the principle of superposition, is actually enough to solve the potential due to any charge distribution. This is because the solution for a point charge is nothing other than the Green's function for the Laplacian. The Green's function is defined to be the solution to the equation We can apply the usual Green's function methods to the general Poisson equation, ∇ 2 φ = − 1 0 ρ e . In what follows, well take φ(r) = 0 only in some compact region, V , of space.

The solution to the Poisson equation is given by
Similarly, the electric field arising from a general charge distribution is

Magnetostatics
Charges give rise to electric fields. Current give rise to magnetic fields. The magnetic fields is induced by steady currents. In this case the charge density ρ = 0, so E = 0. The time independent solutions to the Maxwell equations in case of magnetic fields will be: If the current density J is fixed, these equations have a unique solution.

Steady Currents
Because ρ = 0, there cannot be any net charge, but we need moving charge for magnetic fields. This means that we necessarily have both positive and negative charges which balance out at all points in space. Nonetheless, these charges can move so there is a current even though there is no net charge transport.
It is exactly what happens in a typical wire. In that case, there is background of positive charge due to the lattice of ions in the metal. Meanwhile, the electrons are free to move, but they all move together, so that at each point we still have ρ = 0. The continuity equation, which captures the conservation of electric charge, is ∂ρ ∂t + ∇ · J = 0.
Since the charge density is unchanging (and indeed, vanishing), we have ∇ · J = 0.
Mathematically, this is just saying that if a current flows into some region of space, an equal current must flow out to avoid the build up of charge. This is consistent with ∇ × B = µ 0 J since, for any vector field, ∇ · (∇ × B) = 0.

Ampère's Law
The first equation of magnetostatics, ∇ × B = µ 0 J is known as Ampère's law. An equivalent integral form over some open surface S with boundary C = ∂S (see Fig. 1). By using Stokes' theorem: The surface S comes with a normal vectorn which points away from S in one direction. The line integral around the boundary is done in the right-handed sense, meaning that if you stick the thumb of your right hand in the directionn then your fingers curl in the direction of the line integral.
The integral of the current density over the surface S is the same thing as the total current I that passes through S. Ampère's law in integral form then reads:

Vector Potential
We are guaranteed a solution to ∇ · B = 0 if we write the magnetic field as the curl of some vector field: where A is called the vector potential.
Then Ampère's law becomes: The choice of A above is not unique as there are lots of different vector potentials and they give rise to the same magnetic field B. This is because the curl of a gradient is automatically zero. This means that we can always add any vector potential of the form ∇χ for some function χ and the magnetic field remains the same: We can always find a gauge transformation χ such that A satisfies ∇ · A = 0. This choice is usually referred to as Coulomb gauge.
From now, we will always assume that we are working in Coulomb gauge and our vector potential obeys ∇ · A = 0.

Biot-Savart law
From the Ampère law by using the vector potential and Coulomb gauge we solve the equation for the magnetic field B in the presence of a general current distribution: The most general solution using Green's functions: This gives a practical solution for the magnetic field B = ∇ × A. We need to remember that the ∇ acts on the x rather than the x . We find: This is known as the Biot-Savart law. It describes the magnetic field due to a general current density.

Motion of a charged particle
As known, the position r(t) of a particle of charge q is dictated by the electric and magnetic fields through the Lorentz force law In case of absence of the magnetic fields the second termṙ × B vanishes, F = q(E +ṙ × Z Z B), i.e. only electric fields are taken into account, and we have The force is acting always in the direction of the electric field, E, also for particles at rest.
The second case, absence of the electric field, only magnetic field is acting, In this case the force is perpendicular to both v and B (see Fig. 3).

Electromagnetism
For static situations, Maxwell's equations split into the equations of electrostatics and and the equations of magnetostatics. The only hint that there is a relationship between electric and magnetic fields comes from the fact that they are both sourced by charge: electric fields by stationary charge; magnetic fields by moving charge. However, the connection becomes more direct when things change with time. Fig. 3: Motion of a charged particle in electric (above) and magnetic (below) fields. In case of an electric field, the force is always in the direction of the field, also for particles in rest. For a magnetic field, the force is perpendicular to both v and B.

Faraday's Law of Induction
One of the Maxwell equations relates time varying magnetic fields to electric fields: If we change a magnetic field, we will create an electric field. In turn, this electric field can be used to accelerate charges which create a current. The process of creating a current through changing magnetic fields is called induction.
Faraday's law describes time-varying magnetic fields, and how they produce electric fields. In integral form this law is expressed by the following formula Faraday's law of induction can be expressed through the electromotive force, ε = C E · dr and flux of B through (the open surface) S, Φ = S B · dS: ε = − dΦ dt .

Wave Equation
Maxwell's equations have wave-like solutions for the electric and magnetic fields in free space. The electric field must solve the wave equation For the vacuum or free-space, i.e. ρ = 0, J = 0, the solution of wave equations can be written in the form: where k is the wave vector with |k| = k, which gives the direction of propagation of the wave.
-The quantity ω is called the angular frequency and is taken to be positive. The actual frequency f = ω 2π measures how often a wave peak passes by. ω relates to k by ω 2 = c 2 k 2 . -The period of oscillation is T = 2π ω . -The wavelength of the wave is λ = 2π k . The wavelength of visible light is between λ ≈ 3.9 × 10 −7 m and 7 × 10 −7 m . At one end of the spectrum, gamma rays have wavelength λ ≈ 10 −12 m and X-rays around λ ≈ 10 −10 to 10 −8 m. At the other end, radio waves have λ ≈ 1 cm to 10 km. Of course, the electromagnetic spectrum does not stop at these two ends. Solutions exist for all λ.
-E 0 is the amplitude of the wave.
-The phase velocity c of the wave is given by the dispersion relation: The linearity of the Maxwell equations allows to write the solutions in complex notation: where E 0 , B 0 are the amplitudes of the electric and magnetic fields, respectively, k their wave vector and ω its angular frequency.

Propagation of electromagnetic waves in a conductor
In a conducting medium of conductivity σ we have The ratio τ = 0 σ is called the relaxation time of the conducting medium. For perfect conductors, σ = ∞, so that the relaxation time is vanishing.
For good, but not perfect, conductors σ ≈ 10 14 sec −1 , so and charges move almost instantly to the surface of the conductor. In this case τ is small of the order of 10 −14 sec. For times much larger than the relaxation time there are practically no charges inside the conductor. All of them have moved to its surface where they form a charge density.
For the case of an isolator σ = 0. In this case the solution of the wave equation is reduces to an ordinary plane wave which is propagating with wave vector k.
For a very good conductor, which includes the case of a perfect conductor, the conductivity is large, so that the relaxation time is vanishing.
Therefore inside a good conductor the field is attenuated in the direction of the propagation and its magnitude decreases exponentially as it penetrates into the conductor. δ is a constant called the skin depth, given by the following expression: The depth of the penetration is set by δ and is smaller the higher the conductivity, the higher the permeability and the frequency. Skin depths for a good conductor (metal) is δ ≈ 10 µm at ω = 50 MHz.

Propagation of electromagnetic waves in a highly conductive materials
It's very important to understand electromagnetic waves in a highly conductive material (see Fig. 5) to be able to design RF cavities and wave-guides for charged-particle accelerators.
The fields E and B are zero inside perfectly conducting media, it therefore follows the boundary conditions at z = 0 are: E || = 0, B ⊥ = 0. This implies that -all energy of an electromagnetic wave is reflected from the surface of an ideal conductor; -fields at any point in the ideal conductor are zero; -only some field patterns are allowed in wave guides and RF cavities (examples of highly superconductive material in accelerator physics).

RF Cavities
The word 'cavity' is derived from the Latin cavus (hollow) -a void or empty space within a solid body. The purpose of an RF cavity is to interact with charged particle beams in an accelerator. For the particles to gain energy, this interaction is the acceleration in the direction of particle motion, but special cavities exist to bunch, or de-bunch the beam, others to decelerate particles or to kick them sideways. For all these different applications, optimization of the cavity for the given application has to be done.
Maxwell's equations, along with the boundary conditions of an empty cavity, have solutions with non-vanishing fields even if no sources are present: Notice, that there is the cosine dependence on the coordinate corresponding to the component of the field and the sine dependence on the other coordinates in the electric field.
To satisfy the wave equations the wave vector and frequency must be related:

Wave Guides
A wave guide is a metallic open ended tube of arbitrary cross sectional shape. Under certain conditions electromagnetic waves can propagate along its axis. It's a perfectly conducting tube with rectangular cross-section of height and width a and b. This is essentially a cavity resonator with length c → ∞. The tube can be filled with a nondissipative medium characterized by dielectric constant and magnetic permeability µ.
Together with Maxwell's equations the electric field must solve the wave equation The solution will be in a form: E x = E x0 · cos(k x x) · sin(k y y) · e i(ωt−kzz) E y = E y0 · sin(k x x) · cos(k y y) · e i(ωt−kzz) E z = −iE z0 · sin(k x x) · sin(k y y) · e i(ωt−kzz) .
By applying the boundary condition (vanishing components E x , E y , where they are tangential to the wall) we find that k x and k y for any integer mode number m must be: The longitudinal component, E z , always vanishes on the walls, so there is no constraint on k z .
Again, we have to satisfy Maxwell's equation ∇ · E = 0. This leads to a relation between the amplitudes and the components of the wave vector: Together with the wave equation it leads to the dispersion relation: where c = 1 √ µ .
As there is no constraint on k z in a waveguide, there is a continuous range of frequencies allowed in a waveguide. However, there is still a minimum frequency allowed in a given mode. k z must be real for a travelling wave, i.e. k 2 z ≥ 0. The minimum frequency for a propagation wave is called the cut-off frequency, ω CO : It is possible for fields to oscillate in a waveguide at a frequency below cut-off frequency. However, such field does not constitute travelling waves.
Usually waveguides are used so either the electric or magnetic field has no longitudinal component. We shall distinguish the following special modes of propagation: -Transverse Electric (TE), in which there is no longitudinal component, E z , of the electric field.
Besides having E z = 0 , the appropriate boundary conditions on the walls of the guide dictate that the directional derivative of the z-components of the magnetic field on the conducting wall vanishes. Thus for the TE modes we have: It can be proven that a hollow wave guide, whose walls are perfect conductors, can not support propagation of TEM waves.