 Now, let us try to analyze the behavior by solving the equation of motion for the charge particle in a quadrupole field in the x direction and then we will try to calculate the transfer matrix for a quadrupole. So, the force on a charge particle is given by Q e plus v cross v in the x motion. Now, for this quadrupole the it is focusing it is a focusing quadrupole in the x direction. So, in the x plane the equation of motion is f x is equal to m d 2 x by d t square is equal to Q e x. So, we are writing just the x component plus Q v y v z minus v z v y ok. Now, in a quadrupole there is no electric field. So, there is only magnetic field here there is no electric field and the magnetic field is also only transverse there is no magnetic field in the z direction we have only b x and b y. So, we can write e x is equal to 0 and b z is equal to 0. So, we put e x is equal to 0 and also b z is equal to 0. So, we get this equation of motion we get f x is equal to minus Q v z b y and b y is got g into x where g is the magnetic field gradient. Now, let us change the coordinates from z to t we know that z is equal to v z into t. So, d z is equal to v z into d t. Again taking the second derivative. So, we will get d 2 x and simplifying we will get d 2 x by d t square is equal to v z square d 2 x by d z square. This we can substitute in this equation here and we will get the differential equation now in terms of z instead of t. So, this is the equation that we get now we can put Q g by m v z is equal to k x some constant k x because for a given beam and for a given charge particle and for a given quadrupole these are all constants the Q is the charge which is constant m is the mass v z is the velocity. So, it is moving with a constant velocity there is no acceleration in the quadrupole g is the gradient of the quadrupole. So, we get d 2 x by d z square plus k x into x is equal to 0. This is the equation of a simple harmonic oscillator and the solution of this equation is x is equal to a cos under root k x z plus d sin under root k x z. We can differentiate this with respect to z and we get this. So, now, if you see the solution of the equation of motion is sinusoidal. So, that we get that if the charge particle is entering inside a quadrupole the motion inside is sinusoidal. Now, if we terminate the quadrupole at a very small distance or in other words the length of the quadrupole is very small then we can determine the values of. So, it will it need not be fully oscillatory you can terminate it here you can have a short quadrupole and then you can determine the values of the constants a and b from here. So, let us see how it can be done. So, let us say now this is the quadrupole and the coordinates of the particle at the entrance of the quadrupole is x 1 x 1 prime and as it exits the quadrupole it is x 2 x 2 prime. So, we consider a quadrupole of length L the charge particle enters the quadrupole at z is equal to 0 with initial coordinates x 1 and x 1 prime at the exit of the quadrupole the coordinates are x 2 and x 2 prime x is the position coordinate and x prime is the derivative with respect to z which is also called the divergence of the particle with respect to the z axis. So, the boundary conditions at the entry and exit are at z is equal to 0 x is equal to x 1 and x prime is equal to x 1 prime similarly at z is equal to L x is equal to x 2 and x prime is equal to x 2 prime. So, we can substitute this in the solution. So, the solution of the equation was in terms of x and x prime. So, applying the first boundary condition at z is equal to 0 x is equal to x 1 and x prime is equal to x 1 prime. So, we put this equal to 0. So, this will go to 0 here and we will get x 1. So, this is equal to 1. So, we get x 1 is equal to a and putting in this equation this will go to 0. We will get x 1 prime is equal to b under root k x. From here we can find out the values of a and b, a is equal to x 1 and b is equal to x 1 prime by under root k x. So, then we can substitute the values of a and b in these equations and this is what we get. We get these two equations like this. Now, let us apply the second boundary condition. So, at z is equal to L, x is equal to x 2 and x prime is equal to x 2 prime. So, let us put this. So, at z is equal to L, x is equal to x 2 and x prime is equal to x 2 prime. So, this is the equation that we get. Now, this equation can be written in matrix form again. These two equations can be written like this. So, we have x 2, x 2 prime in terms of x 1 and x 1 prime. So, we get a matrix like this. So, these are the initial coordinates, the coordinates at the beginning of the quadrupole and this is the final coordinates that is the coordinates at the end of the quadrupole and this is now the transfer matrix of the quadrupole. So, we can write this as x 2 is equal to m q x. Now, m q x is the transfer matrix of the focusing quadrupole times x 1. So, x 1 is x 1, x 1 prime and x 2 is x 2, x 2 prime and this is the transfer matrix of the focusing quadrupole. Now, notice here this depends only on the parameters k x and L and k x depends upon what? It depends only upon the beam parameters and the quadrupole parameters. So, k x if you remember is q g by m v z. So, q is the charge of the charge of the charge particle, n is the mass, this is the velocity and g is the gradient of the quadrupole. So, this depends upon only k x and L which is again the length of the quadrupole. So, if you know about the parameters of the beam and the quadrupole and you know the initial coordinates. So, you can find out the final coordinates of that charge particle at the end of the quadrupole. Now, similarly you can find out the motion of the single particle in the quadrupole field in the y direction. So, that same quadrupole in the y direction it is a defocusing quadrupole. So, here is the charge particle it is coming here it gets defocused and then it moves out. So, here we see that the initial coordinates are y 1, y 1 prime and the final coordinates are y 2, y 2 prime. So, we can write the equation of motion in y. So, you get an equation like this again substituting q g by m v z is equal to k y in this equation. So, this equation will have solutions in the form of sin hyperbolic and cos hyperbolic terms and then we can apply the boundary conditions at z is equal to 0, y is equal to y 1 and y prime is equal to y 1 prime, z is equal to l, y is equal to y 2 and y prime is equal to y 2 prime. So, substituting these we can find out the transfer matrix of the defocusing quadrupole. So, here transfer matrix has terms in the form of cos hyperbolic functions and again it depends upon k y and l. So, just the parameters of the beam and the parameters of the quadrupole. And so, again if you know the initial coordinates you know the about the beam and the quadrupole you can find out the final coordinates. So, this transfer matrix method is very useful in finding out the final coordinates of a particle if you know the initial coordinates. Similarly, just like a magnetic quadrupole we can also have an electric quadrupole. So, since it is an electric quadrupole there will be electric field. So, we will have potential instead of a magnet we will have now potential supply. So, this is these opposite poles are at positive potential and these opposite poles are at negative potential. So, you can draw the electric field lines and again you can resolve them in all the four quadrants. So, you see that for the electric field the force is in the same direction as the applied electric field. So, this type of electric quadrupole will focus in the y direction and defocus in the x direction. If you reverse the polarities that means you make this and this as positive and you make this and this as negative then it will become reverse. Okay and again you can use a combination of two electric quadruples and focus in four directions. So, an electric quadrupole has four poles arranged symmetrically in the x y plane. So, this is x and this is y. The beam is moving in the z direction with velocity v z. So, as before you have the beam here moving in the z direction out of your screens. So, here direction of the force is same as the direction of the electric field. This quadrupole will focus in y direction and defocus in x direction and here now notice that the force due to the electric field is independent of the velocity. It does not depend upon the velocity unlike the force due to the magnetic field. So, thus we have calculated the transfer matrix for a focusing quadrupole for a defocusing quadrupole and for a drift space. In this way we can calculate the transfer matrix of any element in a beam line or even in an accelerator. So, every component let us say we have a bending magnet or let us say even an accelerating gap all these components will have a transfer matrix. So, we have calculated the transfer matrix of some simple elements. So, others will also have a transfer matrix and by using if you know the transfer matrix and the initial coordinates of the charge particle at the beginning of that element you can find out the final coordinates at the end of that element. Now, let us calculate the focal length of the quadrupole in x. So, since it is a focusing quadrupole. So, it acts like a lens. So, it will have a certain focal length. Now, in the x direction the quadrupole focuses. So, the charge particle enters the quadrupole. This charge particle is entering the quadrupole of length l at a point a. So, it is entering here at a point a which is and it is parallel to the z axis. So, this is the z axis it is parallel to the z axis. Then it gets focused in the quadrupole. So, it gets focused because it is a focusing quadrupole and exits the quadrupole at point p. Then there is a drift space of length l after the quadrupole. So, in this drift space after the quadrupole the beam gets focused at a point s at a point c which is at a distance s from the quadrupole. So, even in a way of light if you see you have a you have a converging lens in order to calculate the focal length you bring the ray of light parallel to it and then you calculate after what distance from the quadrupole it gets focused. So, similarly we have the charge particle coming parallel to the z axis it is getting focused in the quadrupole and finally at a distance s after the quadrupole it gets focused or in other words it comes to the axis. And we want to calculate what is this distance s. So, magnetic quadrupole behaves like a convex lens in the x direction. Okay now you can calculate the coordinates x3 x3 prime in terms of x2 and x2 prime. So, if you know the length of the drift space. So, x3 x3 prime is simply the transfer matrix of the drift into x2 x2 prime and x2 x2 prime is simply mqx that means the transfer matrix of the focusing quadrupole into x1 x1 prime. So, instead of x2 x2 prime this is equal to this I have just equated this here okay. So, now writing you know the transfer matrix for the drift space of length s and you know the transfer matrix for a focusing quadrupole. So, you can simply write this like this and now you can do the matrix multiplication and this is the resultant matrix here. So, now by definition of focal length a parallel beam comes to focus at the focal point at the point c here okay this distance is f. So, for a parallel beam now this initial beam is parallel. So, that means the angle that it is making with the z-axis should be 0 or in other words x1 prime should be equal to 0 okay. Also since this beam is getting or this charge particle is getting focused at points c here the displacement of this point from the axis should be 0 in other words x3 is equal to 0. So, now you can apply these two conditions here you can put in x1 prime equal to 0 and x3 is equal to 0. So, you have this x3 is equal to this. So, it is in terms of x1 and x1 prime and x3 prime is again in terms of x1 and x1 prime. So, you can write these equations from the matrix equation for a parallel beam x1 prime is equal to 0 and at the focus x3 is equal to 0. So, you put x3 is equal to 0 here and x1 prime is equal to 0 here. So, you get this expression. So, this is equal to 0 and from here you can calculate the value of s and it comes out to be cos under root kxl divided by under root kx sin under root kx into l or in other words it is cot of under root kxl divided by under root kx. So, this is the focal length of a focusing quadrupole. So, again it is in terms of the it depends upon the beam velocity the beam mass and depends upon the parameters of the quadrupole. We can also calculate the focal length of the quadrupole in y this quadrupole is the focusing in y. So, in the y direction the quadrupole de-focuses the charge particle enters the quadrupole of length l at point A parallel to the z-axis. So, again you have to take a parallel beam. So, it enters here parallel to the z-axis it gets de-focused inside the quadrupole and exits at point B. The focal length is the virtual distance s behind the quadrupole where the particle appears to get focus. So, this is the distance s behind the quadrupole where it appears to be focus. Again this is analogous to ray optics for a de-focusing lens. So, magnetic quadrupole behaves like a concave lens in the y direction. So, you can calculate the focal length here s comes out to be minus cot hyperbolic under root k yl by under root k y. So, you can in this way you can find out the focal length of a given quadrupole in the x and y direction. Now, let us see the thin lens approximation for the quadrupole. In the thin lens approximation applies when the length of the quadrupole is much smaller than the focal length of the quadrupole. So, let us say you have a quadrupole let me represent it by a lens this length is very very small as compared to this focal length. So, this length of the quadrupole is very small as compared to the focal length. So, length is small. The length of the quadrupole then approaches 0 while holding the focal length constant. So, that means l tends to 0 whereas k x into l is not equal to 0. So, the focal length 1 by the focal length is given by this expression you have under root k x tan under root k x into l this can be written. So, you multiply and divide by under root k x l here. So, this term will tend towards 1 and you are left with this under root k x under root k x multiply to give k x into l. So, the focal length is then given as focal length is 1 upon k x l. So, this is the thin lens focal length of the quadrupole. So, wherever you have quadruples that are very small in size as compared to the focal length of that quadrupole you can use the thin lens approximation it is a simpler formula to calculate the focal length. So, this is the focal length you can also calculate the transfer matrix using the thin lens approximation. So, here negative sign is for the focusing lens and positive sign is for the de-focusing lens. So, this is the transfer matrix for a thin lens approximation of the quadrupole both the focusing and the de-focusing. Now, in the thin lens approximation as the particle travels through the lens the position coordinate of the particle remains fixed, but the divergence changes. So, since the quadrupole is very thin and we have assumed that the length is 0. So, the position at the beginning and the end remains the same and what changes is only the divergence of the particle. So, if it is a focusing lens the divergence reduces and if it is a de-focusing lens the divergence increases. So, this is the location of the thin lens thin quadrupole lens at the in this axis. So, here the length is 0. So, this is the charge particle earlier it had a divergence which was like this the thin focusing lens has now changed the divergence to this value. Okay. Similarly, for the de-focusing lens this was the charge particle this is the thin lens the thin de-focusing lens this is the initial divergence of the particle and now when it comes out of the lens of 0 length the divergence has increased it is in the positive direction. So, let us see the behavior. So, it is easier to visualize the behavior of the particle in real space, but the trace space gives us more information. So, let us see the behavior of single particle motion real and trace space. So, for a drift space so this is x and z so in so this is the initial position of the particle and it is moving with a fixed divergence. So, here x prime does not change and it is moving from here to here. So, it is a diverging particle. So, you can see here at this location let us say this position was x1 and here the position is x2. Okay. At this at both the locations the divergence is the same. So, let us see in trace space trace space is simply xx prime. So, in xx prime this is the original position of the particle. So, it had a so this corresponds to x1 and then finally it moves here this corresponds to x2. So, the position of the particle has changed from x1 to x2, but if you see the x prime it remains the same in going from the first location to the second location the divergence has not changed. Similarly, for a quadrupole let us say I have a quadrupole and the initial position is here and then the charge particle goes through the quadrupole and gets focused. In this case if you see here this is x1 and this is x2. x2 is slightly more than x1. Okay. So, as it is exiting from the quadrupole the x2 is slightly more than x1. So, here the divergence has also changed it was it was diverging beam and now it has become a converging. So, this is the location here and this is the location here. So, this corresponds to x1 and this corresponds to x2. So, x2 is slightly greater than x1 and the divergence has same changed sign because here it was a diverging beam and here it is now a converging beam. So, it has come from the positive axis to the negative axis. Now, for a thin lens, so thin lens is the length of the length of the lenses 0. So, this is in real space. So, this is a focusing lens the slope decreases. So, initially the slope is like this and then as it passes through the lens of length 0 the angle decreases. So, here the position remains same because the length of the quadrupole lens is 0. So, you can see here x1 and x2 are the same this is at the same location only the angle has changed from positive to negative. Similarly, de-focusing lens here the slope increases. So, initially it was like a converging particle or a converging beam and then after passing through this thin de-focusing lens it has become a diverging particle. So, the again the position is the same this is x1 and the angle has changed from negative to positive. So, in this way you can visualize the behavior of a single charge particle in gray space. Okay, let us see how matrix formalism is useful in solving problems or finding out the coordinates of the particles for a large system. Now, let us say we have a large system where we have a quadrupole where we have a quadrupole magnet. So, let us say this is a focusing quadrupole magnet followed by a drift space. So, there is no field in this drift space. So, these drift space are often utilized for putting in vacuum pumps or some diagnostics or just for putting the flanges between two elements. So, there is a drift space. So, first we have a focusing quadrupole followed by a drift space then there is another quadrupole which is a de-focusing quadrupole again a drift space then there is a bending magnet here again followed by a quadrupole magnet focusing quadrupole magnet a drift space between the next two quadruples again a de-focusing quadrupole and drift. Okay, now I want to find out the coordinates of the particle at this location. I know the coordinates of the particle at this location. So, let us say the coordinates here are x1 and here it is x9. So, I want to find out the coordinates x9 okay and I know the transfer matrix of the focusing quadrupole the drift the de-focusing quadrupole and the bending and I also know the parameters of the beam. So, let us see how we can find it out. So, this is the initial location of the particle okay and this is how it will travel. So, this is a focusing quadrupole it is focusing it then there is a drift space it moves with the same angle or divergence there is a de-focusing quadrupole but de-focuses the beam then another drift space then a bending magnet and so on. Now, I want to find out x9 and x0 I know. So, x9 I can if I know x8 I can find out and I know the transfer matrix of this drift I can find out x9 okay. So, x9 is simply equal to the transfer matrix of the drift into x8 and x8 is this point I can write it in terms of x7. So, x8 is simply transfer matrix of the de-focusing quadrupole into x7 and x and so on. So, this can be found out so on. So, here x9 x9 prime can be you multiply all these transfer matrices you can find out if you know the initial coordinates you can find out the final coordinates at the end of this large system. So, thus we see that the matrix formalism is very useful in knowing the final coordinates of a particle in a huge large complex system. So, if we know the initial coordinates of the particle and the transfer matrices of the elements in between we can find out the final coordinates of the particle by matrix multiplication method. So, let us summarize what we have learned today. The beam tends to diverge in the direction transfers through the direction of motion due to various reasons. So, it could be due to the inherent divergence of the beam it could be due to the RF RF fields which cause de-focusing it could also be due to space charge forces. So, beam can be focused in transverse direction using magnetic or electric quadrupole. So, we saw how a magnetic quadrupole focuses we saw how an electric quadrupole focuses. A quadrupole focuses in one direction and de-focuses in the other direction. So, this is true for both quadruples both type of quadruples a magnetic quadrupole or an electric quadrupole. A combination of two quadruples of opposite polarities can be used to focus the beam in both the transverse direction. So, if you use two quadruples with opposite polarities then the net result will be focusing in both the directions. Solenoids focus the beam in both transverse directions. If you use a solenoid you can use you can focus with a single solenoid it will focus in both x and y direction. The matrix multiplication method the matrix multiplication method using transfer matrices of the various elements can be used to find the final coordinates at the end of the elements if we know the initial coordinates of the particles and the elements of the transfer matrix. In the next lecture we will learn more about transverse dynamics of beams. So, today we learned about single particle behavior. So, in the next lecture we will see how the beam envelope as a whole behaves.