 We have been looking at the modified equation, just remind you the modified equation is the actual equation that we think we are solving when we get our approximate solution to the original equation. In employing the modified equation, we have defined consistency right and well auxiliary on the side I defined what is convergence. We also saw that the modified equation for original wave equation, the original wave equation, the original wave equation the way we were looking at it had a 0 right hand side right. But the modified equation ended up having terms that were of the form instead of being 0 had some coefficient second derivative of x and we had things with third derivative of x and so on. We wrote it up to and including the fourth derivative right. So we then ask the question just take one such term, the equations are linear why do not I deliberately add a term on the left hand side on the right hand side which has dou squared and you do x squared, mu 2 is a constant okay and very suggestively I called it mu 2, clearly I am going to have a mu 3 and a mu 4 fine okay. Now for this equation I am just repeating what we did at the end of the class, we said that a solution could be written in terms of Fourier series right and I will write one term it is still a solution so that u could be written as an exponent in I think I decided to get rid of the 2 pi and l right x-at. This was for the original equation we decided to go in the semi inverse route which means that we are going to try out come up with a candidate solution we will guess that the solution to this equation is in this form and that gives us one disposable constant d that we need to determine fine all the others are fixed. Now since I know I am going to add extra derivatives let me just write out all the derivatives that I require okay so dou u dou t right and then we can just substitute we can keep track of this and substitute whatever we want dou u dou t is what do we get so if you differentiate this right if you differentiate this or we will use product rules we will get the sum of 2 terms whichever way you want to do it so you will get the u times i n a that comes from differentiating the first one with a minus sign because it is a minus at plus b is that fine what is dou u dou x u times this is u times I will put a star u multiplied by u times it is not u of maybe I use a square bracket u of u times i n that is it that is it what is dou squared u dou x squared so you will get another i n every differentiation with respect to x you will get an i n so that will become a minus n squared u dou cubed u dou x cubed gives me an i n times that minus i n cubed u and finally dou to the fourth u dou x to the fourth is n to the fourth times u that fine everybody is with me now you can just work it out so we will work it out first for this equation as only a second derivative term so clearly all of them have u as a coefficient that will go away so if I substitute the first term is going to give me a minus i n a plus b and the dou u dou x has an a multiplying it so that will give me a plus a i n which is a whole point which is why our original equation was satisfied equals mu 2 times minus n squared minus mu 2 times n squared fine that is b so this tells me that for this equation for the equation that we have for this equation this tells me that the b here should be minus mu 2 times n okay fine so what does that mean what does that what what what what is implication of that u I will just write it out is a n exponent I just write it out again i n x minus a t e power minus mu 2 n squared t what does this tell us about you added terms if this weren't there it's just a bunch of signs and cosines right the amplitude depending on the n sin x sin 2 x sin 3 x depending on the n and the amplitude is n the n doesn't change okay it doesn't change with time n does not change with time it only changes with wave number it doesn't change with time whereas what's happened now is because it's being multiplied by this mu 2 n squared t the solution is going to decay okay I prefer the word decay in literature very often we call it a dissipative term so it's called the dissipative term or dissipation the scheme is said to be dissipative so the solution decays the solution decays is that fine the addition of the second derivative term the solution decays given that when does it decay mu 2 has to be positive mu 2 has to be greater than 0 so you get this decay if mu 2 is greater than mu 2 is greater than 0 is that fine so far it looks okay but there is something else that's interesting it doesn't just decay there is an n squared term here okay so it basically says that higher frequencies decay faster than lower frequencies okay so higher frequencies will decay faster than lower frequencies if mu 2 is negative if mu 2 is negative the exponent here is positive the solution will diverge fine is that okay so what we are saying is see remember I have added that this term to the right hand side because such a term appeared in my modified equation and what is the modified equation the modified equation is the equation to which my approximate solution the solution that my program is generating the solution that my program is generating is a solution to the modified equation so the modified equation has this extra term has the second derivative term the modified equation has a second derivative term and the mu 2 is negative my scheme is going to diverge is that fine and mu 2 is positive my scheme will converge right my scheme will be stable fine my scheme will be stable we have the added we have the added information about what our what our algorithm or the solver does I want you to understand by writing out this equation we are saying something about how our program is actually going to behave you understand that we can look at the modified equation and make an observation that is what we are trying to do this basically says that the program that you write using a scheme which has the second derivative term will cause the high frequencies to decay faster than low frequencies given that mu 2 is positive right and if mu 2 is negative high frequencies will diverge faster than low frequencies fine okay right so we this is this is the property that we are able to get so what happens if we have a third derivative now let us consider the situation where you have dou u dou t is a dou u dou x equals and we add a mu 3 dou cube du dou x cube okay and in this case b happens to be from the third derivative b is minus i n cube mu 3 is that fine everyone so the u for this equation the an exponent i n x minus well the b also is going to have an i n in it either we can take it in a one step or maybe we will do it in two steps let me not let me not hurry through it a t exponent e power minus i n cube mu 3 t okay and we can in fact combine these terms so this gives me an exponent i n x minus a plus mu 3 n squared is that okay so what was the coefficient that was multiplying the t the coefficient that was multiplying is the physical speed with which right it was it was the speed with which our equation was propagating the signal understand whatever whatever you are modeling because u or whatever it is that was that you are modeling this was the speed with which it was being propagated that speed has now changed okay that speed as in the so the addition of the third derivative term the we have a purely complex term here it is not going to decay there is no real component it is not going to decay it is going to keep on oscillating it is going to keep on oscillating added to it it turns out that our mu 3 term actually adds actually adds to the speed of propagation there is worse what does it add right what does it add so of course I will say I am saying add it because I must say I am in my mind saying mu 3 is greater than 0 it adds if mu 3 is greater than 0 it adds if mu 3 is less than 0 it subtracts right so it adds to the speed propagation speed and mu 3 less than 0 it will subtract okay subtracts but there is worse the speed that it adds depends on the frequency right so in this case in this case if mu 3 is greater than 0 high frequencies will travel faster than low frequencies am I making sense high frequencies will travel faster than low frequency that is basically what it says not only are not only are not only is the is the function that we are monitoring not only is it propagating at the wrong speed right but if you decompose it using Fourier series into its component frequencies right the high frequency will travel faster than low frequency am I making sense this is called dispersion right in a technical context most probably the first time you encountered dispersion was possibly when you are looking at Newton's experiment with optics right that is most probably the first time where you saw dispersion of light and light pass through a prism at an angle right dispersion the fact that different wave numbers are travelling at different speeds causes it may enables you to see that white light is may actually has a spectrum associated with it okay so that is dispersion that is most probably the first time you most probably encountered it is when you are sharing a bag of potato chips is something of that sort where you know that if you take a standard bag of potato chips right the larger wave numbers the more interesting wave number I should say the smaller wave numbers larger wave lengths the more interesting wave lengths tend to be on the top and the fine dust tends to be in the bottom so the person who grabs the bag first gets the biggest pieces right and invariably so any container if you look at it you will see that the dust tends to settle the you know if you have aggregate material you will see that it gets there is a process of dispersion as you disturb it where the higher frequencies end up at the bottom and the lower frequencies end up at the top the larger pieces end up at the top and the finer dust ends up at the bottom and you get a distribution so it is always what you have known intuitively that you should grab the potato chip bag right the front is a factor because simply purely because of purely because of dispersion right that high frequencies in this case there is a separation that takes place right you would like them to be you would like the signal to be in certain form but there is a separation that takes place what does that mean well if you had what that basically means is that if you have an initial condition which is like a step and you do a Fourier series expansion for this ignore ideas of Gibbs phenomenon and all of that right you do a Fourier series expansion for it that as it propagates in time right that we expect not to get a step but to get something that is that is maybe simply because the way you do Fourier series all of the coefficients all the wave numbers they combine together in such a fashion as to wherever there is a peak which you do not want it is cancelled by a higher frequency you understand and if they are traveling at different speeds what gave you a sharp step in the beginning as it propagates because the different frequencies are traveling at different rates they would not quite add up exactly okay am I making sense they would not quite add up so there is a in a sense if you if you look at the one that is propagating at the right speed there is a phase error that is introduced to the system some of them are not in the right at the right in the right phase they are not all adding up together right properly there is a phase error that you are accumulating that basically what happens so that is dispersion what about 4th derivative do you do t a do you do x mu 4 do x to the 4th we do not have to go through the whole process right b equals mu 4 and power 4 so this is just like the second derivative there is a difference though so u is an exponent in x-at e power-plus mu 4 n power 4 times t so for stability we require you will have stability if mu 4 is less than 0 mu 4 has to be less than 0 for stability for decay if it is not less than 0 it is going to it is going to diverge it is going to diverge I want to emphasize what we are doing here though we seem to be looking at these equations individually with these terms thrown in looking at this behavior you can look at your modified equation and then determine what is the behavior of your program let us say idea okay let us say idea this has an n power 4 this is this is a lot worse this has an n power 4 am I making sense I mean you can just look at if you consider wave number wave number 2 versus wave number 1 2 power 4 is 16 right if you look at if you look at wave number 1 versus wave number 10 now you are talking about exponential raise to the power 10 so this is really high frequencies are just completely being eliminated extremely rapidly but again we have the same story that high frequencies decay faster than low frequencies but because we have an n power 4 involved here right and the decay occurs when I keep doing this exponent then mu 4 is less than 0 right if mu 4 is greater than 0 it is going to cause a divergence fine and high frequencies will then diverge faster than low frequency right so this seems to tell us that maybe we have to be a little worried about the high frequency content is that fine is that okay right what about the modified equation do you remember the modified equation you remember the well you may not remember it just to recollect that I said that in order to in the modified equation you have time derivative terms right and to eliminate the time derivative terms you should really use the modified equation itself to eliminate the time derivative term okay and all the mixed derivatives that come because of that fine right what I did in class last time I just basically use the governing equation there is a reason why I did that right because we need that equation also though it is not really the true modified equation we need that equation also what I will do now is I am not going to do FTBS originally I thought maybe I would do FTBS I am not going to do FTBS I will save a little time I got myself a cheat sheet from my book which I have got a little table right of all the terms second derivative so we have seen second derivative third derivative fourth derivative what do you expect to be the nature of the fifth derivative term if there is one you expected to be dispersive right so the for the linear wave equation for the linear wave equation right if you add to the right hand side if there is somehow you add to the right hand side even derivative terms the sign may change but it is likely to be DK if you pick the right coefficient right and if you add odd derivative terms is not going to DK it is likely to be dispersive whether high frequency is travel faster or travel slower will depend on the coefficient that term has that has to be determined right so just looking at second third fourth we can sort of guess because we can see that you get I squared I cubed I to the fourth so on so it is very clear that it is going to become real imaginary real imaginary and the sign will keep flipping okay so that is very clear that process is obvious okay so what is going to happen let me just write out this let me just write out this table for you so what I am going to do is I am going to write forward time central space forward time forward space forward time backward space and this will look different from what I did last time because in this case I am actually using the modified equation to eliminate the time derivative term is that clear okay so this is the coefficients that I get for FTCS will look different fine I will show you when I do a demo I will show you an easy way by which you can calculate this otherwise it is quite it is a pain I mean you have to do it I have done all of these manually because even though I have done them using a symbolic manipulator I did not trust the symbolic manipulator I actually did it manually right so but what I will do now is I will have here let me first write mu 2 so this is the mu 2 term for FTCS so you get a minus a delta x by 2 times sigma fine what is sigma a delta t by delta x so where possible I will write it in terms of sigma because sigma is something that seems to be significant for us it showed up in all our stability conditions and so on so I am going to write it in terms of sigma where it is possible so then FTFS mu 2 happens to be minus a delta x by 2 so that is the same for all of them 1 plus sigma and FTBS is a delta x by 2 1 minus sigma you understand so right here you can see this is negative right unless something happens this is negative that could be positive right that could be positive which is what we got 0 less than sigma less than 1 we got a stability condition it is possible you may not always get the stability condition out of the modified equation or you may not always get the perfect stability condition out of the modified equation but in this case it actually worked okay so it really shows that whether if mu 2 is negative you get unstable situation if mu 2 is positive you get decay right and this and this and the solution or the algorithm is stable is that fine okay right so what we did with the stability condition we actually got here what about mu 3 mu 3 is a bit of a mess so that is going to be minus a delta x squared by 3 factorial 1 plus sigma 1 plus 2 sigma squared and a minus a delta x squared by 3 factorial I could have most probably saved a little space by keeping all the constant these a delta x squared those tend to be the same 1 plus sigma into 1 plus 2 sigma plus 1 or 1 plus 2 sigma and the last one is minus a delta x cubed I am sorry delta x squared by 3 factorial 1 minus sigma into 2 sigma minus 1 I am writing it a little big if you do not mind I will write the third column here so that is mu 4 so you get a minus a sigma delta x cubed by 12 2 plus 3 sigma squared okay so do not say first thing just do not take this down and you are happy with it you should try to check at least a few of them there is enough of you that you can take you know bits and pieces and check it out the other thing is you should at least do the using the wave equation instead of the modified equation to eliminate the time derivatives to see what is the difference between what I have given you and what you would get okay and you will get a little practice actually actually doing the modified equation which is a good idea for you to do okay so then you have a minus a delta x cubed by 4 factorial 1 plus sigma 6 sigma squared 6 sigma plus 1 and FTBS right our star performer amongst the three of these right is a delta x cubed by 4 factorial 1 minus sigma 6 sigma squared minus 6 sigma plus 1 okay that is a full table is that fine everyone so you look at this this basically says that for all of them for all of them you have dispersion for all of them you have dispersion fine and depending on what happens so depending on what values that you take the sign can actually change it is possible for the sign to change right in some cases not in some cases right and in this case what happens you have to see whether it what whether it something travel what whether it is high frequencies travel faster so I will allow you to work through this to see what happens okay so you have FTFS FTBS all of them are can be dispersive can be dispersive and you have mu 4 these two have negative quantities so you say wait a minute if it is negative they should be stable right but apparently it is not enough to it is not enough to stabilize apparently it is not enough to stabilize okay and that is likely because of the N power 4 which is more stabilized than the wave numbers close to 1 okay and what do we have here finally here we have positive it is supposed to be destabilizing it is supposed to be destabilizing but apparently it is not dominant enough to actually create problem for us okay right so we have got the second derivative third derivative fourth derivative looking at this I would suspect that maybe the higher derivatives are not really that important okay as a first order conclusion that I come to right if you were to try it out see we are not actually run programs yet right but if FTBS actually does deliver right we can conclude that the higher derivatives maybe are not that important right now we may find use for them later right right now it looks like they are not that important any other observations that we can make if you set sigma equals 1 for FTBS if you set sigma equals 1 for FTBS it looks like all the terms in the modified equation have a 1-sigma if you set if you set sigma equals 1 and it turns out by the way it is a fact if you write out the term the general terms in the modified equation all of the terms will have a 1-sigma so in the case of FTBS if you set sigma equals 1 your approximate solution is a solution to the exact equation the original governing equation okay that is nice but remember what does that mean see we you cannot just say oh I am solving the original equation we are solving the original equation but our function is still represented only using 11 grid points or 100 grid points or 1000 grid points we still have a computer representation of the function that function is being propagated at the right speed our approximate function is being propagated at the correct speed our approximate function is being propagated the way it is supposed to be propagated by FTBS by the I am sorry by the wave equation that is all it means if sigma equals 1 the modified equation for FTBS becomes identical identical to the original equation okay so our approximate so approximate solution actually satisfies that equation it is just that it is an approximate solution still am I making sense okay because it is a representation using a finite number of points if it were if you were to if you were to try to represent that step function that I talked about earlier using a finite set of points what you would actually get would be a ramp what you would actually get would be a ramp there will be a value here and the next value will drop and somewhere in between there is a step what you will actually get this is about the best that you can do if you are going to be using linear interpolates if you are going to use hat functions this is the best that you can do so the actual representation will be a ramp all that says is if your initial condition was a ramp everything is fine if your initial condition is a step then there is an approximation in the representation of that step is it okay everyone right so what we have seen is that we have this we have we have the modified equation we have I have written it in a strange fashion but we have the modified equation for all three of these you can try out modified equation what have we left out BTCS right and as I said you can use the wave equation itself and a little exercise just try it out make sure that you are able to do it get the modified equation for the rest fine are there any questions questions everything is fine okay so then what do we have now I will go to this board here what do we have now so the question is we have seen we have seen that because of mu 4 we have seen that because of this because of FTCS having this term in the front up front right because FTCS has this term up front that the coefficient being negative that is the reason why it is not working right that is the conclusion we draw from this analysis and in this case for sigma between 0 and 1 this coefficient being positive that is the reason why this thing is working okay so it seems to be a case for up winding that is one thing there is another thing we can ask the question well what actually is the difference between the two after all all you are doing is in the forward time central space part you have a UP plus 1 at time level q minus a UP minus 1 at time level q divided by 2 delta x right I have left out the time level q fine right and in the case of FTCS what you have is a UP time level q minus a UP minus 1 time level q divided by delta x really between the two schemes that is the only difference between the two schemes that is only difference and the modified equation changes in the sense that a second derivative term the sign of a second derivative term changes so what happens if you subtract one from the other what is the difference between the two let me ask the question that way what is the difference between the two right so the LCM is 2 delta x that is easy UP plus 1 minus UP minus 1 minus 2 UP plus 2 UP minus 1 and this gives me UP plus 1 minus 2 UP plus UP minus 1 divided by 2 delta x I can multiply and divide by delta x right if I multiply and divide by delta x this gives me a delta x I take the two back here delta x square that looks familiar that is a second derivative right so this sort of brings a little closure here so the difference between the modified equations and the difference between what we are doing here between central differences and forward so if you are doing and backward differences if you are doing up winding what you are effectively doing is you have taken central differences and added some kind of dissipation okay you have taken central differences and you added some kind of dissipation this is the exact amount of dissipation that you have added which caused a change to your modified equation is that fine right so there is a school of thought that basically says why not add the dissipation ourselves there are two ways two ways that you can pose it so basically what we are saying is FTBS equals FTCS plus dissipation okay so it is almost as though it is almost as though there is a possibility that any scheme can be written as FTCS plus add on terms okay that is one possibility but right now we do not go that far we basically say I can take FTCS and I can add any amount of dissipation that I want to it I can take FTBS and add any amount of dissipation that I want to it is that fine that is what it seems to say I can take FTCS and add any amount of dissipation I want to it so you can just basically say UPQ plus 1 is UPQ plus minus minus sigma by 2 UP plus 1 have gone to superscripts suddenly gone to superscripts and then you can add decide to add yourself you can decide to add some kind of a term that looks like a mu 2 times a second derivative okay right because after all I mean anyway see you are not solving the original equation you are only solving the modified equation so why not pick the modified equation that you are going to be solving that would be the argument why not pick the modified equation that you are going to be solving okay so if you know the modified equation you can knock out whatever terms that you want to the modified equation that is one way to look at it but you know the modified equation it has some structure that you do not like you can specifically modify that structure to something that you like, okay. Now you can ask the question, is it possible for me to take FTCS and just eliminate the dissipation, is it possible for me to take FTCS and eliminate a term, is it possible for me to take, I should restate that properly, is it possible for me to take the modified equation of FTCS and do something to FTCS so that one term disappears, the second derivative term disappears, the third derivative term disappears, okay. In order to do that if you want to do it sequentially that is you want to eliminate the second derivative term, in order you want to eliminate the third derivative term, that term that you use, the term that you add here in order to eliminate a specific component of the modified equation so that you understand what I am saying, dou u dou t, so it is not in the air, I am not saying this term, that term and so on equals and there is a dou squared u dou x squared dou cubed u dou x cubed dou to the 4th u dou x to the 4th and so on, let us say we just decide that we want to get rid of this term, right, you want to get rid of this term or you want to get rid of these three terms, okay but you are going to do it starting at the second derivative you are going to eliminate terms from the modified equation, do you understand what I mean, that means I have to add something to FTCS so that these terms disappear, okay, this is something that I want you to think about now. To determine what is the term that needs to be added, you have to use the modified equation derived from the original equation, you have to use the modified equation derived from using the original equation in eliminating the time derivatives and not the modified equation derived from using the modified equation, do you understand what I mean when I say modified equation derived using the modified equation, modified equation has time derivatives and spatial derivatives, we eliminate the time derivatives using the modified equation, eliminate the time derivatives using the original equation. If you want to eliminate any term in this, you should use the equation, I am not going to give you an answer here, you think about it, you have to use the modified equation that comes from this and not the modified equation that comes from that, okay. You may need, you just ponder on it and you will see why it is that I told you to derive the modified equation using this term, so you can actually systematically add terms here to answer the question what term shall I add here in order to eliminate this, you should derive the modified equation using the original equation, right, to eliminate the time derivative, is that clear, okay, you have to go back in order that statement may be a little confusing, you will have to go back, look at the how we derived the modified equation and you will understand what I mean, fine, okay, so it is possible for us to eliminate it, it is possible for us to actually add it, if you were to deliberately add, if you were to deliberately add a second derivative term, right, if you were to deliberately add a second derivative term, it is referred to as artificial viscosity, Navier-Stokes equations has a second derivative term which is viscosity, this looks like that, so this is called artificial viscosity. The term that shows up in your modified equation naturally because you just did a discretization is called numerical viscosity, okay, so this comes from your discretization, you have discretized it, so you end up with a term, a second derivative term which is not there in the original equation, right, so it looks like your equation has become viscous when it is actually not viscous, so that is numerical viscosity, okay, the term that you add deliberately because you want to fiddle with the modified equation, that is called artificial viscosity, fine, okay, right, then we say, we have said now see I just casually made a statement, you can add any kind, any amount of artificial viscosity that you want, right, is that true, what is the consequence of that, what is the consequence of adding any amount of artificial viscosity that you want, what is the consequence of adding any, so if you add a large amount of artificial viscosity what happens, say your propagation speed is 1, right, say your propagation speed is 1, 1 meter per second if you want units 1 meter per second and since I have said that your artificial viscosity can be anything I add mu 2, 10 power 6, is there a concern, should we be concerned, okay, now you have really totally changed the equation, right, you are no longer solving, you are really no longer solving the linear wave equation, you are solving something that looks closer to a heat equation, a is so small, this is almost like dou u dou t equals mu 2 dou squared u dou x squared, of course we do not normally say mu 2, there we use the term kappa, right, for thermal conductivity, thermal diffusivity actually but anyway, I will use the term conductivity, thermal diffusivity, right, so it would essentially degenerate to this equation, what is the stability condition associated with this equation, if you want to apply FTCS to this, apply to heat equation, FTCS applied to heat equation, somewhat of a rapid fire quiz here, so upq plus 1 is upq plus kappa delta t by delta x squared, I am not really doing this from memory, I sort of working it out may have, you can all, you can work it out in your head, right, up plus 1q minus 2upq plus up minus 1q, is that fine, we have a term here that looks similar to what we had earlier like sigma, we call this lambda, so we substitute our exponential, we go through that same process, so up plus 1q is e power i theta upq where theta was n delta x or n delta x by l n delta, 2 pi n delta x, whichever, however we define our intervals, say I am not even bothered, now that the fact that it is a local analysis is very clear, I am not even saying how large my domain is, I am not even bothered, it just shows up as theta and the theta will appropriately vary, okay, the theta will appropriately vary, so and so this basically becomes upq plus 1 is upq minus lambda times e power i theta minus 2 plus e power minus i theta upq and therefore from our earlier stability analysis, G did I make a mistake somewhere, plus lambda, still stuck with wave equation, plus lambda, right, therefore G which is upq plus 1 divided by upq, again across 1 time step, the amplification across 1 time step is 1 plus, what do I get e power i theta is e power minus i theta, 2 cos theta, so that gives me a 2 lambda into cosine theta minus 1, what and I want mod G to be less than 1, mod G less than 1, what does that tell me, this is real, this is real, right, this is real, mod G less than 1 tells me minus 1 less than G less than 1, fine or minus 1 less than 1 plus 2 lambda cos theta minus 1 less than 1, which way do we want to do this, we have to take an inequality at a time and see what happens, you want to look at this one, okay, so if I look at that one that tells me 2 lambda into cos theta minus 1 less than 0 or lambda should be greater than 0, what is the other condition give me, minus 1 less than 1 plus 2 lambda cos theta minus 1, you can do this, I mean there are different ways by which we can do this or minus 1 less than lambda cos theta minus 1, is that right, I took this minus 1 over there, minus 2 divided through by 2, I skipped a step, okay, fine. Then lambda, so what does it tell us about cos theta minus 1, what can happen, what does the constraint that this gives me, lambda is less than half, so you get lambda is less than half, we can come back to this, 0 less than lambda less than 1 half, the constraint that we get, we will come back to this, we are going to, I will do this in a 2D context, we will come back to this, okay, it is fine, right, so I will see you in the next class, thank you.