1 00:00:00,080 --> 00:00:04,750 This example, we are going to solve the following optimization problem. 2 00:00:05,070 --> 00:00:09,550 So we want to find out what is the biggest cylinder inside this sphere. 3 00:00:10,200 --> 00:00:15,600 So in order to solve that, we need to find out what does it mean by the biggest cylinder? 4 00:00:15,840 --> 00:00:17,760 We mean the volume of that cylinder. 5 00:00:18,210 --> 00:00:24,930 So in order to calculate that volume, we can easily draw a figure like this. 6 00:00:25,880 --> 00:00:33,130 So this Hajj is actually half of the total height of that cylinder. 7 00:00:33,270 --> 00:00:40,600 OK, and the volume of that half is equal to Hajj multiplied by the area of this circle. 8 00:00:40,980 --> 00:00:48,450 So the area of the circle is pi r a square and multiply by each will give you the volume of this side 9 00:00:48,450 --> 00:00:54,420 of the black cylinder and you multiply by two, gives you the whole volume of this cylinder. 10 00:00:54,750 --> 00:01:02,910 So the objective function will be equal to off is equal to two pi, our square multiplied by H and the 11 00:01:02,910 --> 00:01:06,150 decision variables are a, R and H. 12 00:01:06,990 --> 00:01:09,830 So there are some constraints in this example. 13 00:01:10,230 --> 00:01:17,850 So if you look at this graph, you can easily see that the are small R squared plus Hajari Square is 14 00:01:17,850 --> 00:01:19,660 equal to our capital, the square. 15 00:01:19,680 --> 00:01:23,160 So our capital is the radius of the. 16 00:01:24,380 --> 00:01:29,570 Big sphere on our small is the radius of the base of that cylinder. 17 00:01:29,870 --> 00:01:37,280 So we do have that constraint and also we know that the small R is between zero and R. 18 00:01:38,550 --> 00:01:46,230 Capital, so you see here, and H is as well, the same age is between zero and big R, so in order 19 00:01:46,230 --> 00:01:50,310 to solve that, we need to use the promo package. 20 00:01:50,430 --> 00:01:58,650 So here you see from Pottermore environment, we import everything and also we may be using the nonpaying 21 00:01:59,370 --> 00:02:02,300 and these are the comments she's not going to be used. 22 00:02:02,700 --> 00:02:04,400 So we define a concrete model. 23 00:02:04,440 --> 00:02:07,640 It can also define as a as an abstract model. 24 00:02:08,550 --> 00:02:09,600 No worries about it. 25 00:02:09,870 --> 00:02:19,080 So R is the parameter, initialize it with number one and also edge and are are both variables and the 26 00:02:19,080 --> 00:02:21,810 arranging between zero and model that are. 27 00:02:22,440 --> 00:02:31,080 So instead of defining a new constraint, I just put the boundary of the variable inside the variable 28 00:02:31,080 --> 00:02:37,250 definition and we can initialize it with some numbers between Zero and R and I use the R here. 29 00:02:38,310 --> 00:02:41,160 So and also we don't need a constraint. 30 00:02:41,280 --> 00:02:46,560 For example, see a model that sees the constant that the describing the problem for me expression is 31 00:02:46,560 --> 00:02:51,970 equal to model R-squared plus model square is equal to model. 32 00:02:51,990 --> 00:02:53,850 That's our capital, the square. 33 00:02:53,940 --> 00:03:00,630 So as you already noticed, plomo distinguishes between the R capital and small R. 34 00:03:00,720 --> 00:03:01,040 Yeah. 35 00:03:01,500 --> 00:03:05,280 And also the objective function is the following expression here. 36 00:03:05,530 --> 00:03:13,230 I write it down so it will be two pi r a square multiplied by etch. 37 00:03:13,590 --> 00:03:22,470 And the sense of the optimization is since the Aurora model is a non linear programming, I can use 38 00:03:22,470 --> 00:03:26,690 the IP of solver and the result is given here. 39 00:03:27,630 --> 00:03:29,820 So let's run each type separately. 40 00:03:30,060 --> 00:03:37,690 I run the first stop and then the second tab and you see the number of the number increases after running 41 00:03:37,690 --> 00:03:41,930 that and then I use this tab. 42 00:03:42,480 --> 00:03:44,460 So after passing these top. 43 00:03:45,460 --> 00:03:52,440 The optimization is solved and everything is restored here in my model, and we can print the output, 44 00:03:52,470 --> 00:03:58,600 so the value is zero point eighty two, which is equal to zero point fifty eight, and the objective 45 00:03:58,600 --> 00:04:00,340 function is two point forty two. 46 00:04:00,340 --> 00:04:04,060 And I have used two points for rounding purpose. 47 00:04:04,660 --> 00:04:11,380 And also, if you want if you don't want to use the round function, you can easily print the whole 48 00:04:11,380 --> 00:04:12,590 number here. 49 00:04:13,540 --> 00:04:20,800 OK, so you can easily update any numbers that you see in this example and adapt it to your own values. 50 00:04:20,830 --> 00:04:21,550 Thank you very much.