 So welcome to this 12th lecture. In the 11th lecture what we saw was that in order to get the solution for any partial differential equation in electromagnetic, we have to basically minimize the energy. So when we say minimize the energy, we have to basically make variation in F equal to 0, that will make this F as stationary. Stationary means the energy is minimum and that energy minimum condition is given by this, when this F capital F of pi plus del phi minus F of phi, when that becomes 0 then we get energy minimum condition. And then we also saw that F of phi plus del phi is nothing but this, wherein del of x is equal to 0 because we are not varying x, what we are doing is at every x we are varying the potential phi, phi plus del phi. So we are varying the potential at every point and corresponding derivative of potential also will get varied and we are finding a combination of potentials at various point which will result into energy minimum condition. Also remember this capital F is the energy or energy functional and that is integral F dx for one dimensional case. Now this F, small f is in general function of x phi, phi dash but in case of Laplace equation it is just function of only phi dash. In case of Poisson's equation it will be function of phi and phi dash. Then we also saw in the process of this minimization, this whole del F equal to 0, that leads to what is known as Euler-Langrange equation. Euler-Langrange equation is this bracket equal to 0, bracketed term is equal to 0 is the Euler-Langrange equation whereas this bracket only bracket I am calling as Euler-Langrange expression. So this we already seen and this equation is important we will use this equation later now little bit more insight into what we have seen till now. Now this Euler-Langrange expression is this for one dimensional case. Now in Cartesian system we know small f is half epsilon E square which is incidentally energy density in electrostatics and then that is given by E is replaced by del V. So you get this expression and del V square is daba V by daba V square in case of one dimensional problem. So now also Euler-Langrange expression is this. In that actually if you substitute now f which is given by this here you will get minus epsilon daba 2 V by daba x square. This can be easily verified. Now let us understand little bit more about the whole concept. We also saw that if we know the exact solution and that is substituted in this small f and that in turn is substituted in Euler-Langrange equation we get left hand side of Flaplace equation. Small f for electrostatic problem 1D electrostatic problem is this that we substituted in Euler-Langrange expression we get this and it is natural that we are getting this because we already know that energy related to one dimensional electrostatic problem is this. Now if we actually substitute V is equal to x which is the actual solution in case of parallel plate capacitor. A parallel plate capacitor is a problem. We know that the potential suppose you know the in parallel plate capacitor problem which is you know in which two plates top and bottom plates are having potentials of 10 volts and 0 volts and if the distance between the two plates is 10 meters then every equipotential line say 9876 volts will be at corresponding meters of 9876. So effectively what we are having is the exact or actual solution for that parallel plate capacitor problem will be simply V equal to x. So at whatever distance you have at 5 meters from the ground plate you will have 5 volts and likewise. So V equal to x is the solution for that simple electrostatic problem without fringing. Without fringing effects considered at the end. Now if you substitute V equal to x in this Iller-Lagrange expression we immediately get this whole thing equal to 0 because V is equal to x and this becomes equal to 0 and that means what we are seeing here the Laplace equation is exactly satisfied. So since we already know the exact solution and then we substitute it there it is but natural that we are exactly satisfying the Laplace equation and that in fact is happening because when this is being made this is equal to 0 in turn Iller-Lagrange expression is 0 Iller-Lagrange expression equal to 0 means del capital F is equal to 0. So the whole theory that we saw is seen to be consistent for you know Laplace equation simple Laplace equation solution involving parallel plate capacitor problem. Now let us see if suppose we substitute in this F and correspondingly in Iller-Lagrange expression V as x has to 0.9 that means we are not actually substituting the exact solution that we know but we are substituting approximate solution these approximate solutions. Now actually if you substitute V is equal to x raise to 0.9 and now you substitute it here this expression is equal to this you can verify it easily and this is not equal to 0 that means Iller-Lagrange expression is not coming equal to 0 that is why Laplace equation also will not get exactly satisfied because here this will not be equal to 0 because obviously because we have assumed some solution which is not the exact solution. So this is what is called as you know this will be the corresponding you know this will be representing the error at every point but that error can be minimized by you know approximating a solution which is more closer to the exact solution by having more terms here we have just substituted x raise to 0.9 but if you assume a polynomial of course here it is a trivial solution V is equal to x that is why this question does not arise but imagine there is a complicated electrostatic problem wherein there is non-uniform field distribution then you know you will have to assume V as some complicated polynomial of x and that when you actually go through this entire procedure and minimize you will get an error which can be very small and that can be further reduced by using FEM procedure in which you know find discretization can be done. So now going further this equation we have already you know seen on the previous one of the previous slides this was this is that expression. When energy is getting minimized you have this expression which is rewritten here for 1D case correspondingly for 2D case you will have 2 independent variables x and y and this equation will get modified to this equation and noting here that G is nothing but del phi variation in phi. Now the question that will arise is for one-dimensional electrostatic problem we knew the energy density expression as half epsilon e square but if you want to find out a energy functional for a given PDE then how do we do that? So that is done by using the following procedure. So now our goal is to find functional for a given PDE. So we will consider first Poisson's equation and then we will when actually you substitute a known F function if that F function is exact and when I say F function is exact function that energy density function is known and then you are substituting the correct potential solution there then you will get del square minus del square phi minus h is equal to 0. So now in this two-dimensional expression equation involving del F which is variation in energy being made equal to 0 if we know F and that if we substitute it in this expression we will get minus del square phi minus h as we have seen in the previous case. In the previous case we will get del square phi minus h and when we knew this expression and when we substituted in this iller language expression we got the corresponding Laplace equation form. So similarly here if we know F corresponding to the Poisson's equation and if you substitute it here you will get this bracket, bracketed whole bracket term as equal to minus del square phi minus h and remember this g is replaced here by del phi. Now again this is same concept is summarized here if this phi now which is there in this small f if that phi is exact solution then del square phi will be equal to minus h and this equation gets exactly satisfied and then that is why this minus del square phi minus h will be equal to 0 and you will get automatically del del F, capital F equal to 0. But in that expression of F the expression of F is known but in that if we substitute phi approximate solution phi tilde as solution which is not exact but some approximate solution then minus del square phi minus h will not be equal to 0 and that will be equal to some residue at every point in the domain. So that is why when you actually force this del F equal to 0 in the process of energy minimization what effectively you are forcing is area integral of r del phi equal to 0 and this in fact we will see later for one dimensional problem that indeed when we approximate solution which is not exact we get residue and that integral of residue del phi dx equal to 0 in one dimensional case. Also one more point I want to say here now here r is unit of source it is charged in electrostatic phi because here when del square this h represents you know charge because del square phi equal to minus so go upon epsilon naught. So basically h has is a function of charge although it is go upon epsilon naught but if epsilon naught is absorbed here then you know you can take this as h as simply charge right. So this has unit of charge so r also since h and r they appear like this r also will be will have unit of charge and now this charge into this potential v is basically the energy work or energy right. So that del of residual energy integrated over the domain is being equated to 0 so that is the second you know interpretation of this equation right. More about this when we solve one 1D problem and then we will again see this being enforced in the formulation there ok. So now going further we again then start with the same equation that we saw previously we go further now and then what we do is we basically substitute in place of del square phi we substitute del square by del square phi by this and then you know h del phi we are separating out here. Now what we do this expression we are actually splitting it as difference of these two and then remember this we are taking only the first integral here that is being split into two right and then this first term here is basically replaced by this by using simple divergence theorem because divergence of this you can see it is this bracketed expression. Now what we will do this expression here so the internal term here this bracketed term we will further simplify on the next slide. For that we need to understand little bit again basics of what is meant by del capital F. Now variation in F del F is given by this now here as I have mentioned clearly there is no f by daba x into del x term because del x is equal to 0 in this variational calculus in the variational procedure. So now if F for capital F for example is daba u by daba x square which is nothing but u dash square u dash is daba u by daba x then del of u dash square by this formula is simply this right and now the first term is 0 because this u dash square is not function of u so this goes to 0. So only this term remains as written here and that can be simplified to twice u dash del u dash and now u dash is replaced by daba u by daba x in this right hand side. Now let us further simplify we now have to substitute this by something else which we will see now. Now let us take del of daba u by daba x square as we can see it is twice daba u by daba x into del of daba u by daba x. Now this is nothing but twice daba u by daba x into daba by daba x of del u because the del operator can be taken inside since by definition it does not involve variation with x. This expression the whole thing then just becomes half del of daba phi by daba x square similarly when the second term here which is in y that can be written as this simply you replace x by y you will get it this right. Now del f 1 now what is this f 1 f 1 we are calling this this is the whole f now we are calling this only this term as corresponding to del f 1. So this is this is del f 1 so that del f 1 now reduces to because of these two substitutions now here for these two terms right you get the expression here as this right and this first term here which was replaced by this divergence comes here as it is right. But here what else we are doing this now we are invoking the divergence theorem because here it is divergence of some vector dx dy is it not integral divergence of this is replaced by the corresponding counter integral we have seen in basics of electromagnetics when we saw the theory when divergence theorem is invoked the volume integral got converted into closed surface integral. Here now it is a two dimensional problem but effectively it is a 3D problem with dx dy into 1 that means it is the per unit dimension in z direction. So this is basically volume will get converted into surface open surface but here since it is a already you know surface with you know two dimensional approximation a closed surface in divergence theorem will get replaced by closed counter here right. So here that is why you have dot closed counter integral that vector dot an hat d tau right. Now we consider this second integral of is del F 1 capital F 1 which is given by this. Now here again for understanding this how to evaluate we will consider a standard our capacitor problem geometry is a parallel plate capacitor with potential specified on this 1 and 2 segments and homogenous Neumann boundary conditions specified on vertical segment 3 and 4 as we have seen earlier right. I will explain you what about this open surface and closed surface little later. First let us understand you know this closed counter is made up of these 4 segments 1, 2, 3 and 4 right. So on segments 1 and 2 potentials are specified. So del of phi will be equal to 0 because there is no variation we are not varying phi there is fixed we are already specifying. So if del phi will be 0 on segments 1 and 2 of this closed counter 1, 2, 1, 3, 2, 4 right. Now when it comes to segment 3 which is vertically down d tau bar is d tau an hat right. So that is you know this d tau is minus d y because this is vertically down. So that is a minus d y and an hat for this segment 3 is basically minus ax hat. Why? Because remember we obtained this by invoking divergence theorem. So that is why the actually the divergence theorem is applied for a volume integral and volume integral gets converted to closed surface integral. But now since we are having a 2D approximation of the problem what happens is the surface integral gets converted to open surface integral gets converted to closed counter integral right. So now this that is why you have got the closed counter here but we should remember in actual 3D case this is really a closed is not just closed counter but it is a closed surface as shown by shown here. So it is a closed surface it is not this cubic surface right. So now this the normal to this segment 3 is effectively normal to this surface because the what is there in the third dimension is this and the corresponding this surface is there. We know that normal for a face of any closed surface is outward normal. So segment 3 normal actually is this outward normal in minus ax direction. So that is why here it is ax hat. One of these terms will not contribute because this is an hat is minus ax hat and here when it is multiplied with a y hat the dot product will be 0. So only this term will contribute. So that is why only ?5 by ?x ? into this dy will remain. So this minus sign is coming from. So this is there is a minus sign here right there is a minus sign here. So that is why this minus sign is for that and this minus and this minus becomes plus. Remember this minus sign is coming from this minus sign right. So similarly on counter 4 sorry segment 4 this is the segment 4 and the corresponding surface will be this will be the surface right and the corresponding outward normal will be this. So the outward normal will be ax hat. This will be ax hat right and then d tau will be because this is vertically up integration. So plus dy and again you know this term will not contribute this term will not contribute because the dot product will be 0. So again you get the same thing and then here since ?5 by ?x in both these cases is 0 because it is we are we are imposed homogeneous normal condition on this is it not. We have got this equipotential lines which are entering normally that means that ?5 by ?x is 0. So that means this that is why here also it is 0 here also it is 0 on both 3 and 4. So that is why these 2 integrations on this 3 and 4 reduce to 0 identically. That is why this whole term does not contribute in this case of capacitor right. It does not contribute anything but in case you have some domain and some boundary where in homogeneous Neumann condition is not there some non zero Neumann condition is there then this term will be non zero and this will be the additional term in the energy expression and correspondingly in the FEM equation the last set of equation which is linear system of equation you will get additional matrix term corresponding to this and that has to be taken into account more about you know how do we form matrices in FEM procedure we will see later as we go further in this course going further. So now you know you have this F for Poisson's equation. Now what we saw the whole this expression del F1 reduces to only this then you have the vertical boundaries in that case with homogeneous Neumann condition you get only this because this will become 0. Remember if there are no homogeneous Neumann condition somewhere right then this term also will be there and then there will be additional term in F1 and you know this del F1 right but here for the in most of the cases what we saw we generally have for example you know in case of either homogeneous Neumann condition where boundary conditions are not defined or generally we you know enclose the entire our problem domain into a box or a rectangle and we specify reference potential as phi equal to 0 or A equal to 0. So in that process you know this term will go down to 0 because there is a del phi. So whenever generally we have whenever boundary is there we either have in most of the problems we either have either delete condition wherein phi is specified or homogeneous Neumann condition and that why this integral will reduce to 0 and only this will remain right. So now this F1 you have del F1 you have only this term remaining and then we had seen the whole expression F at the second term. Now that we take here and that term is simply you know is minus twice phi h. So this is h so this will be twice because here we have taken half. So that is why it is the same term right we are taking and remember this h represents the source in case of electrostatic problem. So it will be simply minus rho V upon epsilon in case of electrostatic and then also remember that in the functional expression as mentioned previously the terms involving h or source or any some constant term or any other term which is not phi. Suppose here in this case it was on the right hand side of the Poisson's equation it was only L h is it not minus del square phi minus h is equal to 0. So del square phi it was equal to minus h that minus h gets multiplied by phi in the energy expression. So phi into h. Now same logic now we will apply for magnetostatic Poisson's equation we know the governing partial differential equation is del square a equal to minus mu j right and now if we are doing two dimensional approximation then we will take always cross section which is perpendicular to current is it not. So if we actually see in any two dimensional problem you will always find suppose you are analyzing some electrical machine or transformer or any other you know device and if there is some current distribution you will always find that we take a cross section which is perpendicular to the current. So either we will show dot and cross is it not always we take a cross section perpendicular to the current right and then we approximate it as a 2D problem. So always here current so this is x y plane. So current is in z direction so I is in so I has only z component. So similarly a will also have only z component because direction of magnetic vector potential is direction of i. So effectively what is happening? a basically the direction gets fixed so what needs to be determined is only the magnitude. So only the magnitude of magnitude of this a needs to be found out at every point in the domain. So effectively this becomes a scalar formulation because direction is already known only we have to find out the magnitude of a at every point. So that is the advantage of using magnetic vector potential formulation in two dimensional magnetic field problems because the direction of current and therefore direction of magnetic vector potential gets fixed because we take the cross section perpendicular to the current and a z the direction of a becomes fixed in z direction. So only the magnitude remains to be determined at all points in the domain. It is domain everywhere a magnitude of a z needs to be determined. Once the magnitude of a z is known you can find out b x and b y because see current is in z direction. So b will be in x and x and y direction in this because the flux lines are going to be like this is it not in general. So b will have x and y components. So x and y components of b can be determined from a by using the expression b is equal to del cross a how do you do that we will see later when we get into finite element analysis. Thank you.