 Last time we did in class problem number three, so let's see, so I put a bunch of other problems that should be more or less familiar with the setup. Also you should realize that most of these problems, or some of these problems, I mean definitely the computer to do anything, right? So is there a reasonable task that you solve this? My hand? And even on a time constraint? Probably not, right? I mean think about you having just even find the equilibrium of the system. My hand, I mean it will be impossible, right? Because you have this weird denominator, so you have to solve a system of nonlinear equations that is very nonlinear, right? More nonlinear than the ones we talked about when you didn't have this denominator, right? So we did talk about, I think this was a plus and a minus term, right? So such a problem is definitely like a take home, something that I would assign for a take home part. But the problems that involve this optimal control theory, you can expect to be asked for at least setting it up. So going through the finding the, I mean writing down the Hamiltonian, writing down the Atrian system, maximizing or optimizing the Hamiltonian with respect to the control variable. So you may not have to do everything like put the dots on all the I's, say this is my x, this is my u, this is my j, but for instance as you've seen in examples we've done, for certain problems you can very easily get for instance u, right? So there are various kind of situations that one can imagine like this is a Newton's law of cooling, right? In which you control the room temperature for instance. So u is the sense of the room temperature, right? So it's a one variable state, one state variable, right? And you have an objective to minimize or maximize the temperature of an object in that room while minimizing the total terminology spent, something like that, okay? Notice you have some controls, this may or may not mean what? That it will be a bank-bank control, right? It depends on how the Hamiltonian looks like. If the Hamiltonian is linear then it will reach its maximum at one of the two endpoints, right? Yeah, probably a few days or actually I think until Monday, next following Monday or something, yeah. Okay, so I'm not gonna, I'll let you go through kind of digest this problem a little bit better, but I'm just kind of talking, oops. I guess I didn't tell you what g is here, huh? Okay, so we'll fix that. I think you get the same thing, right? It should be the same thing. All right, so it's your choice, your pick. So notice some of these problems are, I mean like this particular problem is a discrete dynamical system and let's say things like, what am I asking here? What is this problem asking? Finding steady states. Okay, so somebody has to give you a g. I'll probably give you a g. I don't know why it disappeared. Okay, so find the steady states, find the equilibrium of the steady states, right? Using the eigenvalue method. And, you know, there are things that one should do, you know, maybe I should label what can be, I mean in a way it's kind of your job to figure out what can be done by hand and what can be done by the computer, what has to be done with the computer. So for instance, when you have to graph something, right? Talk about what cobwebic means, but if you were to graph the dynamics of the system, right? I mean you can do that by hand, right? So you'd have to maybe make a table or something, so, okay? Then there is, you can have actually harvesting in a discrete system too. Okay, so you can have some, okay, now I'm sorry. You can have a constant proportional to the fish population, right? And I'm sorry, yeah, so this is not really a control. This is just kind of a, we always harvest at a certain fixed effort. The question is what happens with the dynamical system in this situation, right? Again, assuming you know what G is. It's, yeah, I added two more problems. They're a little bit more complicated, so. Anyway, I'm hoping that I can give you solutions to some of this over the break, so. Bottom line is, you know, I think this problem talks about, well, let me go down to the last one. They are not in the, oh yeah, the continuous case. So this is probably more familiar to you now, if you look at this problem. So you have a savings account that accrues interest and you can, you can reinvest it. So what is the problem? What is it saying? So variable fraction of the interest can be reinvested in the savings account. So bottom line is that this equation describes the x, the dynamics of x, which is the amount of money in the savings account, okay? Okay, so for us, it's just a dynamical system. Again, one variable, right? And the control appears in the right-hand side, right? It's a multiplicative, right? The problem is to maximize, what is it to maximize? I think the total amount of money accumulated, which is written by this integral, okay? So again, if you just ignore everything and just say, here's a dynamical system. Here's what you need to maximize. Do we have a constraint on U? Yeah, U is between zero and one because it's a percentage, right? I think the total amount of money, I think the sum, I believe. For the checking account, yeah, checking account. People that have business degrees or economics degrees will really focus on the first part. What I wanted to focus is on these two parts, okay? Let's say I don't tell you anything about anything. I'm just saying, here's, I'm just saying, this dynamical system, x prime equals RUX, okay? Maximize this integral with these constraints, okay? So again, that's what I wanted you to focus on. I mean, of course, this comes from this whole setup, and by the way, the previous problem is actually, you know, because you never really compound interest continuously, right? At least practically, right? So you compound it with some frequency, right? Daily, monthly, whatever, right? So this problem is actually the discrete version of this one, okay? So I would say focus on this one for the maximum principle, of course. But if you look at the previous one, then you will see how those integrals, how those terms show up and why. For instance, why this amount of money that is present in the savings account, the savings account, the time t grows at this rate, okay? It's because you take the limit of the discrete problem as the frequency of compounding the interest goes to infinity, right? That's what it means to compound it continuously. Okay, but again, for us, it's just this setup here, so. And it can go on and on. I just kind of gave you a few that, where again, the focus is on, once you have a dynamical system, right, written out. So hopefully, you identify the state variables, right? In this case, in this last problem, there are two state variables, right? I and S, and the control is this variable P, right? If you want to change it to U, that's fine. But I think P stands for rate of production in a certain manufacturing problem. Actually, it's an inventory control problem. So I is a level of inventory at time t, so how much things are in your warehouse, right? S is the number of sales, the rate of sales at time t. So that's what rate are things kind of moving out of that warehouse, and P is the rate of production. So you control the rate of production, and what could be objective? Minimize inventory or minimize the cost for keeping things in the warehouse. In this case, actually, it's the cost, the total cost is, so there's a component that is the cost of producing stuff, and then the cost of storing stuff, okay? So it should be exciting because you see so many different scenarios, and again, you're not going to be actually asked to derive this, okay? So you should expect to be given the underlying dynamical system. It should be given, you know, it should be told this is the control, right? It should be told these are the range or the constraints on the control, okay? So any questions on this? I'm going to go back to some of the examples we had in the handout. Any questions about this? On the first one that you went over. This one? Better to pray. Uh-huh. Define what our parameters and our variables are in the initial setup. Well, the initial setup is almost given here, you know. Initial setup would be to derive these things. Okay, so that wouldn't be in, some of that wouldn't be in the exam. We'd have to derive it. Yeah, if it's not given to you then, if it's just like a standard prayer to pray, then I say logistic growth and standard competition or something. It's like in your homework, you just have to put it together. But here it's a non-standard way of interacting between the prayer and the pray, okay? Could you say that in words? I guess, but you saw that sometimes it's actually even hard to interpret the problem. So get this model, okay? So you're going to be given this and just kind of do the rest. Yeah. May. It may. Or may not. Yeah. But the thing is on the in-class part, it's again, for this kind of problem, one should know. You need to set up, well, not for this problem, but for these other problems, right? So I would say up to what point in it, I want it to do it by hand. It may be that you have to find optimal control by hand or something. But the only way is typically solving the out-joint system is, if it's easy enough, then you can do it by hand. If it's not, then it's, well, there are still a few tools to actually solve a linear system and combine everything together, right? So we'll talk about this more today. But there are certain parts of the problem that are more difficult than others, right? So the best preparation for you, I mean, just from a psychological point of view, is that you should know that these parts that can be done, they can be done by hand, right? These parts are not, it's not that it's hard to do it by hand. It's unreasonable to do it by hand, right? So, you know, that kind of the training that hopefully you get in this class is that you know how much of a balance between, you know, setting up on paper and asking the computer to do it should be. So I still didn't get too many exciting phases here. So in these examples that I, these four examples that I kind of refer to all the time, although, for instance, we didn't solve this one. The ferry problem, we didn't solve it explicitly. But if you were to follow the formulation of this, and again, this is that oversimplified thing where only the angle theta is the one that's being controlled. When you look at things, I don't know why the address system is listed first. Typically, you need the Hamiltonian, right? And then get the address system, okay? So why the Hamiltonian s is a constant, theta is the control, right? Psi 1, psi 2, okay, why do I have two p-sides? Because I have two x1 and x2, right? So it's two variables, right? And then you see when you, when you try to find, there's no constraint, I believe, on the angle theta, right? You can go around, you can spin around as much as you want. So you just set it equal to zero and find the theta, which is the arc tangent of psi 2 or psi 1. And again, psi 2 and psi 1 are coming from this guy, right? The only problem here is that v, v basically is the profile of the velocity of the river, right? So it's kind of highest in the middle, lowest at the end, right? Do we say what it is? I think the problem must say what it is. Well, actually it doesn't, but it's something that's usually this parabolic profile or some sort of known profile, right? So you see the complication here? Just identifying the difficulties in each problem is a big accomplishment because then you know where to concentrate. What is the non-standard situation that we're dealing with here? Come on. So we found the control, right? Implicitly, it's given by the arc tangent of psi 2 over psi 1. Psi 2 over psi 1? No, psi 1 is not zero. Psi 1 dot is zero. So psi 1 is constant. Psi 1 is constant, but you look into psi 2 and you don't have psi 2. You cannot get psi 2 until you know x2. x2 being the location, you know, right, longitude? No, across the river, right? So you cannot find psi 2, I mean, until you find x2. But x2, you cannot find x2 until you find theta. And theta, you don't know because I had to go in circles, okay? So, I mean, to me, this is identical. Where is x1 and x2? I think, well, here's x1 and x2, right? So you cannot find x2 on the Lissy-Novthela, okay? So everything that follows that stage is how can you do anything with that kind of scenario, yeah? Is the answer that you said? Is the answer that we, you mean the answer? You solved one of the four questions. Yeah, right, so you do have, so when you start with the two equations, you add two shadow equations, add joint equations, right? You always are dealing with a double-sized system, a system of double dimension, right? Right, so, and the other thing that happened is you may or may not know initial conditions for all four variables. For instance, remember this is a time-optimal problem. You want to get to something in the minimum time. So you're not going to be given any terminal conditions for size, or initial conditions for size. So you have this four-dimensional system, differential equations, right? System of differential equations. But you're not given the four initial conditions. In fact, what are you given? You're given the two initial conditions for X and the two final conditions for X. I mean, the thing is you have to have always like number four. If you have a system of four equations, differential equations, you have to have somehow four initial or terminal conditions, combination of those four in order to solve it, right? So if you have a smart kind of computer code that actually can solve those kind of things, and I'm not saying they don't exist, but I'm saying that you don't, and who knows, maybe at some 20 years from now, they'll just say, yeah, of course, use a standard package. But in the meantime, then you have to kind of work with each situation. It's very much like Lagrange multipliers, okay? When you solve Lagrange multiplier problem, right? Constraint optimization for just functions of five variables, right? With one constraint. You have one constraint, five variables, you want to minimize or maximize a function. Then you write what? Gradient of the function. I mean, this is that... I'm not trying to jump back and forth. I'm just briefly mentioned this. So let's say you have this function of three variables, and you have this one constraint, right? You want to minimize this. So what do you do? Is that the gradient of this? Equal the scalar multiple of the gradient of this, right? You get a system of three equations with... well, three equations with four unknowns, and the fourth equation is going to be this one. So you get a system of four equations, nonlinear, with four unknowns, right? How do you deal with that system from your experience? It's nonlinear. It's nonlinear. Oftentimes, you just kind of try different strategies, right? Elimination. You try to eliminate kind of one variable, or write three variables in terms of the four, then use one of the equations to... So you do certain things that are very different from problem to problem, right? This means that you will certainly get a system. Somebody can, you know, throw a system at you that you won't be able to do by hand, right? Then you go to the computer. Well, does it mean that you should always go to the computer and do it, regardless of how simple the system is? No. So you try to do the ones that you can do by hand, right? Maybe assisted by a computer software. But remember that computers, when you do this, when you ask to solve a nonlinear system symbolically, how do you know that it has captured all the solutions? Right? You have no way of saying, right? So it's, I don't know, it's kind of the same kind of feeling of this thing, so it was a question, yeah. If it's time optimal problem, so you're asking about the... So by the way, remember, you're going to have... This is going to be the piece of paper that you can use in the exam, and you're asking if it's a time optimal problem, why do we always pick F0 to be 81? Well, it's simply because you're minimizing the time t, the final time capital T, and so when you write that, so your j is t. So you can rewrite that as the integral from 0 to t of 1 dt. So that's all. It's kind of a... There are many, many ways in which you can actually rephrase an optimal control problem. So, I mean, unfortunately, we won't be having so much time to play around, but maybe it's worth to say this one thing here just kind of to make your notation look a little bit better. So oftentimes, when you have dx1 dt equals f1, right? dxn dt equals fn. And you have to... You have a functional that is the integral from 0 to capital T of f0 can be rewritten as... Actually, let me... Yeah, okay. Maybe you have some... also some of the terminal states. So your j is c1 x1, right? But you have an integral term. Then you can always write the following way. Then you can always introduce a new state variables called x0. And I should put it here in the top. dx0 dt equals f0. So x0 is now a function of little t, right? And then this whole thing is just x0 of capital T, right? Because x0 of t is just the integral from 0 to t of f0 of something d, of course, dds, right? So it's the integral from 0 to little t. So what is the integral from 0 to capital T? Well, it's going to be x0 is capital T. So it's like... And then take a look at what the new objective looks like. j is c1 x0 plus cn xn at capital T plus x0 at capital T. So I don't know if it makes sense, but think about I have two variables, a dynamical system with two state variables and an integral and an integral in the objective, right? Then you can actually make, besides the two equations, you can make a third equation in which you take that integrand and it treat it like the right-hand side of the rate of change of this new variable, right? And then that integral basically gets replaced by the value of that variable at capital time t, okay? I don't know whether I should get acknowledgments or... Yeah, what's the point? Actually, I think it's relative, but if you are looking at... Let's see, which one... I was giving you examples of this. So when you look at the... Sometimes it makes kind of your thought process a little bit easier. So if you look through the examples, as I said, this guide has 100-plus examples. If you're wondering... Maybe you're not wondering, but if you're wondering... Or if you start wondering why these objectives here don't really have an integral term is because it can be always absorbed by adding one more equation to this dynamical system. You can always get rid of the integral term. You can make it like a new variable, okay? So I don't know... You can kind of browse through this and you will... I don't know if you'll ever see an integral constraint, right? Now, when you set up a problem, it may make a lot of sense to think about integral constraint because it's whatever, it's an energy or some sort of penalty, right? But I'm saying... If it's easier for you to think about it, is instead of having this constraint, this objective, you could think of the whole thing as being minus a half times x naught of t, yeah. Yes. It introduces up psi naught. Very good point. It introduces up psi naught. Let's see, where was that? I'm sorry. No. Come on, okay. So do I recommend that? No. I mean, I don't recommend it because it will add one more... It will add an x naught, right? And it will add a psi naught, right? But think about it because it's always good to think about various ways, right? I mean, of rewriting this. So if you have x naught and psi naught, what would be the deep psi naught dt? What would be the derivative of h with respect to x naught? But x naught does not show up in the Hamiltonian. Do you see that? x naught is... Well, it would be psi naught times f naught, right? But f naught doesn't depend on x naught. f naught depends only on x1, x2, xn and u. So psi naught is going to be constant, okay? And which constant? Well, the terminal state has to be one because that's what the coefficient of that integral term is. So psi naught is always going to be one. That's why I'm trying to say it. That's why you always see this f naught with a psi naught, right? Because psi naught is always one. I mean, in case you're ever wondering, that looks kind of unbalanced, right? Why f naught should be... In fact, it's not. It's multiplied by psi naught. psi naught is always one, okay? In any case, that should clarify what I was saying last time. It didn't make much sense. But if you look in this other guide, and I'm sorry, you should have a huge memory to... visual memory to remember all this stuff. But if you look at the examples, is this the examples? They're always written in what these people call the Meyer form. So they basically always look at some objective function as being there's no integral term. Okay? Remember? Anybody remember what I said last time? Yeah, so for instance this, right? So this is what this Meyer form and I haven't been able to trace it. This is right or wrong. I mean, where this comes from. But Meyer form means there's no integral, right? It's been converted to an extra variable. So like this software, whatever this software does, always you have to rewrite it before you can put it in the computer. Okay? There's another advantage. You know, I can go on and on, right? There's another advantage of thinking of things like this. C naught, but C naught is one. Where do you see these things? Where do we see these things again? Objective functions of this form. In linear programming. So you can always think of this as being objective to reach a certain, the maximum of a certain linear function with your final time, final state, right? So this is evaluated at the final state, right? Capital T. And it's whatever the linear function it is that you want to maximize, right? But now you're following a dynamical system, so you're basically not hopping from vertex to vertex in a simplex, but rather than you're actually following the trajectories, right? In the phase space, you know, that may change depending on your control strategy, but so that you're reaching a maximum of a linear function, right? And by the way, this is not the most general way of... I mean, not the most general optimization problem. You could have nonlinear objective, right? You could have x1 squared, some products, right? You could have a general function. I haven't talked about what would that imply. So I wanted to kind of keep it to kind of this idea of linear programming. You're trying to maximize a linear function of the terminal state. So again, it's good to think that you can always convert from one to the other, I think. Okay, but let's look at that example that was in your homework. So to finish it up, still nine o'clock. That's good. So remember last time we put that system in P plane, and we said that something happens when it was zero. Again, this system is two-dimensional, right? Because your state system was one-dimensional. It was just one single equation, and now it doubles, right? Imagine what happens if you have a competing species. You have a dynamic system that state variables are two, right? Or more. So if you do harvesting in two populations, then you wouldn't be able to actually do any of this because your resulting thing will be four-dimensional. You don't have face plane, right? You don't have much of that. Not only that, but what's the other peculiar feature about this system that you're trying to solve? And I'm not pointing to the right system. The system is this is the psi. This is the psi, the dynamics for psi, right? And this is dynamics for X. I'm sorry, you should have the handout, right? Which, again, when U is zero leads to this system and when U is capillary constant, it leads to this system, right? What's the peculiar feature about this system? Any of the two. Let alone that you're going to have to switch between the two. Do we have initial conditions? We have an initial condition for X, but Q is a constant parameter, right? Q is a parameter, E is a parameter, K is a parameter, everything else is, it's only X and psi, right? So you have the initial condition for X. At time zero you have X. Well, you don't have psi, but you have the terminal condition for psi and not for X. So you have kind of an odd, it's called a boundary value problem rather than an initial value problem. So that really kind of complicates things. So what can you do? In 20 years from now there will be the standard package which will do everything algebraically, right? And you'll be one of the co-authors, right? Co-writers. But until then, what are you going to do? You're going to have to look at, kind of by hand, right? Figure out when you have U zero, when you have U equals maximum fishing, when you fish maximum, when you don't fish at all. And that's given by this switch function. So it was kind of very late the last time. So I think I saved this. I'm going to just go load this system, okay? So you see what the solutions look like. When U is zero and then you change U equals 5,000 and you see how the solutions look like this, right? So in principle, you might say, let's see what happens when you don't do any fishing and let's see what happens when you do maximum fishing. Well, since I have this for 5,000, that's a maximum fishing, right? I don't know why I called A. Yeah, but I don't know why I put the E as one of the parameters because E is not showing there. So it doesn't have to be, right? Yeah. Okay, so we can drop that. But when you have maximum level of fishing, what happens with the X population? And you don't see because you don't see the arrows, right? But if you look at the system, you know what the right-hand side of the X derivative is negative, right? Do you or don't you? Let's see. Maybe it's not that clear, but... Let's see. Is it clear that it's negative? I don't know. You have to put the numbers in, I guess. No, no, I'm sorry. I'm sorry. We're looking at the right wrong place. So if you look at here and you put the Q, the E, and the K, it's going to be negative, right? Right, so... Okay, yeah, so here. Yeah, thank you. So this is obviously negative, right? What if the agency sets the limit, not 5,000, but 3,000? Well, then it won't be negative all the way through. But again, I just use that as an excuse not to draw this using the vector field, right? So B-plane has this limitation. When you try to do vector field arrows, you don't see... I mean, you see something that's actually not even true because it uses... Well, I don't know. There's a bug, obviously. But it uses the numbers 10 to negative 5 to 25,000. It's kind of that disproportionality. Like this is 250,000, right? And this is just from negative 1 to 1. So it's not... But fortunately, when you hit lines, I don't know, the rescaling is done so that you see the true directions. Okay, so again, it goes down, right? Again, you don't know really where you are on the psi axis. That's the problem. You don't know where you're on the psi axis. You know at time 0 that you are at 115 on the x-axis, but you can't be anywhere on this line, right? You still don't know where you start. You start... Remember, you're not given psi at 0. You're given psi at capital T, but you're not psi at 0. So because of that, you cannot... psi at 0 is going to be kind of as a result of the computation. So before you do the actual computation, which actually we'll do it here, all you know is that you're going to be somewhere on this vertical line at time 0. So you see what happens as you evolve. Well, what happens is you're going to go to the left and down. Well, maybe a little bit up and then down. Yeah. What you just said about the psi thing. What it came up to say is my initial condition for x was what it is, 150,000, but psi at time 0 must be above the psi... Because of this picture, correct. Right, if psi initial is above 0, then we know that we'll satisfy our terminal. We don't know it's going to satisfy at the capital T that's given, like T equals 1 here. But we know that it's possible, right? Because when you see this picture, you don't know how long it takes. Right, so at capital time T, you should be on this line, right? Psi equals 0. So the question is you don't know how long it takes in time to reach from here down to here, unless you do it explicitly, right? You're right. If you are... You have to be above because if you're below psi is 0, then you're only going to go negative, right? And also, you cannot be very close to 0 because, you know, if you're really close to 0 in time 1, you're going to be way below 0. So you have to... At capital time T, which is given to you, psi has to be exactly 0, right? So it's conceivable that you're going to have something that goes like from here down to here, right? Down to here, okay? Okay, all right. The only thing that's complicating this is the fact that there's not a maximum... It's not clear that this is going to be optimal, right? This is only for when u is constantly maximum, right? It's always maximum level of effort of fishing, right? So this is a switch function, and I think the switch function was whatever it was. It was depending on x and psi. So I showed you last time, but let's do it again. In the solutions, you plot the level curves of the function, the switch function. And what is the switch function? Q, I think, is defined. So I'm just going to use Qx. P is defined or not? P is defined, yeah. P is defined minus psi, minus C, which is not defined. So I'm just going to, I guess, put 1 here, but of course... And then you just put the values, let's say 0. Oops. I don't have a... Multiply it here, okay? Oops. Qp psi is defined. X is defined. You see the variable x and psi. Last time it worked. I don't know why it doesn't work now, but you did. Okay, probably. Yeah, so if that's... Yeah, this happens then. Just put 10 to negative 5p. Okay. So it's probably hard to see. I mean, when you're in front of the computer, you'll see it very clearly. So you see this thing? Does this answer your question? Okay. And we're going to remove all solutions. So that's basically there in this plane. Again, if you have two state variables, two address variables, four-dimensional, your switch function depends on all four, you have no way of knowing, right? To visualize it. But here, here, it can because of that. It's only two-dimensional. One-dimensional. Okay, so... All right, so right now, and again, this is something I cannot really do on the board, is to decide now... You see psi... This switch curve goes through zero and x equals 100,000, right? So one simple... Well, it's not simple at all. One thing to notice is the following, is if you start with... You're on the 150,000, right? 1.5 times 10 to the fifth. If you're on this line segment where psi is between zero and whatever this value is, which you can find, right? Then you're going to have a chance of hitting the... Starting at this vertical line and hitting at this horizontal line, right? It's just you don't know if it's going to be in time 1 or not. Time capital T equals 1 or not, right? If you're above this switch curve, then this direction field is no longer valid, right? So you have to do the other way around, and again, I think you're going to lose this level curve, so you have to re-plot it. But if you remember what was in the previous one, it was like something like going like this, right? And again, does anybody know... I mean, it looks kind of weird, but... So let's just remember this shape. But if you do zero, any sense of y looks kind of like this symmetric? Exactly. So x... The x equation doesn't depend on psi. That's a good point. So the first equation can be solved... If you know what u is, you can solve the first equation independently of the... Well, first, and then the second equation has the x in it. So then you need to solve the first equation first, right? But to solve the first equation, you don't need that it's not coupled with a psi. The psi equation... So that basically says what? I don't know if that explains anything about the phase portrait too much. It does a little bit. It's more like... Okay, so... Right, so... And that's why I plotted this... What did I plot here? I plotted the x versus t for one of these, right? What does this remind you of? Logistic. Logistic growth, right? Logistic growth. Zero maximum stamp population, right? And that's exactly the point, that it doesn't depend on psi. So in other words, if you were to plot this for another solution, which you can do here, graph x versus t, if you pick the seller solution, is it similar or is the same? It's a little bit different. Slightly different. So about 1.5 and 40, the line crosses 1.5 in a slightly different spot. I think it has to be the same. It's the same. It's just plotted over a larger period here. But it should be the same, because the first equation doesn't depend on... On where psi is, right? Psi, right? Choice of psi just tells you where you are. But the x dynamics is independent of psi, okay? All right. Very good. So all of these are clues that you can get from doing nothing, right? And also the direction is going this way, right? So if you plot this, and I'm sorry I should have copied that, but if you plot the the level curve, times x minus 1. Again, nothing below this is valid, but only the one above. So again, if you are on the 150,000 originally and you're above the switch line, switch curve, then you see what's going to happen. It's hard to see, but you can see that if you are really close to this point, at some point you're going to get tangent. So you're always going to be above the line, right? But if you're just tiny little bit above the switch curve, you're going to hit the switch curve, meaning you're going to have to shoot back down, right? So in principle, it's possible. Again, it's this unknown, not knowing what psi at 0 is. It makes this difficult analysis. Okay, so again, and you can do this forever and ever, and you still won't know. Because p-plane just starts at time 0 and ends at time t equals infinity, right? Or something. So there's no way of saying, give me, maybe there is, I don't know, options. Maybe there is to say, settings, the time interval to be, maybe we'll figure it out now. I never looked at it. If you had a way of saying, just solve from 0 to 1, that would be amazing, right? But you don't. I think you don't, unfortunately. So you'd have to do something else, right? If you do, then a lot of these things will be, settings. I don't know why they didn't think of this, but, well, I know why this, I mean, this is really designed to see the face portrait. So you want to see solutions as they, you know, you want to do as little clicks and populate the whole thing, right? Am I talking foreign language here? I know foreign accent, but, huh? So for the, let's do a switch curve. Well, okay, so sensitivity analysis is not maybe the right word. It's just saying, do this same analysis for varying some of this, either initial condition or maybe some of the cost, some of the parameters. Take one parameter at a time and vary it, okay? And see what comes out of it. So, again, the important thing to realize is that, by staring at that, having that tool, it's a limited tool, you cannot give the answer, okay? The answer has to be given by looking very carefully at how much the x and the psi vary from time zero to time one, okay? So for that, one should look at, and this is what is done here on the last page, right? It's taking each system one at a time and that's the good news. You only have two systems to analyze because you either zero for some time or it's either E for some time, okay? So take the E equals E, this is the system, right? How do you solve this? I didn't write much, huh? So when U is E, this is what the equation looks like for x and there's an equation for psi. The equation for x doesn't depend on psi, so you can solve it. Yeah? No, no, no. This x-square is multiplied. No, no. Yeah, yeah, yeah. And that's important, right? Because it's just a growth, yeah. That has squares on the top. No, it's, of course, on the top, yeah. I mean, just put U equals E in your equation for x. This one here, right? I mean, U equals R. And then Q is R, so those two terms just cancel, so it's x-square over R over k. Okay, so how do you solve that? Again, the equation for psi, the important thing is it's going to be linear, right? It's not a surprise. It's always linear, so, and I can write it down, but I don't know if I can copy and paste. Okay, but let's first look at the equation in x. So how do you solve this? Separable, right? ODE, so in x. X and T, so it's dx over x-square equals minus R over k dt, so you integrate this. So it's minus 1 over x equals minus R over kt plus a constant, right? I don't know, it's a different constant that we'll see from the card, but it's a constant that needs to be found out when T equals 0. x-not, x is x-not, right? So this is the constant is minus 1 over x-not. So when you do this, minus 1 over x-not is minus R over kt minus 1 over x-not. Lots of minuses, get rid of them. Flip, so it's going to be 1 over 1 x-not plus R over kt. By the way, this is important because this tells you what x is at time 0 and what is x at time 1 if you were to have maximum phishing during that time period, right? Okay, and now the psi equation becomes psi prime equals minus pr, so that's a constant, right? Plus 2R over kx psi. All right, I'm not good at memorizing, so minus p, oh well, I have it here. R, that's a constant, plus 2R over kx psi. But x is this x, right? So it's a first-order linear ODE in psi, but with variable coefficients. Now, how do you solve this kind of problems? All right, so integrating a factor and how is that done? Well, you write psi prime minus 2R kx psi equals minus pr, and now you multiply both sides by e to the minus 2R over k integral over x of t dt. Okay, and I'm not going to go through y, but what the output is this times this integrating factor, right? Which actually can be computed. The left side becomes psi times the integrating factor, everything differentiated, right? Equals minus pr e to the minus 2R over k. And again, you might very easily get stuck if you cannot compute that integral, right? But x is just 1 over something plus t that automatically leaves a natural log, right? So this integral is a natural log. Then with putting things the right way, e to the natural log cancels. So it turns out that the integrating factor, and I don't have it done here, but when you're done with this, you're going to get that psi of t is p times the constant which is k over x0 plus RT. Okay, so there's some work that one needs to do, okay? Which 20 years from now we won't have to do on your own, but it's kind of surprising, and this is not the constant. I don't know, constant, constant, okay? Okay? And actually, this is the constant that actually is not known, because you see everything else is unknown, but how do you find this constant? Imposing that psi at capital T is equal to possibly equal to 0, huh? Right, why do I say possibly? Because we don't know if this is going to be a strategy up to the last moment of time, unfortunately. We don't know if in the meantime we made a switch and our u became 0, so we're looking at we're solving the wrong system. Okay? And that's where the picture actually is useful, because what happens is what's going to tell us whether we do a switch or not? You take this guy, psi, you take x, and you compute s. Okay? And I don't recommend that to do by hand. You can use your symbolic calculator, right? Just plot it. See at what time, I mean, for how long can you stretch this thing until s becomes 0 or negative or positive? Whatever, right? Switch a sign, okay? So you put that boundary condition in and get that constant, is that right? Let me... Okay, but that needs a little bit of extra argument, which is... Okay, so I say it is clear that one can choose a constant above such that psi of t is 0. Okay. But that actually uses the following argument that to actually get psi to be 0, which you really want in the end, your final time should be with maximum switch, with maximum harvesting. But again, that's based on this thing, because if in the final stretch of your year, if in the final months of the year you don't do any harvesting, you're going to be in this region, right? And you can never get psi to be 0 unless you start with psi equals 0, right? I don't know, it's a lot. It takes a lot of analysis of combination of these two, but then that's why you're safe to impose psi to be 0 and get the constant, yeah? So I remove the word possible. So if you did that, then... So you can find yourself. Right. You can find your psi at 0. So find c from psi at capital T equals 0. I'm telling you, the Greenwich multipliers will look like a piece of cake when you look back now. And you'll... Huh? Well, I ask you one of those questions, right, in the exam, so... Okay? So now you have psi. And now you have x. And now you look at s. And you say, is s going to change sign between 0 and 1? And what do I say here? One can verify that s is always positive. Okay? Which means... So the conclusion of this is the following. The only... And we're going to quit very soon. The only thing you have to do is, with those initial conditions, harvest at the maximum, right? Start below the switch line curve, which is, you know, you see it, right? Okay? And you go... You're going to go from this vertical 1.5 down to 0, psi equals 0. Okay? And that's going to be the optimal strategy. Maximum harvesting, yeah. We'll never satisfy the E. Okay, so I think that question you can interpret it as follows. I mean, it's ideally if you can find the range of x knots, but I think if you can tell me what happens when x knot is 50,000... It's not 150,000, but 50,000. Then I'll be satisfied. But of course, then you can ask, you know, what happens if you're 100,000 initially? You think you start here? I don't think so, because you can still go a little bit this way with no fishing, and then you do harvesting. So there's going to be a curve that is going to require one switch during the year. You can if you look at the explicit solution, you can, but it's difficult. I'm okay for the harmonic purpose to look at the 50,000 and 250,000, okay? That's what I think I say. Yeah, I always ask for more. Okay? So I want to get the harmonic by Friday so I can give you solutions and... So I'll pose the solutions Friday, I don't know, afternoon, so I want to buy noon. Is that okay? Is it okay to use scissors and glue? Paper glue? No, I'm serious.