0:00

So welcome back. today, I would like to investigate a

Â particular hybrid system that has to do with a bouncing ball.

Â So, that is, I take a ball and I drop it on a surface and I would first of all,

Â like to model it. And secondly, like to figure out how the

Â ball behaves. And the reason why I want to do this is

Â not necessarily because I really like balls but because this bouncing ball

Â example holds the key to another little peculiarity of hybrid systems that we

Â should be aware of. So, here is the set up.

Â I have a ball. It's h above the ground.

Â Now, what happens in between the bounces? Well, Newton tells me that force is mass

Â times acceleration and, and the acceleration is, in fact, -g, where g is

Â the gravitational constant. So, if I let x1=h and x2 be equal to h

Â dot, which is what we always do, then what I get is that x dot is this

Â thing, 0100 x, which is just the point mass, plus this gravitational force

Â that's pulling it down. Now, let's say that the thing that I'm

Â interested in also is, where the ball actually is, how high, how high up it is,

Â so y is going to be 01 x. So, that is my model of the ball.

Â What happens at the bounces? Well, you could try to model ball deformations and

Â whatnot, but that seems rather complicated so what we're simply going to

Â say is that these are what's called inelastic bouncers which mean, which

Â means that a little bit of energies sucked out of the ball every time it

Â bounces. And in fact, what we're going to say is

Â that velocity, this is the velocity, so if the ball is coming down here [SOUND]

Â hits the ground then the velocity instantaneously flips, it means, that's

Â why we have a minus sign there because the ball instantaneously flips but we're

Â also scaling it with this gamma constant, so we're making the velocity change

Â direction from downwards to upwards, but a little bit less, which means we lost

Â some energy in the bounce. Well, the position doesn't change in the

Â bounce, so this means that my reset condition is going to be this.

Â This is just encoding this fact that I'm flipping a little bit, I'm flipping my

Â velocity, and I'm loosing a little bit of energy at the time of the bounce.

Â Alright, so lets see what this bouncing ball hybrid automaton might look like.

Â Well, x dot is Ax+b, in this case, not Bu and b is 0-g so this is this forcing term

Â that is gravity, no big deal. Now, what's going to happen is I'm going

Â to switch from that mode to itself when I'm bouncing.

Â And we already saw that the reset condition is this inelastic bounce

Â condition that says that we're losing a little bit of the velocity at the time of

Â the bounce. So, that's the reset condition.

Â Now, the guard condition is what? Well, clearly, we're bouncing when we're

Â hitting the ground. So, we would like the height to be less

Â than or equal to 0, right? Well, let's see what happens.

Â Here comes the ball [SOUND] hits the ground, now the height is 0, we're

Â switching and now the first thing we do is we reverse the velocity but, meaning,

Â we're switching. But hey, wait a second, the height is

Â still less than or equal to 0. The height is still 0.

Â So, what we're going to do is we're just going to end up spinning like crazy if we

Â have this guard. So, this is not a good guard.

Â Let's get rid of it. Instead, what we need to do is we're,

Â we're going to switch when we come down to the ground and the velocity is

Â pointing downwards. Meaning that h needs to be negative or

Â less than or equal 0. And h dot has to be less than or equal 0,

Â meaning, we're facing downwards. Or since h and h dot constitute our

Â state, then the guard should really simply be that x is less than or equal to

Â 0. That's the guard condition.

Â Well, it could be it's just a, the height is just 0, but this is really the

Â condition that tells us that it's time to, to switch. Okay, good.

Â So now, we have that. Is this any good?

Â Well, I mean clearly, it's good. It's pretty and we have guards and

Â resets. But does it model, first of all,

Â faithfully what balls do when they bounce? And secondly, are there reasons

Â why a model like this would cause us to be a little bit nervous? To answer that,

Â we need to figure out what the ball is actually doing if we have this model.

Â So, first of all, we have this system again now.

Â What I would like to know is what is the output of this system.

Â Well, fast forward, sorry, not forward, reverse two weeks and we go back to

Â linear time-invariant systems. We know what the solution to this system

Â is. We know that the output is C times this

Â bad boy here, that we call the state transition matrix, which was fancy speak

Â for this matrix exponential times the initial condition plus C times this

Â rather awkward-looking integral there. Now, all of these is, is, is not

Â particularly pleasant. And I remember vividly how we struggled

Â to get through this because there were so many integrals to keep track of here.

Â Now, in this particular case, we're a little bit lucky because this A matrix is

Â what's called nilpotent because if I take A to the power two, or three, or any high

Â there, higher exponential here, then I get 0 out.

Â And that turns out to be quite wonderful for us.

Â Why is that? Well, remember, that e^At is really this infinite sum.

Â A, there should be a parentheses here, I apologize.

Â 0 At to the power of k divided by k!. Well, in our case, all the higher order

