1 00:00:00,090 --> 00:00:09,750 This example is talking about the fastest route, so suppose we want to go from point A to point B? 2 00:00:10,900 --> 00:00:19,780 And this is a lake, uh, half a circle kind of shape lake, so in order to travel from A to B, we 3 00:00:19,780 --> 00:00:21,010 have two options. 4 00:00:21,880 --> 00:00:26,230 We can go by boat and from the water path. 5 00:00:27,260 --> 00:00:38,960 We call it L1 with the speed we want or we can walk and on the land, on the route from L.A., we call 6 00:00:38,960 --> 00:00:41,230 it L2 with the velocity of two. 7 00:00:41,360 --> 00:00:43,160 OK, so. 8 00:00:44,720 --> 00:00:48,950 We want to minimize the traveling time. 9 00:00:50,140 --> 00:00:56,650 And we know that the speed of walking and the speed of the boats are different with each other, so 10 00:00:56,650 --> 00:00:58,500 the decision variable is the teta. 11 00:00:58,720 --> 00:01:06,490 So we want to find out what is the optimal value of teta in order to minimize the travel total traveling 12 00:01:06,490 --> 00:01:06,790 time. 13 00:01:07,120 --> 00:01:12,190 So the total travelling time is the time on the boat and the time on work. 14 00:01:13,090 --> 00:01:22,000 So here you can see the objective function is defined as the summation of L1 divided by we one time 15 00:01:22,000 --> 00:01:29,420 one L2 plus divided by V to the end gives you the time to OK. 16 00:01:29,830 --> 00:01:35,040 And also we know that the L1 is two or cosine of TETA. 17 00:01:35,470 --> 00:01:43,840 So based on this graph you can easily see that L1 has such a relation between the radius of the circle, 18 00:01:43,840 --> 00:01:49,750 which is a known quantity for us, and the cosine of theta, which is the desired decision variable 19 00:01:50,050 --> 00:01:57,730 and L2 is equal to two Arteta and we already know that the turtle is expressed in Radion. 20 00:01:58,850 --> 00:02:03,550 So this is the and python code for solving the problem. 21 00:02:03,580 --> 00:02:15,450 OK, so here you can see that, um, first of all, we have to import the Python Palomo package. 22 00:02:15,940 --> 00:02:22,270 So here you see from Palermo that environment import asseri everything. 23 00:02:22,460 --> 00:02:29,620 And also if we need the some functions we might need a non-pay. 24 00:02:29,920 --> 00:02:32,760 OK, and this is a description of the problem. 25 00:02:33,640 --> 00:02:43,780 So we define a model, we create a model called a model is equal to concrete model and a small R is 26 00:02:43,930 --> 00:02:46,720 the parameter we defined for the model. 27 00:02:48,090 --> 00:02:55,800 Model we want and we, too, are also parameters and also we can initialize them based on the input 28 00:02:55,800 --> 00:03:02,160 of the problem here, we assume that we want is bigger than we, too, and we call it four and three. 29 00:03:02,610 --> 00:03:11,070 And Teta is the decision variable and it is changing between some bounds between zero and a half pi 30 00:03:11,760 --> 00:03:15,380 and we can initialize it with pi divided by three. 31 00:03:15,580 --> 00:03:26,640 OK, and also the objective function is, um, summation of the time we need for travelling between 32 00:03:26,640 --> 00:03:27,630 two points. 33 00:03:28,700 --> 00:03:34,080 So the expression is two are cosine of teta divided by model. 34 00:03:34,080 --> 00:03:41,760 We one plus two times model teta multiplied by are divided by V two and the sense of the optimization 35 00:03:41,760 --> 00:03:42,840 is the minimization. 36 00:03:43,200 --> 00:03:46,410 So we let's run the first two tabs. 37 00:03:46,830 --> 00:03:47,460 Mm hmm. 38 00:03:47,970 --> 00:03:55,980 So I have run the two tabs and then I specify the IP as the nonlinear solver for us and the model is 39 00:03:55,980 --> 00:04:01,680 solved and it can give us the required, uh, decision variables. 40 00:04:01,800 --> 00:04:03,860 So it means that theta is zero. 41 00:04:04,170 --> 00:04:05,260 What does it mean? 42 00:04:05,670 --> 00:04:17,370 It means that we, um, if we go back to the optimization problem description, it means that we should 43 00:04:17,580 --> 00:04:22,920 take the water route in order to travel from A to B. That's the shortest path. 44 00:04:23,340 --> 00:04:24,330 And we will travel. 45 00:04:24,330 --> 00:04:26,220 Only two are OK. 46 00:04:27,490 --> 00:04:29,710 And that's that's it for this example. 47 00:04:29,740 --> 00:04:30,610 Thank you very much.