Differential Equations: Using Laplace Transform to Solve ODEs with Discontinuous Inputs
Using Laplace Transform to Solve ODEs with Discontinuous Inputs
Today we are going to do a last serious topic on the Laplace transform, the last topic for which I don't have to make frequent and profuse apologies. One of the things the Laplace transform does very well and one of the reasons why people like it, engineers like it, is that it handles functions with jump discontinuities very nicely. Now, the OR function with a jump discontinuity is-- Purple. Is a function called the unit step function.
I will draw a graph of it. Even the graph is controversial, but everyone is agreed that it zero here and one there. What people are not agreed upon is its value at zero. And some people make it zero, some people make it one, and some equivocate like me. I will leave it undefined. It is u(t). It is called the unit step. Because that is what it is. And let's say we will leave u(0) undefined.
If that makes you unhappy, get over it. Of course, we don't always want the jump to be at zero. Sometimes we will want to jump in another place. If I want the function to jump, let's say at the point a instead of jumping at zero, I am going to start doing what everybody does. You put in the vertical lines, even though I have no meaning, whatever, but it makes the graph look more connected and a little easier to read. So that function I will call (u)a is the function which jumps at the point a. How shall I give its definition?
Well, you can see it is just the translation by a of the unit step function. So that is the way to write it, u(t - a). Now I am not done. There is a unit box function, which we will draw in general terms like this. It gets to a, then it jumps up to one, falls down again at b and continues onto zero. This happens between a and b. And the value to which it arises is one. I will call this the unit box.
It is a function of t, a very simple one but an important one. And what would be the formula for the unit box function? Well, in general, almost all of these functions, as you will see when you use jump discontinuity, the idea is to write them all cleverly using nothing but u(t). Because it is that will have the Laplace transformer. The way to write this is (u)ab . And, if you like, you can treat this as the definition of it. Let's make it a definition. Okay, three lines. Or, better yet, a colon and two lines. I am defining this to be, what would it be?
Make the unit step at a step up at a, but then I would continue at one all the time. I should, therefore, step down at b. Now, the way you step down is just by taking the negative of the unit step function. I step down at b by subtracting (u)b (t). In other words, it is u(t - a) - u(t - b). And now I have expressed it entirely in terms of the unit step function. That will be convenient when I want take the Laplace transform. What is so good about these things? Well, these functions, when you use them in multiplications, they transform other functions in a nice way. Not transform. That is not the right word. They operate on them. They turn them into other strange creatures, and it might be these strange creatures that you are interested in.
Let me just draw you a picture. That will be good enough. Suppose we have some function like that, f(t), what would the function (u)ab, I will put in the variable, t times f(t), what function would that be? I am just going to draw its graph. What would its graph be? Well, in between a and b this function u(ab) (t) = 1. All I am doing is multiplying f(t) * 1. In short, I am not doing anything to it at all. Outside of that interval, (u)ab has the value zero, so that 0 * f(t) = 0. And, therefore, outside of this it is zero. The effect of multiplying an arbitrary function by this unit box function is, you wipe away all of its graph except the part between a and b.
Now, that is a very useful thing to be able to do. Well, that is enough of that. Now, let's get into the main topic. That is just preliminary. I will be using these functions all during the period, but the real topic is the following. Let's calculate the Laplace transform of the unit step function. Well, this is no very big deal. It is the Integral from 0 to infinity of [e^(-st) y(t)] dt. But, look, when t > 0, this has the value one. So it is the same of the Laplace transform of one. In other words, it is 1 / s for positive values of s.
Or, to make it very clear, the Laplace transform of one is exactly the same thing. As you see, the Laplace transform really is not interested in what happens when t < 0 because that is not part of the domain of integration, the interval of integration. That is fine. They both have Laplace transform of 1 / s. What is the big deal? The big deal is, what is the inverse Laplace transform L^(-1) (1 / s)? Will the real function please stand up? Which of these two should I pick? Up to now in the course we have been picking one just because I never made a fuss over it and one was good enough.
For today one is no longer going to be good enough. And we have to first investigate the thing in a slightly more theoretical way because this problem, I have illustrated it on the L^(-1) 1/x, but it occurs for any inverse Laplace transform. Suppose I have, in other words, that a function f of t has as its Laplace transform capital F(s)? And now, I ask what the inverse L^(-1) F(s) is. Well, of course you want to write f(t). But the same thing happens. I will draw you a picture. Suppose, in other words, that here is our function f of t. Well, one answer certainly is f of t. That is okay. That is the answer we have been using up until now.
But, you see, I can complete this function in many other ways. Suppose I haven't told you what it was for s less than zero. Any of these possibilities all will produce the same Laplace transform. In fact, I can even make it this. That is okay. Each of these, f(t) with any one of these tails, all have the same Laplace transform. Because the Laplace transform, remember the definition, Integral from 0 to infinity of [e^(-st) f(t) dt] because the Laplace transform does not care what the function was doing for negative values of t. Now, if we have to have a unique answer --
And most of the time you don't because, in general, the Laplace transform is only used for problems for future time. That is the way the engineers and physicists and other people who use it habitually think of it. If your problem is starting now and going on into the future and you don't have to know anything about the past, that is a Laplace transform problem. If you also have to know about the past, then it is a Fourier transform problem.
That is beyond the scope of this course, you will never hear that word again, but that is the difference. We are starting at time zero and going forward. All right. It does not care what f of t was doing for negative values of t. And that gives us a problem when we try to make the Laplace transform unique. Now, how will I make it unique? Well, there is a simple way of doing it. Let's agree that wherever it makes a difference, and most of the time it doesn't, but today it will, whenever it makes a difference we will declare, we will by brute force make our function zero for negative values of t. That makes it unique. I am going to say that to make it unique, now, how do I make f(t) = 0 for negative values of t? The answer is multiply it by the unit step function.
That leaves it what it was. It multiplies it by one for positive values but multiplies it by zero for negative values. The answer is going to be u(t) f(t). That will be the function that will look just that way that I drew, but I will draw it once more. It is the function that looks like this. And when I do this, it makes the inverse Laplace transform unique. Out of all the possible tails I might have put on f(t), it picks the least interesting one, the tail zero.
That is a start. But what we have to do now is -- What I want is a formula. What we are going to need is, as you see right even in the beginning, if for example, if I want to calculate the Laplace transform of this, what I would like to have is a nice Laplace transform for the translate. If you translate a function, how does that effect this Laplace transform? In other words, the formula I am looking for is --
I want to express the L(f(t - a)). In other words, the function translated, let's say a is positive, so I translate it to the right along the t axis by the distance a. I want a formula for this in terms of the Laplace transform of the function I started with. Now, my first task is to convince you that, though this would be very useful and interesting, there cannot possibly be such a formula. There is no such formula.
Why not? Well, I think I will explain it over there since there is a little piece of board I did not use. Waste not want not. Why can't there be such a formula? What is it we are looking for? Let's take a nice average function f(t). It has a Laplace transform. And now I am going to translate it. Let's say this is the point negative a. And so the corresponding point positive a will be around here. I am going to translate it to the right by a. What is it going to look like? Well, then it is going to start here and is going to look like this dashy thing. That is f(t - a). That is not too bad a picture. It will do. I just took that curve and shoved it to the right by a.
Now, why is it impossible to express the Laplace transform of the dashed line in terms of the Laplace transform of the solid line? The answer is this piece. I will write it this way. The trouble is, this piece is not used for the Laplace transform of f(t). Why isn't it used? Well, because it occurs to the left of the vertical axis. It occurs for negative values of t. And the L(f(t)) simply does not care what f(t) was doing to the left of that line, for negative values of t. It does not enter into the integral.
It was not used when I calculated this piece of the curve. It was not used when I calculated the L(f(t)). On the other hand, it is going to be needed. It occurs here, after I shift it to the right. It is going to be needed for the L(f(t - a)), because I will have to start the integration here, and I will have to know what that is.
In other words, when I took the Laplace transform, I automatically lost all information about the function for negative values of t. If I am later going to want some of that information for calculating this, I won't have it and, therefore, there cannot be a formula expressing one in terms of the other. Now, of course, that cannot be the answer, otherwise I would not have raised your expectations merely to dash them. I don't want to do that, of course. There is a formula, of course. It is just, I want to emphasize that you must write it my way because, if you write it any other way, you are going to get into the deepest trouble. The formula is-- the good formula, the right formula --
-- accepts the given. It says look, we have lost that pink part of it. Therefore, I can never recover that. Therefore, I won't ask for it. The translation formula I will ask for is not one for the L(f(t - a)), but rather for the Laplace transform of this thing where I have wiped away that pink part from the translated function. In other words, the function I am talking about now is the formula for, I will put it over here to show you the function what we are talking about. It is the function f of, well, in terms of the pink function it is, I will have to reproduce some of that picture. There is f(t). f(t - a), then, looked like this.
And so the function I am looking for is, this is the thing translated, but when I get down to the corresponding, this is the point that corresponds to that one, I wipe it away and just go with zero after that. So this is u(t - a) f(t - a). What is this Laplace transform? Now that does have a simple answer. The answer is it is e^(-as), a funny exponential, times the Laplace transform of the original function. Now, this formula occurs in two forms. This one is not too bad looking.
The trouble is, when you want to solve differential equations you are going to be extremely puzzled because the function that you will have to take to do the calculation on will not be given to you in the form f(t - a). It will look sin(t) or t^2 or some polynomial in t. It will not be written as t - a. What do you do? If your function does not look like that but instead, in terms of symbols looks like this, you can still use the formula.
Just a trivial change of variable means that you can write it instead. Now, this is one place, there is no way of writing the answer in terms of capital F(s). This is one of those cases where this notation is just no good anymore. I am going to have to write it using the L notation. The Laplace transform of f(t + a). Basically, this is the same formula as that one. But I will have to stand on my head for one minute to try to convince you of it. I won't do that now. I would like you just to take a look at the formula. You should know what it is called. There are a certain number of idiots who call this the exponential shift formula because on the right side you multiply by an exponential, and that corresponds to shifting the function.
Unfortunately, we have preempted that. We are not going to call it this. I will call it what your book calls it. The difficulty is there is no universal designation for this formula, important as it is. However, your book calls this t-axis translation formula. Translation because I am translating on the t-axis. And that is what I do to the function, essentially. And this tells me what its new Laplace transform is.
The other formula, remember it? The exponential shift formula, the shift or the translation occurs on the s-axis. In other words, the formula said that F(s - a), you do the translation in s variable corresponded to multiplying this by e^(at). In other words, the formulas are sort of dual to each other. This guy translates on the left side and multiplies by the exponential on the right. The formula that you know translates on the right and multiplies by the exponential on the left. What are we going to calculate? I am trying to calculate, so I am trying to prove this first formula. The second one will be an easy consequence. I am trying to calculate the Laplace transform of that thing. What is it?
Well, it is the Integral from 0 to infinity of [e^(-st) u(t - a) f(t - a) dt]. That is the formula for it. But I am trying to express it in terms of the Laplace transform of f itself. Now, it is trying to be the L(f). The problem is that here, a t - a occurs, which I don't like.
I would like that to be just a t. Now, in order not to confuse you, and this is what confused everybody, I will set t1 = t - a. I will change the variable. This is called changing the variable in a definite integral. How do you change the variable in a definite integral? You do it. Well, let's leave the limits for the moment. e^(-s) times -- Now, t, remember you can change the variable forwards, direct substitution, but now I have to use the inverse substitution. It's trivial, but t = t1 + a. To change this I must substitute backwards and make that t1 + a. How about the rest of it? Well, this becomes u(t1). This is f(t1). I have to change the dt, too, but that's no problem. dt1 = dt because a is a constant.
That is dt1. And the last step is to put in the limits. Now, when t = 0, t1 = -a. So this has to be negative a when t is infinity. Infinity minus a is still infinity, so that is still infinity. In other words, this changes to that. These two things, whatever they are, they have the same value. All I have done is changed the variable. Make it change a variable. But now, of course, I want to make this look better. How am I going to do that? Well, first multiply out the exponential and then you get a factor e^(-s t1). That is good. That goes with this guy. Now I get a factor e^(-sa) from the exponential law. But that does not have anything to do with the integral. It is a constant as far as the integral is concerned because it doesn't involve t1. And, therefore, I can pull it outside of the integral sign.
And write that e^(-sa). Let's write it the other way. Times the integral of what? Well, e^(-st1). Now, u(t1) f(t1) dt1. Still integrated from -a --> infinity. And now the final step. This u(t1) is zero for negative values of t. And, therefore, it is equal to one for positive values of t. It is equal to zero for negative values of t, which means I can forget about the part of the integral that goes from -a --> 0. I better rewrite this. Okay, leave that.
In other words, this is equal to e^(-as) times the integral from zero to infinity of e^(-s) -- Let me do the shifty part now. And this is since u(t1) = 0 for t1 < 0. That is why I can replace this with zero. Because from negative a to zero, nothing is happening. The integrand is zero. And why can I get rid of it after that? Well, because it is one after that. And what is this thing? This is the Laplace transform. No, it is not the Laplace transform they said. Because you had t1 there, not t. It is the Laplace transform because this is a dummy variable.
The t1 is integrated out. It is a dummy variable. It doesn't matter what you call it. It is still the Laplace transform if I make that wiggly t or t* or tau or u. I can call it anything I want and it is still the L(f(t)). What is the answer? That is e^(-as) L(f). That is what I promised you in that formula. Now, how about the other formula? Well, let's look at that quickly. That is, as I say, just sleight of hand. But since that is the formula you will be using at least half the time you better learn it. This little sleight of hand is also reproduced in one page of notes that I give you, but maybe you will find it easy to understand if I talk it out loud.
The problem now is for the second formula. I am going to have to recopy out the first one in order to make the argument in a form in which you will understand it, I hope. This goes to e^(-as) F(s), except I am now going to write that not in F(s); since I will not be able to write the second formula using F of s, I am not going to write the first formula that way either. I will write it as the L(f(t)).
Now, formally if somebody says, okay, how do I calculate the Laplace transform of this thing? I say put down this. Well, that has no t in it. It doesn't have the f in it either. Then write this. What formula did I do? I looked at that and changed t - a --> t. Now, how did I change t - a? The way to say it is I changed t. Because the t is always there. t --> t + a. You get this by replace t by t plus a to get the right-hand side.
I replace this t by t plus a, and that turns this into f(t). And that is the f(t) that went in there. That is the universal rule for doing it. Now I am going to use that same rule for transforming u(t - a) f(t). See, the problem is now I have a function like t^2 or sin(t), which is not written in terms of t minus a. And I don't know what to do with it. The answer is, by brute force, write it in terms of t - a. What is brute force? Brute force is the following. I am going to put a t - a there if it kills me. t - a + a.
No harm in that, is there? Now there is a t minus a there, just the way there was up there. And now what is the rule? I am just going to follow my nose. What's sauce for the goose is sauce for the gander. Minus as, Laplace transform of f of, now what am I going to write here? Wherever I see a t, I am going to change it from t plus a. Here I see a t. I will change that to t + a. What do I have? t + a - a + a, well, if you can keep count, what does that make? It makes t + a in the end.
The peace that passeth understanding. Let's do some examples and suddenly you will breathe a sigh of relief that this all is doable anyway. Let's calculate something. I hope I am not covering up any crucial, yes I am. I am covering up the u of t's, but you know that by now. Let's see. What should we calculate first? What I just covered up. Let's calculate the L((u)ab (t)). What is that going to be? Well, first of all, write out what it is in terms of the unit step function.
Remember that formula? There. Now you see it. Now you don't. Its Laplace transform is going to be what? Well, the L(t - a), that is a special case here where this function is one. Well, that one. Either one. It makes no difference. It is simply going to be the Laplace transform of what f(t) would have been, which is -- See, the L(u(t)) is what? That's one over s, right? Because this is the function one, and we don't care the fact that it is zero or negative values of t. That is my f(s). And so I multiply it by e^(-as) 1 / s. I am using this formula, e to the minus as times the Laplace transform of the unit step function, which is 1 / s. How about the translation?
That was taken care of by the exponential factor. And it's minus because this is minus. The same thing with the b. This is the Laplace transform of the unit box function. It looks a little hairy. You will learn to work with it, don't worry about it. How about the Laplace transform of -- Okay. Let's use the other formula. What would be the L(u(t - 1) t^2), for example? See, if I gave this to you and you only had the first formula, you would say, hey, but there is no t minus one in there. There is only t^2. What am I supposed to do? Well, some of you might dig way back into high school and say every polynomial can be written in powers of t - 1, that is what I will do.
That would give the right answer. But in case you had forgotten how to do that, you don't have to know because you could use the other formula instead, which, by the way, is the way you do it. What are we going to do? It goes into e^(-s). The a is one in this case, plus one. e to the minus s times the Laplace transform of what function? Change t --> t + 1. The L((t + 1)^2). What is that? That is e^(-s) L(t^2 + 2t + 1). What's that? Well, by the formulas which I am not bothering to write on the board anymore because you know them, it is e^(-s) times --
L(t^2) = 2! / s^3. Remember you always have to raise the exponent by one. This is two factorial, but that is the same as two. Plus two. This two comes from there. L(t) = 1 / s^2. And, finally, the L(1) = 1 / 2. You mean all that mess from this simple-looking function? This function is not so simple. What is its graph? What is it we are calculating the Laplace transform of? Well, it is the function t^2. But multiplying it by that factor u(t - 1) means that the only part of it I am using is this part, because u(t - 1) = 1 when t is bigger than one.
But when t is less than one it is zero. That function doesn't look all that simple to me. And that is why its Laplace transform has three terms in it with this exponential factor. Well, it is a discontinuous function. And it gets discontinuous at a very peculiar spot. You have to expect that. Where in this does it tell you it becomes discontinuous at one? It is because this is e^(-1*s).
This tells you where the discontinuity occurs. The rest of it is just stuff you have to take because it is the function t^2. It's what it is. All right. I think most of you are going to encounter the worst troubles when you try to calculate inverse Laplace transforms, so let me try to explain how that is done. I will give you a simple example first. And then I will try to give you a slightly more complicated one. But even the simple one won't make your head ache.
We are going to calculate the L(1 + e^(-pi s) / (s^2 + 1)). All right. Now, the first thing you must do is as soon as you see exponential factors in there like that you know that these functions, the answer is going to be a discontinuous function. And you have got to separate out the different pieces of it that go with the different exponentials. Because the way the formula works, it has to be used differently for each value of a.
Now, in this case, there is only one value of a that occurs. Negative pi. But it does mean that we are going to have to begin by separating out the thing into 1 / (s^2 + 1) and this other factor e^(-pi s) / (s^2 + 1). Now all I have to do is take the inverse Laplace transform of each piece. The L^(-1) 1 / (s^2 + 1) is --
Well, up to now we have been saying its sin(t), right? If you say it is sine t you are going to get into trouble. How come? We didn't get into trouble before. Yes, but that was because there were no exponentials in the expression. When there are exponentials you have to be more careful. Make the inverse transform unique. Make it not sine t, but u(t) sin(t). You will see why in just a moment. If this weren't there then sine t would be perfectly okay. With that factor there, you have got to put in the u(t), otherwise you won't be able to get the formula to work right. In other words, I must use this particular one that I picked out to make it unique at the beginning of the period. Otherwise, it just won't work.
Now, I know that is fine. But now what is L^(-1) e^(-pi)? In other words, it is the same function, except I am now multiplying it by e^(-pi s). Well, now I will use that formula. My f(s) = 1 / (s^2 + 1), and that corresponds it to sin(t). If I multiply it by e^(-pi s), just copy it down.
It now corresponds, the inverse Laplace transform, to what the left side says it does. u(t - pi) times, in other words, this corresponds to that. Then if I multiply it by e^(-pi s), it corresponds to change t --> t - pi. What is the answer? The answer is you sum these two pieces. The first piece is u(t) sin(t). The second piece is u(t) - pi sin(t - pi).
Now, if you leave the answer in that form it is technically correct, but you are going to lose a lot of credit. You have to transform it to make it look good. You have to make it intelligible. You are not allowed to leave it in that form. What could we do to it? Well, you see, this part of it is interesting whenever t is positive. This part of it is only interesting when t is greater than or equal to pi because this is zero. Before that this is zero. What you have to do is make cases. Let's call the answer f(t). The function has to be presented in what is called the cases format. That is what it is called when you type in tech, which I think a certain number of you can do anyway.
You have to make cases. The first case is what happened between zero and pi? Well, between zero and pi, only this term is operational. The other one is zero because of that factor. Therefore, between zero and pi the function looks like, now, I don't have to put in the u(t) because that is equal to one. It is equal to sin(t) between zero and pi. What is it equal to bigger than pi? Well, the first factor, the first term still obtains, so I have to include that. But now I have to add the second one. Well, what is the second term? I don't include the t - pi, u(t - pi) anymore because that is now one. That has the value one. It is sin(t - pi). But what is sine of t minus pi?
You take the sine curve and you translate it to the right by pi. So what happens to it? It turns into this curve. In other words, it turns into the curve, what curve is that? Minus sine t. The other factor, this factor is one and this becomes negative -sin(t). And so the final answer is f(t) = sin(t) between zero and pi and zero for t greater than or equal to pi.
That is the right form of the answer.