Â A's are equal to 0, so I get first k=0, which gives me the identity matrix.

Â Then I get k=1, which simply gives me A times t.

Â And then, I have all the others which are equal to 0.

Â So, e^At, in this case, is simply this matrix.

Â Here is the part that comes from the adjacent matrix and since A is simply

Â that times t, I get the t up here. So, this is my e^At or my state

Â transition matrix. So now, I should be able to plug this

Â back into the equation for y and get a rather nice looking expression.

Â So, let's do that. Well, here is C.

Â Here is the state transition matrix. Here's my initial condition.

Â Here's this rather awkward-looking differential equation sorry, integral.

Â now, we can try to solve that. and if we do that, instead of actually

Â doing the math, I did the math,

Â I encourage you to go home and do that. I'm just going to write down what the

Â solution is. It's going to be h0 times the initial

Â velocity, h dot 0 of t-t0 and that's then minus g/2

Â t-t0 squared. So, this is what the output looks like in

Â between bounces. Good.

Â Now, that we have that, let's figure out how long it takes in between bounces.

Â So, let's say that we start at zero o clock, at height zero.

Â This is when the bounce is about to start and then, [SOUND] we want to know how

Â long this, this took. We want to know how long it took us to

Â get back the ground. Well, that's simple.

Â Let's pick a big time, big T and say, well, y at that time t has to be equal to

Â 0. Well, then we plug that in.

Â h0=0 not so we don't any turn there we just get h dot 0 times T minus this

Â thing. or another way of writing it is like

Â this. And you know what, this needs to be equal

Â to 0 because h is 0 there and h is 0 there,

Â which is why we have two solutions. So, one solution corresponds to T=0,

Â which is at the beginning of the bounce. And the other solution is when we return

Â down. So, this is how long it took me to go

Â from the ground, up into the air, and then back down to the ground.

Â This is the time in between bounces. Let's compute the accumulated bounce

Â times, just because we find it amusing.

Â Well, the velocity at the beginning, so at the first time, let's just say that

Â the velocity is v, right? So then, the time of the first

Â bounce, instead of h dot 0, I just plug in v there.

Â I get 2v/g, that's the time of the first bounce.

Â Well, the velocity after the first bounce,

Â well, the reset condition says that I have gamma times v, so okay, I have a new

Â v here. That's what I'm going to plug into my h

Â dot 0 here that immediately tells me that the time of the second bounce is, well,

Â it's the time of the first bounce plus the time it took for the second bounce

Â and instead of v, I have v divided by gamma there.

Â So, that's how long it took me to perform two bounces, and so forth.

Â This tells me that the time of the nth bounce is given by this 2v/g which is

Â this term that shows up over and over again.

Â And then, every bounce gets this gamma to the power of k accumulated.

Â Now, this is what's called a geometric series.

Â And if you look that up or you happen to know it, if gamma is less than one, which

Â means that you're not adding energy at the bounce times,

Â this thing will actually, okay, and we have gamma less than one,

Â this will actually converge in the sense that when n goes to infinity, this thing

Â becomes equal to this expression. Well now, maybe some of you are asking,

Â so what? [LAUGH] Well, you shouldn't be asking so what.

Â Well, what's going on there? This is the time it takes to perform infinitely many

Â bounces, infinitely many bounces, and this is less

Â than infinity. What that means is this bouncing ball is

Â going to go [SOUND] infinitely many. And there is some time t infinity here

Â where this system is just going to grind to a halt and our model is just going to

Â keep computing bounce after bounce after bounce after bounce faster and faster and

Â faster. And this is actually a serious problem

Â that causes our system to actually crash. So, the ball bounces in infinite numbers

Â of times in finite time. And like I said, this is not just a

Â mathematical curiosity that shows that we can compute geometric series.

Â It means that if I'm simulating it, then my simulation would crash.

Â In fact, I encourage you to write this exact model into your favorite simulator

Â and watch it crash. This also means that if I write down my

Â hybrid system like this, then it's undefined beyond T infinity because it's

Â not clear what's happening beyond there. Time is not allowed to go to infinity.

Â So, stability, which says what happens when T goes to infinity [SOUND] you can't

Â even ask that question because t doesn't go to infinity.

Â what's worse obviously is that real balls don't do this, real balls bounce and

Â after awhile they lay still, right? So, this is also an indication that our

Â model is not particularly good. And, in fact, this type of phenomenon

Â where you have infinitely many switches in finite time is known as the Zeno

Â Phenomenon, after the philosopher Zeno, that had the a tortoise race, a hare.

Â And the paradox that Zeno came up with was the fact that the hare never managed

Â to overtake the tortoise. And in the next lecture, we will see,

Â first of all, why the tortoise is able to beat the hare and what to do about it,

Â meaning how do you make the rabbit overtake the turtle? Well, that, my

Â friends, is the topic of the next lecture.

Â