[Music] okay so let us continue our discussion on uh the response due to arbitrary loading and if you recall we have already uh derived the expression for what we call daml integral now today we are going to solve this numerically EV see how we can Implement in mat lab but before that let us quickly go through the uh theory that we have derived just brush up the expressions and what we mean by this integral so we have this s do system and then it is excited by some arbitrary forcing function and we know the stiffness damping mass and the degrees of freedom is X of T and forcing function is f of T now if you recall we developed the argument is that we have arbitrary forcing function and then so at time Point say to we consider a differential element so obviously at this location so this is our D to at a distance to obviously the forcing function is f to D to and that we multiply at this point what we do we actually put our h of T at this point it will be T minus to so this is the impulse response function so we multiply this by h t minus t and then integrate this from 0 to T what we get is basically the response at time point so that's the expression we have derived and what is the expression for impulse response function h of T is 1 by M Omega d e to the power minus EA Omega n t sin Omega DT so that's the expression now ft the forcing function is arbitrary and for this forcing function we have to numerically evaluate this uh response so that's the objective for today's discussion now for that what we have to do we have to find out the expression of this daml integral so uh for that what we do uh we put this expression for impulse response function in the original doal integral and see how does it look like and what we can simplify further to evaluate it so what we have here is 0 to T then in place of H T minus to what we have we have 1 by m Omega d e to the powerus EA Omega N T minus to sin Omega D time T minus to and this multiplied by F to D to now if that is the case then we can simplify this expression so if we open this e ^ minus th Omega n t * e to the power EA Omega n to and then it is multiplied by we can open this so we have sin Omega DT time cos Omega D to minus cos Omega DT time sin Omega D whole multiplied by the forcing function f to D to so we can simplify this because just note small T is the limit so we can take this expression out of the integral so what we'll do 1 by m Omega d e to the power minus EA Omega n t then we have sin Omega d t time integral 0 to t e to the power e Omega n to cos Omega D to times F to D to then minus we have cost of Omega d t time integral 0 to t e to power e Omega n to time sin Omega D to multiplied by F to D to now obviously this is uh an integral you can see we have a arit forcing function we cannot solve it in close form so we have to go for uh any um numerical scheme available for U evaluating this integral we will use trapezoidal rule you can also adopt Simpson 1/3 rule or any other approach to evaluate this integral so we'll use trapezoidal rule in a minute so what we can do we can write this expression damal integral as 1 by m Omega d e the^ minus E Omega n t within bracket s of Omega d t * say this part I just mark it as a minus cos Omega DT times say beta so what is the expression for is 0 to t e to the power e Omega n to cos Omega d to times F to D to similarly we also know what is Betto it is integral 0 to T e to the power EA Omega n to sin Omega D to F to D to so that's the simplified expression for daml integral so for every T if we set then uh we can evaluate this a to and B to numerically once we do that we can find out the expression for X of T so that's precisely what we are going to do uh in matlb and that will also help you to see how we can write matlb code particularly for the beginners so let us start matlb coding for this Doom integral so let us uh write a function file so we have function that will return the response X of T then this is uh equal to the function name we call it daml integration and then for that we have to give the input arguments so we have to Def find the mass then stiffness and then critical damping ratio and then we have to give the excitations that means we have to define the forcing function f of T we write it fcor t here for every T so these are the input arguments we have to solve the do integral and for that let us first evaluate the natural frequency as you know it is square root of K by m so that's the natural frequency and once we evaluate the natural frequency we can also evaluate the damped natural frequency so we have omega n star Square < TK of 1 - Theta s so that's the damped natural frequency we evaluate now um we have to uh solve the daml integral and for that uh let us first identify how many data points we have in time because we have to run a loop and for every uh time point we have to calculate the integral so for that let us first check how many time points so what we do we Define this NT that is the number of time point and uh length of T it returns basically the number of time point we have so once we have it then let us initiate izee the displacement at the output so initialize with zeros and then um we have to run a for Loop so for so we run the for loop from second time point so II starts from 2 it goes up to the number of time point we have the reason is because at the initial Point obviously it will start from um zero so uh that's the reason we start from the second point and then uh for that then now what we do uh we start the loop for daml integral so what we have to do so t uh we start from t0 so if you recall the integral is from 0 to to right sorry 0 to T So t 0 that is 0 point so it starts with the first value and then it goes up to say t star so that is as we progress in the loop we keep on changing this T star value so this is up to the Limit we perform the doal integral now uh we have to Define TOA so for that we Define tow so it starts from so we can Define the other way so we consider T from one to the iterative indicator in this case it is I so we go up to one to I so tow starts from first point it goes up to the this indicator II I do not use I simply because um complex number is also defined by I so avoid that now for this tow we also have to find out what is f tow that again we Define as ft we start from the first point go up to the limit which is II now once we have it we have the expression that I showed you let me share that also because uh then it will be easier for you to uh follow so we have the expression here you can see um so we have integral if you look at integral we have e to power e Omega n * cos Omega D time F and that we have to integrate between 0 to T and in this case we are using trapezoidal rule so we first Define this function e to^ Omega n to cos Omega D time F once we Define that function we call it say fub1 and the next integral you have e to the^ Omega n sin Omega D * F we call it F2 so let us Define these two functions and then we'll see how we can numerically integrate this using trapezoidal rule so what we have is exponential of EA Omega n to and then times we have cos Omega d Tow Times we have F to so that's the first function fub1 similarly we Define FS2 we have exponential EA star Omega n star to then s Omega d and then time to then we have to multiply this by F to okay so now we are ready we have to evaluate even if we consider the expression so what we have is a 0 to T to the power Omega n cos Omega d f d so we have to use trapezoidal rule to evaluate this expression so let us uh do that so atau will be equal to we have to use trapezoidal rule so trap Zed is the common and for that we have to define the X and Y in this case X is Tow and Y is F1 so that's at similarly we can also Define what is bow now what we have here is again to and then instead of F1 we have to call F2 so we have evaluated a to and B and then finally we have to evaluate the damal integral and for that that's the solution so X of t at II point will be 1 by m Omega D times we have to multiply that with exponential if you recall it is minus EA Omega n t star point up to which we integrate right and then uh that will be multiplied by a function um s Omega d t it is T star which is multiplied by a to then minus cos Omega d t star times Beto so that's the solution we have using daml integral so that's the function file so for every time point this II will change and accordingly this T star will also change and then we will integrate this function um over this complete range so let us save it and then again we have to write a function that calls so so we Define mass equal to say 10 unit stiffness equal to say 100 unit EA is equal to say 5% critical damping ratio so it is 05 and then uh we have to apply the forcing function so for that uh let us Define a forcing function so we Define t t is equal to say Z to 20 we Define the time point it starts from zero goes up to 20 and with an increment of 01 second so that's the time and then F of T we Define s say 5 T we can also apply some amplitude say 1.5 time sine of 5T so that's the forcing function it is not arbitrary so I will show you an arbitrary for forcing function also in a minute but for the time being so let us Define and consider this uh forcing function f of T is given so we assume that we don't know this expression although we generate the forcing function using this expression so F of to sorry F of T we have to now pass it to solve this doal integral so for that let us copy this so if you look at the argument we have defined M we have defined K we have defined ETA then T and then F of T right then once we get it let us plot the function so let us first plot the forcing function and then we also plot the response and then let us run this function we give it a name we give the name as called daml and then run it so what you can see is we have the forcing function which again I repeat we consider it as a arbitrary forcing function because it is defined in terms of different time points the magnitude of the forcing function is known although it comes from a sinusal function and then uh using this function we use daml integral to find out the response and then in this uh right screen you can see the response due to D integral now what you can see here is the moment it starts there is a disturbance initially and then finally as time progresses it actually converges to a solution so if we uh solve it for a bigger time window say let us put it 100 and then uh see what happens and you can clearly see the impact so uh we have the input as a sinusal function and then using that if we solve initially we can see the transient spot and then as time progresses because we have a damping given by ITA in this case it is 5% critical damping ratio and then as time progresses you can see the initial transient part dies out and we are left with only the steady state part which is also sinusal because we have a linear system and that we excite by a sinusal input this is what we actually learned when we derived the close form solution so you can also verify that and uh see how this doal integral works now we will consider a um arbitrary forcing function so for that uh we have uh forcing function which is El Central so let me call this function and for that what we have here we actually load that L Center function it's exactly the same file so what we have uh introduced here is these three lines you can see so what is this um input file uh it is the L Central earthquake ground motion so that I will show you in a minute how does it look like so for this earthquake we measured the acceleration and that acceleration data for different time points we have in this file and we'll read that file and there we'll have no close form expressions and that acceleration will first convert into uh the force that we apply over the structure in fact as we progress in this course we'll derive the equation of motion for this type of problem but for the time being uh you can see the second line so T that reads the First Column from the L Centro file so that is the time against which we record the ground acceleration which is in the second column now once we have these two from this L Centro file and then what we do uh we Define again the system and then uh we Define the forcing function in the this case it is minus M * the ground acceleration for the timing let us um consider this expression we will derive this expression as we progress now then what we do we call the doal integral the same um file function file and then once we get the solution we plot it first we plot the El Central ground motion and then the response that we get from the doal integral so let us quickly run this and see what we get and as you can see here on your screen we have the solution ready so the first subplot shows the L Central ground acceleration you can see this is the type of acceleration we often record when we Face an earthquake ground motion so that's the arbitrary forcing function and for that no close form uh expression is available so we cannot solve uh straight away and then we apply the daml integral and the moment we apply the daml integral we have the solution due to this L Central ground motion now as we progress in this course we'll actually verify this uh uh doal integral whether this solution is correct or not but for that we have to go through the theory so let me first derive the equation of motion for this type of uh problem where we have a asop system with support motion and then uh I will come back to this solution again what we get today from daml integral and then we'll compare and we'll see whether the result we get from the daml integral is correct or not for that what we'll do we'll use some inbuilt function inbuilt option in matlb that we can um consider for a uh the solution of this uh type of arbitrary forcing function and then we'll compare with this result so with that let us uh close today's discussion the takeaway point today is that how to implement the daml integral uh numerically and find out the response for any arbitrary forcing functions so we'll continue on this topic further thank you very much [Music]