Solving the 1D Wave Equation

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone and welcome to another video today I'd like to go over the solution of one of the most popular partial differential equations around namely the one-dimensional wave equation one of our previous videos actually talked about how to derive the one-dimensional wave equation so we will build off a lot of the concepts covered in that previous video so if you have I haven't had a chance to do so please check that one out first before continuing on I also wanted to mention that this video is one in our series discussing partial differential equations here so I will leave links in the description below to all of the associate videos in this series so that being said why don't we jump into the discussion of the solution for the one-dimensional wave equation so both refresh your memory I just wanted a recap where we left off during the derivation section so we are talking about trying to solve the deflection here of somewhat string or beam here which has x coordinates running from 0 to L and we're interested in the horizont the vertical deflection of this object here this string here at any given time and at any given location X here ok so with this being said here last video we described how to derive the actual partial differential equation which governs the vertical deflection of this string and we said that was the one-dimensional wave equation given by partial u squared with respect to t squared is got to equal some positive coefficient we're going to call it C squared times partial u with respect to x squared here ok and now this is the 1d wave equation and we see that it is a linear homogeneous second-order partial differential equation here the goal here again is now to find a solution U of T X some function here of T and X which satisfies this partial differential equation in one of our even previous more previous videos we talked about how the solution space this is is very very large there are many use that might be able to solve this so in order to knock down that solution space a little bit we're actually going to apply some boundary conditions to this problem right now here so let's talk about that right now how about applying boundary conditions or let's call them BC so we don't have to keep rewriting that over and over and over okay so in this case we see that the boundary conditions usually the the nomenclature with boundary conditions implies it has something to do about talking about the the the physical or the spatial variables how are these spatial variables constraining our problem here so in this case we see that what this means here is I want to make sure that the deflection here at x equals 0 and x equals L are zero so in other words these things are pinned here right the string is a fix to these two locations and there's absolutely no way that it can move at either of those locations so we could write down boundary conditions like this we can say that all right.you at a given oh gosh sorry maybe yes sorry I guess in the notes I better be consistent let's let's flip the order here let's make X the spatial variable and have that come first and then T the tempura boy won't have it comes second here again it really doesn't matter here but just to be consistent here throughout the rest of the discussion here let's let's flip the order so in other words what I can say here is okay and u at x equals zero and at any given time T it doesn't matter this had better equals zero similarly when X is equal to L and at any given time T this had better equals zero here so what this is these are two boundary conditions physically what they represent here is this as the left side fixed right and this over here says at the right side is fixed okay so there's there's two boundary conditions here notice here that we did not put any restrictions on what UX at zero or u X at L look like right if we had put variables here or specified conditions here that would be saying that the slope here has to be a specific value so that might be the case here if you if you held it and you made sure that the end was always pointing in one direction but in this case we want pin connections here so we're not going to specify these so effectively it means that the slope is free to be anything it wants but it has to be fixed here right so by not specifying this we're basically saying that these are pinned connections right so it's free to freedom to rotate okay so here's two boundary conditions furthermore we can also apply initial conditions so let's do that now so how about apply initial conditions and again I don't want to have to keep writing initial conditions so let's call these things I sees for the rest of the time and what we're gonna see here is again from a nomenclature perspective initial conditions just have something to do which tell you what does the function look like at a given temperature right so initial conditions maybe we should specify what should this look like initially but when we let the thing go so in other words what we're gonna say here is I want to specify that okay the function at time equals zero here right this has to equal I don't know some some deflection here right so what this is saying is this f of X is going to specify an initial deflection of the string so the initial deflection you know maybe it's triangular maybe this means that the guitar player goes ahead and picks up the middle of the string and lets it fall in this in this perfect triangle before they let it go at time equals zero right maybe it's maybe it's sinusoidal right it's it's some function so this is my initial condition here telling me what is the initial position of every location X of the string at time equals zero right okay so maybe we can write this down here so this is the initial flexion of the string here right similarly we might wanted to specify that okay in addition to having an initial condition in position there might be an initial condition in velocity here right each one of these every section of string might be moving at some given time here so what we might want to specify here is that the partial of U with respect to T at any given location X but at time 0 here this is going to be equal to G of X right and again this is shorthand notation here for partial u with respect to T here you take the partial of the function with respect to T here and then you evaluate this at time T equals 0 here right sometimes you'll just see it a shorthand like this here and again what we said this does here is this specifies an initial velocity profile of every location of the string here so usually this will be 0 meaning that that the string starts from rest here but there's no reason it couldn't already be in motion when we when we kick the problem off here right okay so with this I think we have a good formal problem statement here so we have the governing partial differential equation here we have some boundary conditions and some initial conditions on this problem here so I think it's well posed at this point the problem is set up here so now it's just a question of how are we going to go about solving this so what we're going to do here is we are going to use a technique called separation of variables and it happens to work for this particular class of partial differential equations the game plan is really to treat this PDE like 200 DS so let's talk about that here so let's talk about the separation of variables technique okay so again we got ourselves a wave a coil sorry though what the 1d wave equation here and what we're going to do here is follow three steps in the separation of variables here step one what we're going to do here is we are going to basically apply the method of the separation of variables okay this is sometimes referred to a KA as the product method and you're gonna see why in a second okay what this thing does here by doing this here is we are going to try to obtain two Odie's from the original PDE oh right from the partial differential equation we apply this technique it's going to yield to ordinary differential equations here which we should have a good handle on how to solve once we have these two ordinary differential equations let's move here to step two step two here is we are going to determine now solutions for these two ODS using techniques we already talked about here so determine solutions for Odie's and we're going to see that at this point we're going to have to apply our boundary conditions not the initial conditions yet so let's write this down so we're gonna say determine oh sorry maybe determine solutions for OD es that satisfy boundary conditions okay and then step three is once we have these Oh de solutions we are going to use a fourier series here to try to compose a solution to get us a total solution of the original partial differential equation that satisfies the initial conditions here so step three here is use Fourier series to compose solutions from step two to get a solution to the original PDE that also satisfies the initial conditions initial conditions okay so that's our three-step process again step one we're gonna apply the separation of variables or the product rule that's gonna yield two ordinary differential equations which we have lots of tools to solve step two here is solve those OD es using the Associated boundary conditions once we have these base function solutions here we're going to use that principle of superposition that we talked about earlier for PD es and combine it with a Fourier analysis here to get ourselves a solution that satisfies the initial conditions of the problem here so that's the game plan here um there's going to be a lot of nomenclature associated with this here so maybe what we should do here to keep to make this a little easier I'm gonna erase some of this and let's dedicate half of the board here well not not not half but let's dedicate a section of the board over here - maybe just nomenclature here so we can try to keep all of our symbols and all these things we're gonna define straight here so let's go ahead and uh yeah let's go ahead and just make these into sections here so so the problem statement here we already saw that there's a bunch of objects and variables defined here so maybe we should write this all down okay so first we got T this is the tension in the string and that could be in units of say Newtons if you like here row here we said was linear density right I think we said this was in units of kilograms per meter here right we said L was the length of the string units of meters for SI what else we saw for the problem statement and I'm going to include the differential of our shal differential equation in here right we saw that there was this constant C here which we saw was a square root of T over Rho here right it was this positive value here which is just some given parameter of the PDE right so given parameter of the PDE alright okay what we're solving for here is U of X and T here right this was the deflection or the vertical deflection right in units of meters if we're keeping track of the meet the the units here we said X here this was our spatial independent variable or it's basically the exposition of the string here this is in units of meters here T was our other independent variable but it was our temporal variable units of seconds and then what else have we got here Oh f of X here right this was our initial condition in position so again this is in units of meters this is talking about how much is the string actually deflected and then we had another initial condition G of X here this is the initial velocity of the string units of meters per second here right okay great so now maybe what you want to do is dedicate some space here is let's go ahead and start listing out some of the things that we are going to use for step one for step two well maybe we need a little bit more space here step two and hopefully oh boy I don't know if I'm able to fit this here hopefully uh step three and I hope you can see that in the video here okay so let's start continuing on with this discussion here and as we go along we'll fill in some of the nomenclature for all of these different steps here okay so let's wipe the board clean here and talk about walking through steps one two and three all right so let's go ahead and jump into step one so step one here was we are going to basically apply the product rule or sorry the product method alright or the separation of variables method here okay so the concept with the separation of variables is remember we're looking for this function U of X and T here right now here's where the magic happens let's make the assumption here that this function the one that's going to solve our 1d wave equation we're going to hope and cross our fingers and really just that you could write this thing as the product of two separate functions here an F and a G here and what makes F special here is that F is only a function of the spatial variables and G is only a function of the temporal variables so in other words we are separating the dependence of these two independent variables into two separate functions which are multiplied together or a product hence you can kind of see where this name the product method or the separation of variables technique come from here so maybe we should write this down here in our nomenclature here for step one here we are going to assume that u can be written as the product of two functions one is only the spatial variables and the other is only the temporal variables so this is how this works for the separation of variables technique so if this is true what we should do here is let's go ahead and subs differentiate this twice here with respect to time so let's go ahead and diff differentiate twice with respect to time okay so in other words I'm looking for partial u with respect to T squared right so all I need to do is differentiate this twice with respect to time so f has no T in it so really what we end up with here is I think it's not too much too much of a stretch to see that this is this thing right G of T DT squared right and again let's use our notation here to make our life a little easier that remember derivatives with respect to time a lot of the time to make this a little bit easier on ourselves let's write this as G double dot right we could write it like this and actually we can drop this sub X and sub T notation as well because we know F is only a function of X G is only a function of T here so really you could write this thing as f G double dot right okay similarly let's also differentiate how about twice with respect to space or X right so in other words I'm going to take the second derivative of this thing with respect to X here right so again this is now well partial f of X DX squared times G of T here right which using our notation we talked about earlier right we could write this as f of X whoops sorry sorry sorry uh partial right oh sorry now I'm using this in two yeah this is this is f prime prime of X right times G of T right so again we're going to use the primes to denote derivatives with respect to the spatial variable and the dots to denote derivatives with respect to the temporal variable and again let's drop this notation of sub X and sub T so we could write this as f prime prime G here okay so now let's go ahead and insert these two into the one view equation here so let's go ahead and insert into the 1d wave equation right so if you remember our 1d wave equation said partial u squared with respect to T squared is equal to C squared partial u squared with respect to x squared here alright great so here's a u dot dot here is U prime prime that term so just sticking those in here what do we end up with we end up with F G dot dot right that's the left side is equal to C squared F prime prime G right okay let's go ahead and divide both sides here by how about the term C squared F G okay so what we end up with here is again let's see let's rewrite this thing this is f G dot dot is equal to C squared F prime prime G and I want to divide both sides by C squared F G divided by C squared F G okay so a lot of this stuff cancels out so this F cancels this F cancels this C squared cancels the C squared cancels and the G cancels and the G cancels here all right and now what we end up with here and maybe let's uh let's change your notation a little bit here this is g dot dot all over G and this is equal to oh sorry I'm sorry I dropped the 1 over c-squared right thing or C squared over there okay this is um what do we end up here with F prime prime over F n right and now let's remember here that G we said G is only a function of time right so this is only a function of time and this is only a function of time here and over here we said F was only a function of X here alright so this is actually kind of fascinating here if you look at this thing long enough right what we've got here is the left side we've isolated all the dependence on the tempura very temporal variable T on the Left isolated all the dependence on the spatial variable X on the right-hand side so if you look at this the left-hand side is only a function of T and the right-hand side is only a function of X if you think about that long enough because these two variables T and X are independent of one another in other words if I change T I'm not guaranteed to change X and vice versa the only way these two things could be equal here is that this left side had better equal a constant number similarly with the right side so both of these have to equal the exact same constant number if not one of these could change independently the other here right and you would violate this equality so therefore both of these things have to equal some constant K here right so this is really fascinating this K here is referred to as our separation constant right and like the name implies this has to be a constant value it's a static number here right otherwise this inequality would be would be violated here right so if that's the case here why don't we try to break this up and take the left-hand side set it equal to K take the right-hand side set it up equal to K and let's see what we end up with here so let's do that right now so let me erase some of this and I've got to be careful not to erase the nomenclature section right so what we end up with yours let's look at the left side here so we have G dots of T all over G of T and you got the one over C square here this has got to equal K here right so that's the left-hand side it's got to equal to separation constant and we also set the right hand side or F prime prime of X over f of X has got an equal K here that's the right hand side equaling the separation constant well you know what let's just write this out in maybe a slightly more recognizable form here so maybe let me multiply this over here and then move everything to one side in other words let me let me let me rewrite this side here I could rewrite this thing here now as G Prime for us right G of T minus C squared yeah K G of T is equal to 0 right and this one here is going to turn into F prime prime of X minus K times f of X has got to equal 0 right and all right let's these two up here because now if you look at these two equations by themselves maybe let's look at the top equation here right if you look at this you see there's one independent variable associated with this just T here right so this is actually a second order ordinary differential equation in fact you can actually attack on the adjective linear here if you'd like here right so what we end up here is let me erase this we can write a little bit get a little bit more space here this here is a second order linear ordinary differential equation here right and perfect this same thing down here what what does this look like if you look at it by itself it's also a second-order linear ordinary differential equation so here's the power of this this separation method here or the product method here is we took a partial differential equation of two independent variables and now we've broken it up into two separate ordinary differential equations that we can now go ahead and and and try to tackle here right okay so that's that's basically step one here we've got ourselves our two ordinary differential equations here the last thing that we should maybe add to our list here of notes here is in step one we saw a step one admits this variable K here right this is our separation constant and tell you what let's leave this a little bit blank here because here in step two we're going to see that this K has to take very specific here okay so tell you what let's um let's pause I'll erase the board here and we'll come back and start tackling step two of the process alright so now we are on to step two and we said earlier step two is basically trying to satisfy the boundary conditions right so if you remember what that meant here for our picture of having the string here of length L here right we said that we wanted the start and the end point to be fixed here right so what that meant here was that the deflection here at point zero at any given time at Barratt equals zero and similarly the deflection at x equals L at any given time had better be equal to zero so how do these translates into restrictions on our functions big F and big G here right so let's write down our boundary conditions so again we had U of 0 T this has got to equal 0 right for all T right this was basically our equivalent of saying the left side fixed right the left side of the string was faced here well if you remember here what did we say u was we said due to the separation of principle or separation of variables we said you was going to be a function big f as a function of X here and X here in this case is 0 here right x a G of T right so we see that this has equals 0 for all T so let's do the same thing for the right side so we said for the right side we said all right the x equals L at any given T had better equals 0 for all T right this was our right side fixed constraint here and again we see what that means here is that means that F of L times G of T has got to equal 0 right so let's focus on this boxed portion of the boundary condition here ok and we're going to see what does that yield so if you look at this thing long enough here there's a couple of ways that you can you can solve this let's looks for example let's look at this every condition here right one really easy way to make the left-hand side equal the right-hand side is if what if G of T was zero here right so one solution right would be to just simply say G of T is equal to 0 for all T right if that was true that that sure would satisfy this the left boundary condition fixed but the problem here is if you follow this train of logic a little bit further here we said that all right the overall deflection of this string here was f of X times G of T right if this is zero for all time here it doesn't matter what F is right this whole thing is zero right which again if you think about this this actually works and makes perfect good mathematical sense this is basically saying what the string at any given position any given time it's always zero meaning the string is not moving at all it's just flat here right if the string was just flat that's perfectly reasonable right because what a flat string looks like is this red line which hey look at that it nails the left side boundary condition here no problem here so this is definitely a solution although one adjective that we might want to throw in front of this here is how about trivial right this is a trivial solution here similarly you see that again this is also I mean it also nails the right hand boundary as due to the exact same logic we talked about here so long story short G of T is equal to 0 is a trivial solution so that's not what we're looking for here because that yields absolutely zero interesting behavior we don't see any of these vibrations like we saw in the demonstration of the standing waves so in that case let's go ahead and say in order to have a non-trivial solution we need G of T to not be equal to 0 here right this is in order to have a non-trivial solution ok well we still have to satisfy this boundary condition so if G of T is not 0 that means that F of 0 and F of L have to be 0 right that's the only way will satisfy the entire boundary condition here so we see this analysis leads to this discussion here right that we see that ok this function f it's got to have the func the feature here that when you plug in a 0 or you plug in L the function here returns else so this here is effectively the non-trivial boundary condition here that we can apply so let's go ahead and use this result here to try to solve the first OTE now you remember here we we got two OD es out of step one here right so let's take a look at one of them right now so one of them here let's take a look at the spatial one first remember we said that F prime prime of X minus K f of X has got to equal zero and now we see that there are two of these initial conditions here or boundary conditions I guess maybe boundary conditions ism is a better word here right so f of 0 has got to equal 0 and F of L is equal to 0 right so here is our well posed linear second order ordinary differential equation here right so I've got a second order ordinary differential equation I've got two initial well I've got an initial condition and a final condition you can kind of think about this here right this is a little bit different than what we saw earlier with our study of ordinary differential equations usually we specify the initial position and the initial velocity of an ordinary differential equation but here we see we are specifying an initial condition and a final condition in other words this function f has got to start at a certain value and it's got to end at another value here so again especially since the independent variable is X here maybe maybe the better name for these are boundary conditions rather than initial conditions here but this is uh this is getting a bit of semantics here right so again let's go ahead and classify this whole system here so maybe I'll just draw an arrow to this thing here and we'll say this is a linear second order ordinary differential equation here right and here are the Associated initial and final conditions so we see that from our study of mechanical systems right we've seen this type of ordinary differential equation to pop out before this corresponds to something like an undamped oscillator here so let's go and write down here that the mechanical analogy is a undamped oscillator in other words if you went ahead and drew yourself a Freebody diagram and put a mass here on top of some kind of spring with no damping effect here whack the mass and let it go here the governing equations of motion of this would be a linear second order ode EE that fits exactly this this format here right so from physical intuition from studies of our ordinary differential equations earlier you know that the the solution to this system is just a bunch of secure sine and cosine waves right so let's write that out I can basically pull out the solution to that ordinary differential equation right now and we can say here that solutions to undamped second-order linear ode e's right they take the form of something like this right it's going to be an f of X is going to be an a cosine of let me see here oh sorry sorry I jumped a little bit ahead here I got a little bit too excited here tell you what come back here let's come back here and I want I want to make one note here you can show here while we're having this discussion of trivial and non-trivial solutions here you can show here that this K has to be negative it cannot be 0 and it cannot be positive it's if it's 0 or positive end up with this other U and again with the trivial solution so the only way you have a non-trivial solution here let me write this down non-trivial solutions occur only if K is strictly less than 0 it's got to be negative here now I'm not going to go through the derivation of this I think I kind of hinted at how you could get to that the reason we're not going to through the derivation of this is because it's a homework assignment for that I assigned from one of the classes I teach so if I do it right here that's going to kind of basically give away the homework assignment but you can basically go about this by showing that if you had a K equals 0 or if you had a K positive you would end up with a bunch of trivial solutions here so it's got to be negative here to remind ourselves of this factor let's make the substitution and say K is going to be negative P squared here so this is just it's just a change in notation to remind ourselves that the separation constant must be negative okay so that's all we're going to do some tell you it back here in our nomenclature here let's write this down K is negative P squared here right it's a negative value here all right so we can go ahead and put that back here into our differential our yeah our ordinary differential equation I'll make that substitution I can rewrite this thing as as this P squared right ok all right so now here's our linear second order ordinary differential equation with our boundary conditions undamped oscillator I will pull out the solution of this thing it's just going to be a sine and cosine wave of this frequency P here right so we end up with okay the thing that solved this thing is a cosine px plus some B sine of P X right okay so this is a general solution what we now need to do is let's go ahead and apply our boundary conditions to find out what do a and hat and B have to be to find a and B okay so let's do the first one here so let's go ahead and do boundary condition number one here right so that is going to be f of zero is equal to zero so here's our first boundary condition let's go ahead and apply this and see what does that mean here right okay so we said that F of zero here here's our F so that just means at anywhere I see X let's just stick in a zero here so this is a times cosine of zero plus B times sine of zero here right and we said what had this better equal here when you evaluate it it better equal the big fat zero here right so this has to equal zero okay so what do we end up here with this is this is a and this times that it was zero so here oh okay so it pretty readily admits here that okay you're a coefficient has got to be zero that there's no other solution here right okay great let's go ahead and do the same thing for boundary condition number two here right so boundary condition number two said that okay f of L has to be equal to zero okay so same thing F of L what is f of L so everywhere I see an X plug in and L here so I end up with a cosine of PL plus B sine of PL and again that has to equal zero here in order to satisfy the boundary condition here okay so this has to equal zero alright if that's the case we let's use our previous knowledge here I know that a zero so this whole term does not contribute here right so we see that all right in order for this to be true we see B times sine of PL has got to equal zero okay so we end up with this other choice here there's a couple of ways we can do this one way that this could work here is you could say that alright one solution here is again B equals zero that sure would work here right what's the problem with this the problem with this is if a is 0 and B is 0 this function f is again a big fat 0 if we take this into account and say that okay you was F times G here right if this is a big fat 0 we see we end up with that same trivial solution problem here right mathematically it solves it but man that is not an interesting engineering solution at all here right so this again is trivial this is a trivial solution I don't want to consider that ok the only other way that if we consider that B is not going to be 0 that means this term here has to be 0 sine of PL has got to equal 0 in order to make this true here right so what does that mean that's very actually kind of interesting let's take a look now so we see here that the condition here is that sign of pl must equal zero okay if you remember how sign works right sign is going to be equal to zero if this is if the if the argument to sign is what if it's zero if it's PI if it's two pi 3 PI 4 PI and PI any mall integer multiple of Pi here inside will will yield zero so in other words I'm saying that PL all right that argument going into sign here this has to equal some integer multiple of Pi here this is for n in the integers let's write this as this script ez here so again this is like integer values right so n has got to be one two three yada yada yada I guess you can consider negative integers as well it's that's mathematically fine here okay so um all right that means P has to have very specific values right so let's solve for P here so I can write that okay this means P has to be equal to n PI over L right for n in the integers right okay this is actually getting pretty fascinating here so what we end up with here is that this function f here that we came up with here we saw sorry I pointed to the wrong thing right we said all right a has to be 0 B can be arbitrary as long as P takes on only these specific values we just computed right so in other words the solution or actually maybe we should write another adjective to this the non-trivial solution to the ODE ee is what it's f of x right has got to equal B sine times n PI over L X for an N has got to be in an integer value here right so if you look at this right we said okay B can be arbitrary n has to be integer values so one notation that we may want to adopt here is let's go ahead and put like a little subscript and here right because we see that for n equals 1 you get a solution n equals 2 you get another solution n equals 3 you get another solution and but n has got to be integer values for this thing right ok so what we do now what we have right is we claim here that this is the solution to the original ordinary differential equation so for this case I think what was it it was it was f prime prime of X plus P squared f of X is equal to 0 with our boundary conditions of F of 0 is equal to 0 and F of L is also equal to 0 ok and we claim that this is the solution or family of solutions that is actually going to solve this so this is really interesting right we had a differential equation with two constraints here but we end up with an infinite number of solutions so you know what might be helpful let's go ahead and convince ourselves that this actually solves this differential equation so I'll take its derivative twice here and I will go ahead and plug it in and see if this works and actually again maybe maybe we should make a note here maybe one other thing here is is we said P has to be very specific values here right yeah I think that's fine here so maybe the last thing we should do tell you before we jump over to Mathematica here let's go ahead and write down that P has got to take on very specific values back over here in our little list of nomenclatures so we said that this thing must take specific values okay all right great so with that being said let's go jump over to Mathematica and plug in this candidate solution into this ordinary differential equation see that it satisfies the differential equation and satisfies these two boundary conditions here ok let's jump over to Mathematica alright so here we are in Mathematica and if you remember here what we're trying to do is check that our solution of what do we say I think we said our solution here was f of n of X is B times sine n PI over L X here right with and in the integer values here right we want to make sure that this satisfies the original OTE which we said was I believe F prime prime of X plus P squared f of X is equal to 0 with boundary conditions of what did we have I think it was f of 0 has got an A equals 0 that was the left pin condition and the right pin condition like that so this is what we're trying to check here so let's go ahead and just write some code to do this here so obviously we can go ahead and define our function f of X here which was B sine of n PI over L times X here right that was our candidate function here and let's go ahead and check to make sure that this satisfies the original OTE here so again let's maybe put a little print statement here and we'll let's say does this thing satisfy the OTE right and in order to check that what I need to do here is I need to take the derivative of f of n with respect to X twice right add it to P squared and then multiply that by FN of X right and what I want to make sure here is that should equal zero okay so if I shift enter this obviously it doesn't quite work right now because we have an arbitrary p right now we showed earlier that this is not going to work for any old p value it's only gonna work for specific p values specifically we show that P has got to be um let me replace this thing with P it can only have values of n PI over L right so here if we do this no whoops sorry I put the parenthesis in the wrong spot here all right let's put the parenthesis over here to cover this there we go and now we see that this is true here right so as long as P has values of n PI over L our candidate function works out all right how about now let's go ahead and check the boundary condition here so again let's go ahead and say does this satisfy our boundary conditions okay so we can go ahead and check f n of 0 that better equals 0 and f n at x equals L that also had better equals 0 so let's go ahead and shift enter this and again the first one is true here but the second one is actually also interesting as well we see that you know what for an arbitrary value of n actually this is this is not true but luckily for us we said n has to be an integer value here so if n is an integer value obviously we see by construction that sine of 1 pi 2 pi 3 PI 4 PI all of those should be equal to 0 so yes indeed this actually works if we want to get this to work in Mathematica here why don't I go ahead and simplify the left-hand side with the additional constraint here that n is an value of the integers whoops integers there we go and if I shift enter this there we go now it's true both boundary conditions are satisfied so I think we're in business here and we've shown here that this is a good candidate solution for that first OD all right so we've got that first differential equation solved so let's turn our attention here to the second OD e that we were looking at if you recall that second OD II had to deal with the temporal function and let's repeat it here for convenience right so that was just G dot dot all right minus C squared K G of T is equal to zero right okay so here's our differential equation again if you stare at this thing here we recognize that hey you know what this appears to be a linear second jeunesse ordinary differential equation with some coefficient right here and if you remember from our previous discussion we also said that you know what this K value had very specific P was was a negative value here as shown here and we said those peas can only take on very specific values we just demonstrated that here so just to refresh our memory here let's just remember here that what we just discussed here was that okay the separation constant right that was a negative P squared right it was some negative value so we use this to denote it and we showed also here so if you want to recall again all right something to remember within the section that we're remembering here is that P had to have very specific values right P had to be n PI over L and n had to be an integer value here okay so great love let's substitute this into this and then substitute it into here so we can basically rewrite this differential equation using n PI and LS things like that so if you sub that in let's sub that into the OT easier right you can write this whole thing as what do we got we got G double dot of T minus C squared times K what was K here it's this thing here right so this is times a negative n pi over l squared times G of T is equal to zero okay so let's just expand all of this here and what we could do here is eventually write this thing to look like G double dot of T um plus here we are plus C n pi over l squared times G of T is equal to zero let's call the thing inside the braces let's call it lambda and we see lambda is a function of N and can go 1 2 3 4 so again let's adopt this notation of lambda n okay so after all that manipulation we can basically rewrite this differential equation here as G double dot of T plus lambda N squared G of T is equal to 0 here where lambda n is just given here by C n PI over L okay so let's go ahead and box this up because this here is our differential equation that we're interested in and it again you stare at this thing and we see linear second order homogeneous ordinate ordinary differential equation here therefore solutions directly follow from discussion of ordinary differential equation say again this is an undamped oscillator the solution of this is G of T is basically its sines and cosines here right and furthermore its sines and cosines with a frequency angular frequency of lambda and radians per second so we can basically directly solve here again if you if you don't believe me with this directly solve check out our discussion or our lecture on ordinary differential equations here I'll leave a link to that in the description so what we end up here is the solutions G of T is going to basically be a cosine lambda and T plus a sine lambda and T and again there's a coefficient last time I think we call it a and B here to keep notation consistent with the textbook that we're using for this class here this coefficient let's go ahead and call this a BN and let's call this a B n star something like that here and again maybe what we can also make a note here is that and here has to be in the integer values right so let's adopt the notation let's put a subscript n here on our solution to show that this is a family of solutions for there's a there's a function for N equals 1 N equals 2 N equals 3 etc etc here right um yeah and I think that's pretty much where we are let's go ahead and box this up here because this right is our solution to this temporal differential equation that we've got here okay so if we have the solution to the temporal differential equation we just previously found the solution to the spatial differential equation let's go ahead and use our separation of variables here and we can now multiply the two of these together to get the total solution to our original partial differential equation so let's do that right now so what I want to do is let's clear this off get a little bit of space here on the whiteboard maybe we will maybe let's leave this last one up here we'll leave the solution up okay and we end up here with okay U of X and T here right according to our how we separated these things this is just the temporal function times our sorry the spatial function times the temporal function and we saw that I think we adopted this notation of n so you know what let's the top to adopt this notation of n here again because we have integer values so let's just plug this in here so I think what we had for FN right this was just B times sine of n PI over L X here right so here's the F function times the G function which is what we've got right here so maybe let's just go ahead and write maybe some square braces here so we can keep everything straight here so this is BN cosine of lambda NT plus BN star times sine of lambda and TS there we go okay you know what makes a little easier let's go ahead and distribute this BN sine term into each one of these here so I could rewrite this thing as what do we hand up with we have B times BN cosine lambda and T actually know what I'm just doing let's let's just distribute just the B actually because I know I'll keep the sign outside plus B times B n star sine of lambda and T like this so this case so that's distributing the B in and then let's heck let's just move the sign on the other side here so this is times sine of n PI over L X right the reason I wanted to do that here is if you notice here this this B was just some constant here write BN is all another constant you multiply to the arbitrary constants together you just get another arbitrary constant same thing here so you know what I know this is probably bad form here but you know what let's let's just call this another arbitrary constant you call it a C or a D but heck to avoid introducing all these extra variables let's just call this whole thing BN I know that doesn't make a whole ton of sense but maybe from a programming standpoint for you software engineers sure this makes total sense you say B n is B times BN right so it's just another constant right same thing over here this is just some stupid constant here let's just call this BN star right I don't want to have to carry around two multiplications in two arbitrary constants it's just another number okay so um if we do all of that I think we end up with our final expression here so we have this U n here is going to be X and T U as a function of X and T is basically gonna be let's put this in brackets here this is BN cosine of lambda NT plus BN star times sine of lambda and T this whole thing multiplied by sine of n PI over L X here and in this case this lambda n right we said earlier that's C n PI over L great and what we could do now is let's box this up because here is what we've been working at here this is the solution to the original partial differential equation here our 1d wave equation here actually sorry I should not say it's the solution it is a solution here remember we said n is in the integers here right so theoretically what's going to happen with this is this is going to satisfy the original partial differential equation as well as the boundary conditions of having the left side pinned and the right side pinned here we're gonna have to deal with the initial condition here in a little bit but I think this is a real good place to take a little bit of stock here and you know what we should do is maybe let's go back and fill in some of our nomenclature over over here alright so here in step two we ended up finding here this u n of X and T right so this is a solution to the 1d wave equation right these are sometimes referred to as eigen functions eigen functions and if you notice here these things have these these these frequencies here that are multiplying the cosine T and the sine T so you can interpret these lambda ends as sort of angular frequencies here these are sometimes referred to as the eigen values here so lambda n is another thing that we should introduce here in our list of important nomenclature so we said this is just C n PI over L right okay and these are sometimes referred to as your eigen values okay and we're going to have a discussion about this a little bit later you're going to see why you would call these things I ghen values and eigen functions here so this is actually pretty awesome what we should do here is it would be great if we could get a handle of what this looks like here so first let's go back to Mathematica and double check to make sure that this actually satisfies the PDE as well as satisfying the boundary conditions here okay so let's jump over to Mathematica real fast all right so here we are in Mathematica the first thing that we should do here is let's input our expression for lambda n and for our eigenfunction u n of x and t here okay so oh I think we said lambda n this was a function obviously of n here and this was just given by C n PI over L right and then I think we said the eigen functions U and these were a function of X T and I guess I'll also end here right depending on what integer value of n and we said that all right the expression for this thing was B n cosine of lambda and T right times T sorry that's in the cosine here plus BN star sine of lambda n T sorry lambda n Cheops sorry I guess I need to correct this here right lambda n right there we go I lambda NT here okay so that was that portion here and then outside of the brackets here was a sine of n whoops n PI over L times X okay so I think that was our eigen value and eigen function here let's go shift under those and yep here we are here's our expressions here okay so the next thing that we want to verify here is let's go ahead and verify that this satisfies the 1d wave equation right so in order to do that here we need to check here that well what was a 1d wave equation it's the partial of this function right our candidate solution here our eigen function right it's the second partial of this with respect to time here all right actually you know you know we should maybe do here is is to make this a little clearer let's let's write a little text here and let's let's repeat or recall the 1d wave equation here right I think the 1d wave equation for this was partial U with respect to T squared right is equal to C squared times partial this with respect to X right so here is our 1d wave equation so all I want to do here is put that in so again here we go that is the left-hand side of the equation and I got to just make sure that this thing equals C squared times the partial of this whole thing but with respect to X instead right so let's do this okay so if we shift enter this hopefully it says true so let's try it out shift enter and whoops not quite here let me see actually you know what Mathematica might just need a little bit of persuasion let's ask it to simplify this expression in aha voila there we are yep it's true so great this eigen function the thing that we just cooked up this UN here this solves it here for any value of n here right that's awesome so next here let's go ahead and satisfy the boundary conditions here so again maybe it might help us or might behoove us to write down and remember the boundary conditions right I think we said that you at the X location here this had better equals zero this was the left corner fixed boundary condition and then finally the right corner fixed looked like this oh wait I think I spelled this wrong cor cor and yet so core nerve there we go sorry why go or not actually write a corner right I guess that doesn't make sense left side here maybe that's a better notation here okay so all I got to do here is make sure that the function that we pick here when I put in a 0 for any time and for any value of n here this better equals zero here right so this here is the check left side and then let's also check the right side here so if I put in X is equal to L for any T and for any end this should also equal 0 so shift-enter that thing and well looks like again Mathematica might need a little bit of persuasion here or simplification here and well actually we might even need some more so oh yes remember right this is not good for any value of n it's only good for integer values of n here right so what we have to do here is we have to say simplify this expression here and we have to tell it that you know what here the additional restriction on this here is that n here is in the integers right ok let's try that here and aha there now we're talking here great so we verified that our candidate eigenfunction for any integer value of n it satisfies the differential equations and it satisfies the boundary conditions you know what while we're sitting here in Mathematica here maybe what we should also do here is let's also go ahead and just quickly verify that super position holds so in other words let's make another function which I don't know let's call it you super here and let's make it a linear combination of some of these other un so for example I don't know let's let's make something up how about two times you two of X and T minus three times u I don't know three of X and T plus I don't know PI of u23 how about of X and T here right let's go ahead and make this function use super and then check to make sure that it does satisfy the original PDE as well as satisfying the boundary conditions so all right let's do that so you super of X and T here is gonna be two times u two right so that's u two minus three times u 3 plus PI of u23 okay so there's my crazy expression here and superposition claims that you know what since each one of these individual terms here was a solution a linear combination of this should also be a solution so let's go ahead and verify that it's simplifies the boundary of the original differential equation you know what I'll do here is again let's just let's just copy this whoops here right here is our check here and I'm just going to replace this with you super on both sides here and actually we have to take out this n here right because if you notice here the the way we define the you super function it's just a function of X and T here because we already picked which mode or which and we're using so let's delete the end here delete the end here great shift enter that thing and whoops that's the that's pretty complicated so Mathematica you know what simplify this whole thing and give it a little second here too well nope all right what did I do here why is it not getting this here home let's try this here this is what you super is I D X let me seek and I see what I'm doing T squared my is equal to C squared D X of T why is it still kicking out you 2000 sorry I think I wait way back I screwed up the definition of you super that supposed to be you and there we go I should have been paying more close attention to the output so here we go shift under that okay this is what you super is right it's this thing and now this should work give it a second here and come on cross our fingers yay true and it worked here okay so now let's go ahead and check our boundary conditions here so again let's copy our check here of the left and the right side and I'm just going to replace this with you super and do the same thing get rid of this end here get rid of that and here and you know what I actually don't even need this this little end in the integers thing here because we already picked integer ends here so if you notice up here you super already has there's no ends in here because we already picked an end of two three and 23 so again shift enter this thing and yay true true so this is awesome so we now have this family of eigenvalues here which is this right and a family of eigen functions this all of them solve the partial differential equation and satisfy the boundary conditions and furthermore we just showed here that any linear combination of those eigen functions and eigen values also solve this so this is actually going to lead us directly into step three here of the problem so let's jump back to the white board alright so we just showed that this eigen function here maybe let's label this here right these are roots are referred to as the eigen functions and we kind of saw why they're called eigen functions here right they're these characteristic base functions here which can make up a whole bunch of other solutions to this problem here and they have this associated eigenvalue here or frequency if you like to think about this so to get a better handle of what this function looks like let's choose some arbitrary constants for like CL and b and b and star these these values or these constants let's just pick something so we can maybe think about plotting this thing or animating in here so example let's just pick some numbers I'm just gonna pull these out of thin air here and let's see what happens if L is 3.5 and I don't know C is like 200 okay all right so also how about well tell you will pick the be in the BN in just a second here with this here with a chosen value of C and a chosen value of L you see that we can basically make a table of all the lambda values here so why don't we do that here let's go ahead and make a table here for N and then we'll look at what is the associate the Lamb to end here and you know what maybe let's put this if you look at it long enough you can see that the units of this are radians per second here right we could also go ahead and calculate the frequency of this in Hertz if you really want to it's just a factor of 2 pi here so that shouldn't be that bad and you know what let's do how about the first I don't know 3 or so so for N equals 1 to 3 you can keep going here so plugging in these numbers here you see if you just go crunch the numbers I think this comes out to something like one hundred seventy nine point five here in radians per second which is about twenty eight point six Hertz and then we see that as n goes up all you do here is you basically double this frequency here right so double this here is about three hundred fifty nine point O here radians per second which is about 8500 sorry star fifty-seven which I skipped along here this is about fifty seven point one Hertz and then finally for N equals three here it's just tripling the base frequency speed here so this is now five hundred and thirty eight point six radians per second here or eighty five point seven Hertz right and you could go et cetera et cetera et cetera for as many ends that you'd like here alright so this gives you an idea here that the frequency of these waves here right they just basically go up by integer values right they start at some base value then you double it then you triple it then you quadruple it as you start moving up how about let's take a look here at this eigen function UN you see at this point we need to choose some and some B and coefficients here so for for simplicity let's just choose B is equal R sorry BN is equal to BN star let's just make these things one for all time we're gonna see later on how we might pick these to be something intelligent here but just to get a better handle on this let's just choose values of unity so if you do that here so this u n as a function of X and T here it's basically just insert all of these values and and stick them up here right so what this guy looks like here is this thing effectively looks like a we got here we got cosine 0.5 times NT plus sine of one hundred seventy nine point five and T times on the outside sign of we can plug in values of I and L here so this comes out thing like zero point nine ish something like that and X great so you see here that this is actually a really interesting function here it's just a bunch of sines and cosines so what we could also do here is we could start thinking about making a table or plotting this thing so we could pick the N equals one here and and basically all you do is you would get this expression with N equals one and you would get a function here which is just a function of X and T so let's just do this for one just so we can get a feel for this so so the u 1 of X and T u right this would just be everywhere you see n put in a 1 so this is really startled right it's just cosine of one hundred seventy nine point five T plus the sine of one hundred seventy nine point five T times sine of zero point nine X right so what we can start thinking about doing here is maybe animating this function here and then we could change n we could say you two of X and teeth here right that's just this exact same thing but you see anywhere you see an N stick in a two and you would get something similar but it would be a little bit different it would be at a higher frequency right there'll be at the second frequency and it would a little bit different here right because this would also change so at this point I'm going to encourage you to actually go out and watch our lecture here on our videos on how to animate things in MATLAB and Matt in and Mathematica here so right now let's just put a quick break here and go see slash view the videos on I think what we titled them creating movies and animations in MATLAB and in Mathematica okay so I've got two videos here that will talk about how to take a function here and make some kind of animation out of that so tell you what why don't we pause here for a second I'll give you a chance to go and watch those videos and then let's jump over to Mathematica and try to animate these things so we get a better feel for what do these eigenfunctions look like for N equals one N equals 2 N equals 3 etc etc okay all right so let's come back to that same Mathematica notebook we were working on here and let's look at a numerical example and in particular here we'd like to animate the scenario so I'll assume that you've taken this opportunity to go and watch those animation videos here so let's go ahead and implement this so first of all let's go and give us these input the given values of L and C so I'll call it make two variables called L given and C given and based on that I could go ahead and take our iDEN function right and let's just replace everywhere we see an L plug in the L given and everyone we see everywhere see the C let's go ahead and give it C given and we have make a couple other replacements I think that'd be n right we said let's replace out with the one and a be n star let's just replace that with the one as well all right so at that point let's shift enter this and we see here's our function here as a function of n T and X so what I'd like to do here is think about um plotting this or animating this for N equals 1 n equals two N equals three here and I would like to see how does this function change with with maybe time here so let's go ahead and do that right now so I'll start a little section of text here and we'll say let's go ahead and ant whoops sorry there should be a text and I made the scenario okay so first of all let's try to go ahead and build up this plot here so what I could do here is I could say plot how about you and given here of X and T and let's maybe plot the first one you won here right and let's make this plot run from x goes from zero to how about L given right so we'll go the entire length of the string here and yeah let's go and shift enter this and we're gonna see this is gonna give us not a lot of stuff here actually it's gonna it's gonna choke here right because it has no clue what T is so maybe let's look at this at time T equals zero okay so if I plot that here um well actually wait a second what happened oh sorry why did I call this you and given oh I forgot to plug it up here so you and given here as a function of X T and n there we go let's try that now okay there we go let's enter this thing as our given value of the eigenfunction with all of the given parameters plugged in here and now i can go ahead and try to enter this thing and um here we go at time equals zero it looks like just this sine wave here and actually what what looks interesting here is yes the left side is fixed and the right side is fixed here at zero so this looks this looks great here um what I might want to do though here is let's change this as time goes on so I would like to actually manipulate time here so let's go ahead and wrap this whole thing in a manipulate command right and we are going to manipulate this with T running from 0 to some maximum time here I don't know maybe let's let's define this as a parameter up here how about let's just say point oh four seconds here so 0 to T max here okay and let's shift enter this thing and here we are now what we've got here is a little animation here that I should be able to go ahead and oh well say okay here's the problem here Mathematica is trying to automatically scroll the AXYZ here so looks like it's gonna take a little bit of screwing around here with this plot command so let's let's do that right now here in the plot side here let's go and make whoops sorry comma and let's go ahead and make some plotting options here we'll define some options here namely I would like the plot range let's specify this window here so let's go from the x-values going from 0 to the length of the string here right and let's make the Y values go from I don't know how about minus 1.5 to 1.5 and we'll make it hold there so it doesn't move around so let's try that shift enter that there we go this looks a little bit better there we go so now we can see this thing moving around and there we go so this is actually kind of interesting right if I open this control and hit play this looks pretty reasonable here right so this looks like an oscillating string here and you know what this solution to this PDE seems again very physically realizable in fact if you recall back to our demonstration here of these standing waves this is effectively the first mode here right where you have two nodes one on the the fixed left side one on the fixed right side this is great you know what let's go ahead and look at the N equals two mode okay so if I shift enter this whole thing aha look at this now we have the N equals two mode and if I play this we see again you remember our demonstration with the standing waves here and this is effectively the N equals two mode and it's going on at twice as fast here right so this is really really fun um in fact instead of me manually changing this here from one to three let's go ahead and and why don't we simultaneously manipulate um T and n let's go from n from 1 to 5 here and we actually have to use integer values here right we saw that n can't be some kind of numeric or decimal value so if I do this I get this little double manipulation scheme so let's go ahead and hit play on the time and we can see here's the first mode this looks all very fine and dandy and then as we crank this slider up let's go look at the second mode here it is and you can it's oscillating at twice the frequency here let's go for the N equals three hey and again this is beautiful because it isn't this awesome the math is exactly predicting the physical phenomena we saw here when we were doing our standing wave demonstration in fact this is the highest mode that we could actually achieve in practice in reality because I just couldn't oscillate this thing faster but if we if I could let's go look at the N equals four look at that as you can probably expect here you get another note here you get this standing wave that's going even faster and finally the N equals five this all looks great right so very very very exciting what we've got going on right here right all of these eigenfunctions we see demonstrate and describe each one of these modes of vibration of the string here and since we showed that superposition worked we can actually take all of these modes and add them together as linear combinations here that's exactly what we're gonna do next here in step 3 where we're gonna apply some Fourier analysis to try to choose how much of each mode is going to contribute to the final solution for an arbitrary deflection here okay so great let's pause this and head back to the whiteboard to do that very very cool step three here okay I hope you're getting excited like I am because we are really cooking now so the last thing we got to do now now that we've got all the eigenfunctions and the eigenvalues or those base modes here that satisfy the boundary conditions is let's apply step three and satisfy the initial conditions of this problem as well here so now we are on to step three here and this is basically the solution to the entire problem and we are going to do this via Fourier analysis okay so um alright let's take stock of what we just discovered here right we said that alright we've got this family of eigenfunctions u n of X and T here right and we just showed that superposition holds for this so you know what a linear combination of all of these functions will also be a solution so you know what let's just sum this thing from how about N equals 1 a - you don't potentially infinite all of these things right and let's call this the total solution of the problem here right now if we were to write this out a little bit let's go ahead and maybe expand this one more time here right we saw these eigenfunctions take this format of BN cosine lambda NT plus BN star sine of lambda and T all of this here is now multiplied by sine of n PI over L X right so here's what we're doing here's our candidate total solution here let's see what do these BN and BN star values need to be in order to satisfy our initial conditions so let's take a look at applying that right now so let's just figure out how are we going to satisfy our initial condition here first let's look at the initial position here remember what we said earlier at the beginning of the problem statement is we said that all right this string here is gonna have some deflection initially at time 0 here this is going to look like some function that's given the f of X maybe it's a triangle or a weird shape who knows what the initial condition or the initial position of the string is here but what we can do now is you know what let's go ahead here and plug into our candidate solution here time equals 0 right because that's what we're looking for so everywhere we're gonna plug in where t equals 0 and you know what this is great because a lot of this stuff is going to go away here like so for example this entire term is gonna go away this I think is just gonna turn to a big one here so you know what we end up with here is we end up with the left hand side of this here is going to be what it's going to be summation from N equals one to infinity of this entire thing but yeah like I said plug in N equals 1 everywhere so what we end up here this is just going to be BN times I think sine of n PI over L X here right this has to equal f of X right so if you look at this long enough think about what this is say here what we're trying to do right now here the goal at this point here is to find these coefficients be n such that the left hand side equals the right hand side right in other words look at what we're trying to say here what this expression is saying here is I want to take a whole bunch of sine waves here right with varying amplitudes here and I want to sum up an infinite number of these sine waves at different frequencies right you see the end changes here right and I want to add all those sine waves up and somehow make it match some arbitrary function f of X again this could be a triangle square wave what whatever this is something arbitrary right this should be setting off lots of warnings in your head and what not warning warning says the wrong thing it should be setting off ringing a lot of bells you've had this is basically what Fourier analysis is going to do for you right Fourier a Fourier series that's going to allow you to compute how much of each sine wave goes into an infinite trigonometric series here so that you can make all of these sine waves add up to a an arbitrary function f here okay so um I think deriving although that's that Fourier expression is a little bit outside of the scope of the current lecture here I hope to have a video soon talking about Fourier analysis so we can see where we get this this result but for the meantime what I'm gonna do here is let's just go ahead and say you know what if you would like to see that derivation here what we can do is you can notice here that if you have a function with period L in other words and X goes from zero to L which is exactly what we have in this scenario here you can expand this function as a odd function and you obtain a half rate expression as shown by this so I'm just going to make a quick note here you have a the functional period L we are going to now expand as an odd function here and the Associated half range expression here is given by f of X here is equal to summation from and equals 1 to infinity of some coefficient let's call little BN sine of n PI over L X here here where this little BN I'm just gonna write all this down and then we're going to talk about what it is and where it came from here so these B ends is going from 0 to L here of f of X sine of n PI over L X DX here for N equals 1 to yadda-yadda-yadda here so again the concept is is pretty simple here it's from Fourier analysis here but again it's outside the scope I think we're you're gonna bog down for 20 minutes if we try to actually derive this this is basically from if you would like the reference here and you want to look this up and convince yourself that this is true here this is basically from advanced engineering mathematics the 10th edition this is by kracie so if you go look that up here this is actually this is equation 5 star star in section 11 point 2 here and this expression down here is basically equation 6 star star in section 11 point 2 here this is the discussion of Fourier analysis so again in Fourier analysis what Christ Inc was doing here is basically saying alright you have some function any function here over a period of 0 to L here and what you're going to do here is you're going to expand this as an odd function and meaning that you're going to assume that it kind of looks like it's mirror image on the on the other side so you have this periodic function which just repeats with period of minus L to L here and what you're gonna do here is for eh discovered that you know what you can do is you can recreate this function using a boatload of sine waves here all you have to do is change the coefficient B and and you have to choose this coefficient little B n in a very specific way and here's the way you calculate that little specific that coefficient for each value right you take the function here this is your crazy arbitrary function here you just multiply by sine of n PI over L X and you perform this integral here right so again check out this section here in christlike if you really want to see the derivation or like I said hopefully we'll have a discussion here on Fourier analysis coming up here that will outline this in a future video but for now let's just take this on faith that this is true here right if you go ahead and Trust what fourier did and i would he's a really smart guy here or was a really smart guy right this is basically saying you can recreate this this arbitrary function f using an infinite sum of these sine waves here now what we want to do here is you know what compare this with what we have over here right if you'll look these are basically the same thing right this is absolutely perfect they look like absolutely identical so the coefficients that we're looking to calculate here these Big B ends that is exactly what Fourier is getting for us right here in this little BN so this is exactly how we're going to go about computing this so what we can do here is let's just write this down here so what we end up with here is here this BN right the way we compute each one of these it's just 2 over L integral 0 to L f of X sine of n PI over L X DX here for n in the integers all right so this is great let's box this thing up here we go this is how we're going to calculate these coefficients Big B and for every single one of our initial conditions so you just take the initial deflection of the string here you multiply it by sine n PI over L X and you perform this integral and you do it for N equals 1/2 three for whatever term you're looking for and basically we've got it right great this is this is awesome so we can now figure out how to calculate these coefficients that will satisfy the initial condition in position let's do the exact same thing for the initial condition in velocity so again maybe let's go ahead and erase all of this okay and erase this side and let's do a similar operation for velocity right so maybe I'll leave all this up here I can get that out okay so again what we now want to look at here is satisfying the initial condition in velocity right so in a similar fashion what do we say with the initial condition of velocity we said that the we want the velocity of this string here evaluate it at time zero right so here's the initial velocity of the string here this better equal whatever the prescribed velocity distribution function is here right okay so left hand side all I got to do here is take a derivative of U which is this giant thing here right it's this infinite series I'm going to take its derivative with respect to time so you see that we're gonna end up with what this lambda ends gonna pop out I think we're gonna District Attorney well minus sign again the land ends gonna pop out this is gonna turn into a cosine here um so anyway let's write this down the left-hand side here is going to basically be let's see let's let's let's take the derivative first here maybe let's do that so let me write this first in a big bracket here so this is going to be sum from N equals one to infinity here of we're gonna end up with a negative big BN lambda n sine of lambda and T all right plus BN star times lambda n cosine of lambda and T there we go okay and I think this is maybe all in brackets here right because that was this internal derivative here oh all right and then we end up with multiplied by the sine of n PI over L X here right and then this entire thing here right is evaluated at time equals to 0 right and again this better equal G of X right okay lucky for us again this time equals zero is going to knock out a lot of these terms here so what we end up with here at the end of the day here is this is going to be sum from N equals 1 to infinity of BN star times lambda n sine of lambda and T or sorry sorry sorry no no no no no no not not the limit in this is BN star lambda and sine of n PI over L X this has got to equal G of X okay here we go all right so again maybe let's go ahead and maybe temporarily box this up here because this is what we end up with here okay so here's our proposed solution here it's derivative at time equals 0 looks just like this and we said again this looks like we're taking a whole bunch of coefficients except now the coefficient is sort of this this amalgamation of BN star and lambda n here but again it's just a coefficient of a bunch of sine waves here and we're just trying to sum all of these sine waves up and make them equal this arbitrary function G of X so again this is the exact same situation we ran into here we just unfortunately erased it here so let's go ahead and remember here that what was that that that was equation 5 star star and equation 6 star star right which was talking about you have an arbitrary function of period L here and you're going to go ahead and expand it as a odd function so you know what tell you what let's repeat it here just for convenience so that we can go ahead and compare here so again these equations here from crisis here were okay you have some arbitrary function G of X here and you can make this out of a whole bunch of sine and cosine waves by looking at a fish and little B n times sine of n PI over L X here for n in the integer values here and the way you compute these coefficients B little B was you go 2 over L integral from 0 to L here of G of X sine of n PI over L X DX cell yeah right okay great so if we again maybe let's box this portion up here and compare this with this here right we see that again G of X this is our initial velocity distribution in both cases here and we see that you know what everything is very similar so you know why don't I set this infinite series equal to this infinite series here so where am I gonna have enough room to do that tell you what I know I know people hate what I do this but I think this is the easiest way that we're gonna save ourselves space here right so let's set G of X let's just put this initial can this infinite series right here okay so this is now summation from N equals 1 to infinity of little BN sine of n PI over LX yep there we are and now if you look at this right this sign matches with this sign here so really these little coefficients B in which we are going to compute in this fashion here they're actually not beyond star it's the product of BN star times lambda n so just to make that very clear let's go ahead and gosh you're running out of room here let's let's knock this part out okay so what we end up with here is that little B ends are actually what it's B n star times lambda n here so again we're looking for this value of BN star we already know what the eigenfunctions are here and we know how to compute little BN it's via this equation 6 star star right it's that integral so again let's isolate BN star so this is actually pretty darn simple so BN star it's just going to be BN over lambda n here and if you recall what was lambda n here right lambda n I think we said was this combination of C and PI over L right it was just these eigenvalues of our function right okay so finally I think we're here yeah this is basically it so let's just maybe to make it complete let's rewrite what was BN here right so this little BN was 2 over L integral from 0 to L of G of X sine of n PI over L X DX so here is our expression for how to compute these coefficients BN star here right so the first thing you do here is okay you are given the velocity profile G of X here right if you are given this just go ahead and run this integral here that is going to give you little BN star and all you need to do is scale this by lambda n which was given by here C and PI over L all right so um yeah you know what maybe to make that easier let's let's rewrite this with all these substitutions and maybe maybe that should have been the thing we boxed up here so again let's write this down here so BN star right if you make all of those substitutions here this is going to end up looking like 2 over C n pi integral from 0 to L G of X sine of n PI over L X DX here for n in the integers ok sorry maybe this might have been the even more consolidated consistent expression for B n star here ok all right so this is awesome we basically now have a way to compute both the BN coefficients as well in the B as well as the BN star coefficients and theoretically I guess if you carry this out to infinity here it should satisfy the initial conditions of this problem both in terms of the initial position and as well as the initial velocity so tell you what let's take look at an example of how this is going to work so all a racist so we can get a little bit of space here to draw what we're doing here so what I want to take a look at here is a example scenario where we have a string here that is just plucked in the middle here let's leave let's leave our expression up here right so here we go so example let's look at a triangular initial deflection okay so what I mean by that let's consider an initial condition here of the initial distribution of this string it's a piecewise function here where the first part here is a 2q over L X here if X is in the range of 0 to L over 2 and then otherwise you have this other function let's call it f 2 which is 2q over L times L minus X if X is in the range of L over 2 to L okay so here's our initial position here and just to sketch what this looks like all this is saying here is you have here's f of X here versus X here ok so the string is L units long here but right here in the middle here what we see here is when X is equal to L over 2 this is just equal to Q so what this looks like here is just an initial it's this triangular deflection here so it's literally like you had a guitar string and the player picked right in the middle pulled it up a distance of Q units and now what we want to do is let it go and actually we should say they're going to pick it up here and they're going to hold it there and let everything come to steady state so let's go ahead and pick an initial velocity distribution of just zero here right so this area is again you pick up the guitar string you hold it here at static you let it rest here then you hit start on the stopwatch you let the thing go and I want to see how this thing is gonna vibrate here all right okay so let's go ahead and do that here so we see that you know what here's how we're gonna solve it here's the expression here for my total so Oshin the only thing we have to figure out right is what are these BN and these BN stars right I'm going to assume that we have the we have the the distance L we have all of the other conditions here let's see here did I actually specify here in the notes a particular value here looking here for the C oh you know what I think we're using the exact same constants we were using earlier here so for this for this example here let's let's go ahead and pick numerical values for L C and anything else that we need here so I think all we need here is let's go ahead and write down a list of given constants okay so L here is going to be a 3.5 like we did earlier and the C value for this particular PDE is again gonna be 200 so this should be the exact same value as we used earlier let's see if there's anything else that we need to get here I think that's enough to get us started here okay so great let's go ahead and do that right now so what we need to do is now that we've got this deflection here is we need to go ahead and calculate BN and BN star here right so all right let's go ahead and do that now so BN right remember from our discussion earlier this is just 2 over L integral from 0 to L of f of X sine of n PI over L X DX here ok great let's go ahead and break this integral up to go from the first half and then the second half so in other words I'm going to compute this as 2 over L and then I'm going to put this and start from 0 to L over 2 and then this is now going to be f of X sine of n PI over L X DX right plus now let's go from L over 2 to L of again f of X sine of n PI over L X DX and bracket here so yep I think that's pretty good here and again what's nice about this is over the range from zero to L over to here right the function takes on this specific value in other words this is f1 right similarly in this range from L over 2 to L the function takes on value L f2 so we could jam in these value of the expressions of 2q over L into here so in other words I'm gonna plug in this is 2q over LX right there and the expression for F 2 here is the other one right it's 2q over L L minus X right and as you can see at this point it's just a it's just an integral that you're gonna have to compute here so this is a little bit onerous here I don't think I want to do this on the board so we can run to mathematic and you know what we're we're on we're on a roll and I think we're just getting excited I don't want to break the momentum here and stop and go to Mathematica here so tell you what why don't you just take me at my word here that if you were to go ahead and perform this integral in Mathematica what you would end up with here is an expression here of BN is you get this kind of very interesting thing here so it's 32 Q cosine of n PI over 4 times the sine of n PI over 4 cubed all over n squared pi squared great so box this up this here is how we're gonna calculate the coefficients BN here okay great now let's do the other one let's get BN star here right so remember BN star we said that was given by Poor's our expression for this maybe I just want to make sure we write this down right this was something like 2 over C n pi integral of 0 to L of G of X sine of n PI over L X DX right and what's great about this is if you remember here our initial velocity distribution is just a bunch of zeros here right so integral of zeroes you get another big fat bunch of zeroes so this is actually really easy so be n star is actually just zero for all in great so here we go we got BN we got BN stars we basically have completely defined this entire function here right so um I think what we can do now is let's jump over to Mathematica here and see if we can plot this and we'll actually no I tell you what before we do that maybe let's make a table of what this thing looks like for different n values just to get a better feel for this okay so maybe you'll again let's let's erase all this stuff okay and we'll just leave our expression for BN here at the bottom okay so let's go ahead and make a table here of n we can now have BN be and star and then yeah that's actually pretty good here I guess what we could do is we could also then write UN of X and T if we really wanted to hear but that might be a little owner's tell you it let's just take a look at this so so for N equals one right just plug in N equals one to this expression here and what you end up with for VN is this is just going to be 8l over PI squared BN stars we said that's a big fat 0 here so the associated eigen function for N equals 1 here it's just going to be well it's gonna be what 8l over pi squared cosine of lambda 1t this thing right times sine of n PI over L X and oh sorry and as one in this case right great okay what's interesting here is about N equals two here this actually is going to evaluate to 0 interestingly yeah because I think if this is a Y anyway I'll let you figure it out but if you figure this out you plug all this in you get a big 0 here this is 0 here so this one is is 0 okay now if you go n equals three here we end up here with this is minus 8l all over nine PI squared be n star is zero here so again this eigen function associated with this frequency here of lambda three here is going to look like what it's minus eight L over nine pi squared cosine of lambda three T times sine of what is this where do it oh yes sorry times sine of three PI over L X right and you can keep doing this etc etc etc here right so theoretically the complete solution is I got to carry this out to infinity here all right I got to carry out all of these terms in order to actually match it but that's probably pretty impractical here so how about let's just go ahead and take a look at a partial sum so in other words I'm going to define let's call this use a big n of X and T here and this is just going to be this exact same sum we talked about here from N equals one but instead of going to infinity let's stop at some finite capital n numbers here now I'm just gonna go ahead and sum sum up all of the eigenfunctions as as we talked about earlier but not going all the way up to infinity here so the u3 term right that's going to be u 1 of X T Plus u 2 of X T plus u 3 of X T here right and we already have these here's u 1 so you basically need to plug this in here here's you two it's a big 0 here but you could plug it in here and finally here is u 3 plug that in here right if you wanted to get the the partial sum which is this expression only taking three terms here so now what I really want to do the last thing before closing this out here is let's go to Mathematica and plot some of these partial sums and see how do they look and compare to this initial triangular deflection that we're trying to all right so we're back at that same Mathematica notebook maybe what we should do right now here is let's go ahead and just print the values of C and L to ensure we have them entered into Mathematica so I think we were looking at I think we call this thing C given and L given here yep okay so those are the proper values here okay so now what we can do here is let's go ahead and define the coefficients BN right the thing that we just went ahead and solved on the board here so if you remember that was let's call it a very well how about BN how about let's call it computed here and it should be a function of n as well as the amount of deflection Q here so I think this was was it a 32 Q cosine of n PI over 4 right times sine of n PI over 4 cubed here and this whole thing was over N squared pi squared right okay so that's our expression for the BN now what we want to start doing is integrating this into our eigenfunctions so you know what let's check to make sure those are still defined so check that UN is still defined properly so I think we said UN was a function of X T and the integer N and yep here we are so we now know what all the B ends are we want to replace them with the computed values of BN and all of these BN stars for our situation were a whole bunch of zeros here right so at this point we can go ahead and define our partial sum of the total solution um with only how about let's call it how about n max terms right because obviously we're not gonna go up to infinity let's end at some upper limit here so uh how about n max let's start off with something very simple let's just start off with one term here all right so what we want to do here is we want to whoops sorry well oh no hold on what happened wanna get some white space here okay so some let's sum all of our eigenfunctions XT and here and what we want to do here is let's now make the replacement here that BN goes to BN computed of N and I guess we need a Q given we need to pick some Q value so maybe we should do that up here so Q given how about of 2.5 that's how many units of deflection we have on the string here so let's go ahead and replace BN with this value here and obviously Q will now be replaced with 2.5 and also we said we better make sure that BN star gets replaced with 0 okay so there's the saw the eigen function for a term N and let's sum this from N equals 1 all the way up to n max okay so I think that should work here let's shift enter this oh I see yep we still have C and L we want to get all these numerical values entered so let's go ahead and make another replacement here that C gets replaced with C given and L gets replaced with L given okay all right there we go so this is now our partial sum let's call this a new function how about you capital n for our partial sum and we see that it is now a function of X and T only all right there we go so again n can go from 1 and equals 2 is not gonna be any different we saw that from the table earlier that that should be yep we just end up with a numerical 0 here but N equals 3 here's what we end up with so we're going up in odd numbers and 5 right we can pick any number of terms here so again let's start with a simple case of N 1 here okay so this is the first why guess it's actually the first mode here as well as just the first partial sum so now let's go ahead and visualize this so in other words what I'd like to do here is let's plot how about you n X and T and let's make this run from X going from 0 to L given right and again if I shift under this it's not gonna have any idea because it's obviously a function of X and T so I don't let's choose this at time equals zero and if I shift enter this we see that you know what this is actually halfway reasonable I think we said that it was supposed to be a triangular deflection with oh here it is with the the tip pulled up to 2.5 here so it's it's not not a hundred percent awesome here but it's it's in the realm of reasonableness maybe what we should do here's looks um let's switch the plotting options here let's also go ahead and set the range of this thing to be something static here so let's make X run from 0 to L given and we'll make Y run from I don't know how about minus three to three okay there we go okay so this is what it looks like at time equals zero we can look at this and make a small time in the future 0.01 okay and there goes and mows a little bit further down and you know what this is actually a good spot to instead of just manually inputting the time changes let's do like we did earlier and animate this so I'll put in a variable T here and I'll wrap this whole thing in a manipulate and we'll manipulate the whole thing from T running from zero to I think we have a variable actually earlier yeah called T Max here okay so there we go let's shift enter this and now what we should have is this nice scenario which is going to animate this function here over the length 0 to L in X and now time is going to run between 0 and T max I can't remember whatever T max is you know well let's open this slider and hit play and then we can see so here we go and again this is really exciting this looks well kind of reasonable it sort of looks like a triangular deflection obviously it's not very good because we have one term here so the best we can do is a single sine wave but you know what let's pause this and come back up and let's increase this so instead of one term let's get three terms in our partial sum so I'll just re-enter this we see the sine wave gets or the the partial sum gets a little bit more complicated with a few more sine waves but again if we come back here and shift enter this look at this this is starting to look a little bit more like that triangular deflection with the tip here at 2.5 and again let's let this guy rip and you know you can kind of see this is looking really reasonable at this point here let's crank this up even further I don't know how about let's go up to I don't know 15 terms here so shift enter this and we'll manipulate and visualize this and now look at this this is looking awesome guys this really looks like an initial triangular deflection of the wave and if I let this go whoa look at that this is pretty sweet isn't it so I hope you're as excited as I am because if you think about what we've done right now is we have developed a technique here to analytically solve the one dimensional wave equation here for any initial condition in both position and velocity so it doesn't have to be something simple like a triangular string it could be something much more complicated here and we would have a way to find the solution via separation of variables and then the subsequent Fourier analysis so with that I think this is a good spot to end this video if you liked it here please subscribe to the channel because we will be having other videos talking about things like the heat equation as well as extending this 1d wave equation to 2-dimensional and circular membranes here in a little bit so with that being said I hope to catch you at a future video bye
Info
Channel: Christopher Lum
Views: 28,944
Rating: 4.9795222 out of 5
Keywords: 1D wave equation solution, wave equation solution, solving the 1D wave equation, solve 1D wave equation, partial differential equation, wave equation PDE, separation of variables method, product method, eigenvalues of PDE, eigenfunctions of PDE, Fourier analysis for PDEs
Id: lMRnTd8yLeY
Channel Id: undefined
Length: 118min 22sec (7102 seconds)
Published: Tue Nov 13 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.