 In previous lecture, we derived equation of motion and that equation of motion was derived with reference to descent trajectory means how the particles are travelling at a displacement with respect to descent trajectory and what the trajectory of these particles are making an angle with respect to descent trajectory. In this manner, we derived equation of motion and that equation of motion was under the dipolar magnetic field and quarter polar magnetic field. Dipolar magnetic field means a constant magnetic field over a space and quarter polar magnetic field means magnetic field has some gradient over the space. Under these magnetic field configuration, we obtain the equation of motion that is the second order differential equation. Now we will solve it by one of the methods known as matrix method. This is a very powerful method which provides a tool to calculate the trajectory of particles from each of the magnetic elements. So trajectory from entire optics can be computed using this matrix method. So in this lecture, we will see this. Now this is the equation of motion in the horizontal plane and this is the equation of motion in the vertical plane. Here you can see these equations is much more like the equation of simple harmonic oscillator. However, there are certain differences. What are those differences which we will see here? Here in this equation kx is basically 1 by rho square plus gradient of the magnetic field normalized by magnetic rigidity. Normalization by magnetic rigidity actually makes our calculation energy independent. So everywhere in accelerator physics, you will see that formulation have been normalized by the magnetic rigidity. Similarly, in the vertical plane, we have ky, the gradient in the magnetic field normalized by the magnetic rigidity, however, there is a minus sign means gradient in the horizontal plane has the positive effect than the vertical plane. So in horizontal plane, if gradient is providing a focusing, then in vertical plane, this gradient will provide the de-focusing, which we have seen during the study of the quadrupole magnet. And in horizontal plane, you will see an additional term of 1 by rho square. Why this is an additional term? Because we assume that the bending is taking place in horizontal plane means we are making our accelerator in which design trajectory is completely in the horizontal plane. So this is our assumption and we are under this assumption, this 1 by rho square appears only in the horizontal equation of motion. So now, we will solve this equation of motion using some method. Using accelerators, we use different kind of magnets for different purposes. Now, you have learnt that the dipole magnet is used to decide the design trajectory, how much curvature we have to produce, where we have to send the beam and that design orbit is decided by the arrangement of dipole magnets. So the dipole magnets basically decides the design trajectory. So we can say in accelerators, dipole magnets, this design decides the design path or trajectory or orbit. And what the quadrupole magnet does, quadrupole magnet does the confinement of the beam around this design trajectory which is decided by the dipole magnets. So quadrupole magnet is used for focusing of the charged particles and each of these magnets, if we are assuming pure dipole magnet, pure dipole magnet means the constant. And quadrupole magnet, it means it has only gradient part in the magnetic field, means it has G which is del P y by del x. So these magnets have different K in the equation of motion. So in the equation of motion for the dipole magnet, if this is pure dipole magnet, means without any gradient, then we will not have any gradient related part in the K for the dipole magnet. And if it is a pure quadrupole magnet, then we will not have any curvature related part in the equation of motion. So each of these magnets have their own value of K. So for each of these magnets, we have different equation of motion means we have different K and we have different equation of motion. So again we see, now first the simplest structure in accelerator is the drift space. Drift space means a vacuum chamber connecting a straight, connecting two magnets or two points with a straight line means there is no magnetic field over this region and particle goes straight without feeling any force. So any trajectory which is going, it will go on its course in the drift space. Means drift space has no K. So in drift space in horizontal plane and in vertical plane, in both the cases we have K x and K y 0. So for the drift space, we have very simple equation of motion that is d 2 x by d s square is 0. And similarly d 2 y by d s square is also 0. This is basically a differential equation showing the straight line. In the dipole magnet, as we already discussed that curvature related part will be there. So in dipole magnet in the horizontal plane, we have K is equal to 1 by rho square plus gradient related part. However, we are considering pure dipole magnet means no gradient. So K x will consist of only 1 by rho 0 square. So K x is equal to only 1 by rho 0 square. Now in the vertical plane, in a dipole magnet, there is only contribution from the gradient part in the K and as we are assuming that no gradient is present in the dipole magnet, so K y will be 0 in this pure dipole magnetic field. Now in the quadrupole magnet, curvature related part will be 0. So only gradient related part will be in the K x and in K y also only gradient related part will be there. However, these gradient are opposite to each other in sign in the equation of motion. And in the last, a combination of dipole and quadrupole may occur, which we have seen in our course of weak focusing that if dipole magnet has some gradient, it can produce a curvature as well as focusing. So this type of magnet, which is a dipole with some gradient is known as synchrotron magnet. In this kind of magnet, we have curvature as well as gradient effect both. So K x will consist of curvature part as well as gradient part, this is the case and in K y, we already have only gradient part. Now again here, you can see by introducing the gradient, actually we are introducing the quadropolar component in the magnetic field. So if gradient part is producing some positive effect in the horizontal plane, it will produce some negative effect in the vertical plane. Sometimes if gradient is introduced in such a way that if it is producing focusing effect in the horizontal plane, then it will produce the defocusing effect in the vertical plane and vice versa. Now in accelerator, even a simple optics, we have a regiment of some magnets. And we can see that in actual optics of charged particles, we can have some quadrupole, suppose this is a quadrupole Q, then some drift space and then again there may be a dipole magnet which bends the trajectory in the desired way. So this is a dipole magnet. And then there may be again a drift space means no magnetic element, then again a quadrupole and like this. So now if we consider here the value of K in our equation of motion, you can see that this quadrupole, you can see this is the quadrupole 1. So it has its own K value Kx which depends on the gradient of this quadrupole magnet. Then this is the drift space, here you will have K2 you can say this is 0, then a dipole magnet, it will have its own K in the pure dipolar field, it will have only curvature effect in this K and in vertical plane, the K will be 0 for such kind of magnet, then again you can say this is a K3, then again a drift space. So you can say again K4 which is again 0 and another quadrupole you can say this quadrupole is Q2, this may have the strength different from the K1, so it may have its own strength K5 and like this and this optic axis in our coordinate system is designated by S. So we can see that the K varies over S, when K varies over S actual or a differential equation we can write explicitly in this manner where K is shown as a function of S means K is a function of S and this is the striking difference of this equation with that of the equation of simple harmonic oscillator. In simple harmonic oscillator we have d2x by dt square plus omega square x is equal to 0. Here omega square is a constant for a given oscillator, here you can say this is not a constant instead it depends on the independent parameter S. So how we can solve this equation? In this class we will see that we can break KS or KS function of S in the pieces where we can make this K independent to S and then we can solve the equation. How we can do this? We see now. Suppose there is a quadrupole magnet and then there is a drift and there is another you can say dipole magnet or like that quadrupole then drift and then dipole magnet. Now as we have said that this has its own K value. So within this quadrupole length you can say we have K as a constant. After this quadrupole K becomes 0 but within the drift space length this is again constant quantity K is equal to 0. Then in dipole if dipole is of sector type magnet and there is no gradient then it has certain K decided by its radius of curvature. Again within the body of this magnet this K will be constant. So within each magnet K has its constant value so within each magnet our equation will be exactly similar to the equation of simple harmonic oscillator and when in a single magnet we have equation like the simple harmonic oscillator. So we can write down easily the solution of this simple harmonic oscillator equation as we know that XS is equal to A cos root KS plus B sin root KS and these A and B can be decided by initial conditions. So this will be the solution of equation of motion when we consider as constant K inside a single magnet. It is derivative because we are going to solve second order differential equation so we need two initial conditions. So first initial condition can be the position itself and the second initial condition will be the derivative of this X prime which shows the angle. X prime is dx by dS and it represents the angle in the perexial approximation as we have seen. So differentiation of this quantity will give you root K sin root KS with minus sign which is written here and root K cos root KS which is written here. So this is the derivative of the first equation which will be the X prime. Now at the initial point, initial point we can consider as the beginning point of the magnet and at the beginning point you can say S is equal to S0. It is the our beginning point when the particle enters inside the magnet and starts feeling the force designated by this K. So at that location we can have at the beginning X is equal to X0 and X prime is equal to X0 prime. These are our initial conditions at S is equal to S0 at the beginning of the magnet. So we can put X0 value in this equation so we will get X0 is equal to A cos root KS0 plus d sin root KS0 and similarly we can put X0 prime in this equation so we will get X prime 0 is equal to minus A root K sin root KS0 plus b root K cos root KS0. Here now because we are solving a given magnet equation of motion in the given magnet so root K is known to us. S0 is the initial point of the magnet from where the we want to solve the from where our particle will trace out its path inside the magnet. So this is the starting point of particle trajectory in the magnet X0 and X0 prime these are initial condition which we know. So now in these two equations there are two unknowns one is A and another is B. So we have two equations two variables we can solve it very easily. So solution will give you A as a function of initial conditions X0 cos root KS minus X0 prime root K sin root KS0 and similarly we will get the B and B is equal to X0 sin root KS0 plus X0 prime root cos root KS0. So now we have A and B as a function of initial condition. So if we put these A and B value in our solution we will get the particular solution of that differential equation. This solution was the general solution equation of the differential equation and now when we have particular value of the A and B and we put these value of A and B in this equation we will get the particular solution of that differential equation. So let us obtain that particular solution. So at the place of A we have written the value from the equation 274A this is A and you now know A cos root KS and this is the value of B so this is B sin root KS. So in our solution of differential equation we have inserted the values of A and B in the form of initial condition. So now this X is as a function of initial condition and magnetic strength K here in this equation. Similarly we will get X prime also. Here you can see this is the again A and this is the value of the B. So now what we can do? We can collect the term of X0 together. So you will get X0 and inside bracket you will get cos root KS0 cos root KS plus sin root KS0 sin root KS means you will get X0 cos root KS minus S0. Similarly when we will collect a term containing X0 prime you will get such kind of trigonometrics formulation there also similarly for the X prime. So finally what we will get? We will get X X0 cos root KS minus S0 plus X0 prime root K sin root KSS minus S0. This is our final solution means X at S as a function of initial coordinates X0 X0 prime and magnetic strength K. Now if this S suppose this S, S0 is our beginning point of the magnet. If S is at the end point of the magnet then this S minus S0 is actually the effective length of the magnet and in that condition these X and X prime will be the coordinate of the particle trajectory at the end of the magnet. So we have obtained the coordinates of the particle trajectory which is passing through the magnet if we know the initial coordinates means if we know initial state of the motion of the particle we get the final state of the motion of that particle using these solutions. So now you can see from here this we can write down X is equal to X0 and some term related with cos plus X0 prime and some term related with sin and similarly X prime is equal to X0 with some term related with sin you can say 2 and plus X0 prime with some related to 0. So these solution can be written down in the matrix form which is written here and the element of the matrix are cos root kl 1 upon root k sin root kl and minus root k sin root kl and cos root kl. Here you can see that the second row of this matrix is basically the differentiation of the first row and this should be because we have X and X prime X prime is the differentiation of the X. So second row should be the differentiation of the first row and in this manner if we know the initial coordinates of the particle we can get the final coordinates. Here this solution is most general. Most general means we have obtained the solution in terms of k and we have seen that for different magnets k has different values for dipole magnet it has 1 by rho square for quadrupole magnet it is just the gradient normalized by the magnetic rigidity and in the case of drift space k is 0. So if we will put these particular values in this matrix we will get the matrix of that particular magnet. So we will obtain now matrices particularly for drift space quadrupole magnet dipole magnet and one another type of magnet which is known as wage magnet. What is that wage magnet? We will come to that point.