1 00:00:00,060 --> 00:00:06,040 It's examples, and we already know the radius of all circles. 2 00:00:06,150 --> 00:00:13,020 OK, and we do have circles and we want to place them inside the triangle at minimum surface without 3 00:00:13,020 --> 00:00:13,940 overlapping each other. 4 00:00:13,950 --> 00:00:18,790 So we have to write down some constraints to describe the problem. 5 00:00:19,140 --> 00:00:31,020 So as you can easily see, um, the area of the triangle is calculated by, um, X etch multiplied by 6 00:00:31,020 --> 00:00:34,410 Y up here, multiplied by half. 7 00:00:34,710 --> 00:00:39,250 It gives you the, um, surface of the area of the triangle. 8 00:00:39,270 --> 00:00:39,630 OK. 9 00:00:39,720 --> 00:00:48,360 And the first constraint can be easily understood because it is telling us that each pair of circles 10 00:00:48,360 --> 00:00:50,520 should not have any overlap with each other. 11 00:00:51,750 --> 00:00:56,830 And also, we do we can see some other constraints here. 12 00:00:57,030 --> 00:00:58,580 I will explain them to you. 13 00:00:59,040 --> 00:01:04,260 So first of all, we have to write down the. 14 00:01:06,500 --> 00:01:09,230 Equation that describes this red line. 15 00:01:09,500 --> 00:01:17,300 So this red line is passing through the origin and also this specific point up and up and this line 16 00:01:17,300 --> 00:01:19,390 is described by this equation. 17 00:01:19,670 --> 00:01:19,920 Hmm. 18 00:01:20,390 --> 00:01:23,000 And also, we have another line, the blue one. 19 00:01:23,870 --> 00:01:31,210 That blue line is passing through this point zero, and it's up and way up. 20 00:01:31,520 --> 00:01:36,330 So the relation between these parameters are given here. 21 00:01:36,350 --> 00:01:42,070 So this is the equation describing the blue line. 22 00:01:42,830 --> 00:01:44,750 And also we know that. 23 00:01:47,570 --> 00:01:54,470 We need to satisfy some constraint so the center of these circles should be, for example, on the right 24 00:01:54,470 --> 00:01:58,010 hand side of the red line and the left hand side of the blue one. 25 00:01:58,370 --> 00:01:59,510 This is one constraint. 26 00:01:59,720 --> 00:02:06,770 And the other one is that the distance between the center to the red one should be bigger than the radius 27 00:02:06,770 --> 00:02:10,400 of the circle and also the center to the blue. 28 00:02:10,400 --> 00:02:13,700 One should be bigger than the radius of the circle. 29 00:02:13,760 --> 00:02:17,100 OK, so these two constraints are given here. 30 00:02:17,330 --> 00:02:26,000 So these two are telling us, for example, we are below the red line and on the left hand side of the 31 00:02:26,000 --> 00:02:27,520 blue one, OK? 32 00:02:27,710 --> 00:02:38,300 And also these two will specify that and the distance between the center of the circle and the line 33 00:02:38,330 --> 00:02:41,960 is more than the radius of that specific circle. 34 00:02:42,020 --> 00:02:44,660 OK, so we have to write down the. 35 00:02:46,100 --> 00:02:59,330 A Python code to solve this optimization problem and the decision variables are, um, the, um, location 36 00:02:59,330 --> 00:03:06,500 of the centers and also, uh, the radius of them are already known for us. 37 00:03:06,560 --> 00:03:11,690 OK, so let's talk about the Python code. 38 00:03:11,700 --> 00:03:19,490 So first of all, we have to import everything that we need then, uh, define the sets I and J. 39 00:03:19,530 --> 00:03:21,590 Have you already know the meaning of them? 40 00:03:21,770 --> 00:03:24,680 Because I is representing the each circle. 41 00:03:24,680 --> 00:03:31,370 J is the alias of that R is a parameter and which is specified by us. 42 00:03:31,850 --> 00:03:35,150 It is telling us how much is the radius of each circle. 43 00:03:35,910 --> 00:03:47,030 And also we have to define some bounds for the variable X and Y, so it's between R and a big number 44 00:03:47,780 --> 00:03:58,880 and Y up an X each and X up are already unknown and the area is already the um, objective function 45 00:03:58,880 --> 00:03:59,330 for us. 46 00:03:59,480 --> 00:04:12,020 OK, so um, you can tell that OK, if I is less than J uh then it means that by just writing down this 47 00:04:13,370 --> 00:04:22,460 inequality, uh, we can make sure that, uh, any two circles are not overlapping each other and then 48 00:04:22,640 --> 00:04:25,340 we are making sure that we are below the red line. 49 00:04:25,340 --> 00:04:28,700 We are on the left hand side of the blue one in this one. 50 00:04:29,240 --> 00:04:37,550 And as you can see, these two equations are defined over I and also the distance between each center 51 00:04:37,550 --> 00:04:45,290 to the red or blue lines are more than the radius of each circle. 52 00:04:45,320 --> 00:04:50,960 OK, and also and this is another one that we already talked about it. 53 00:04:51,740 --> 00:05:02,800 And also, um, we should say that, OK, so x up and is less than X each. 54 00:05:03,260 --> 00:05:04,940 OK, this is an assumption. 55 00:05:05,420 --> 00:05:09,500 And and also the area is a specified here. 56 00:05:09,620 --> 00:05:18,380 OK, so these are the constraint and the objective function and also the uh input of the problem is 57 00:05:18,710 --> 00:05:20,480 um described here. 58 00:05:20,490 --> 00:05:25,530 So um, the radius of the circle should be specified in a dandified. 59 00:05:25,550 --> 00:05:32,000 OK, so I run the problem for you and see the results. 60 00:05:38,850 --> 00:05:47,640 OK, so the problem is, Ron, and you can see here that and the area of the circle is found, how much 61 00:05:47,640 --> 00:05:48,130 is it? 62 00:05:48,150 --> 00:05:49,870 How much is W and so on. 63 00:05:49,990 --> 00:05:58,470 OK, and you can also by using this command print results that sort the status and you can find out 64 00:05:58,470 --> 00:06:05,850 what's happening to the different variables like X, Y or what is the upper value, what is the lower 65 00:06:05,850 --> 00:06:15,150 value, what is the exact value of it and also is it fixed or not fixed and the X of X h y up and the 66 00:06:15,150 --> 00:06:15,570 area. 67 00:06:17,020 --> 00:06:22,450 And you can also have some information regarding the constraints and so on, on each equation's. 68 00:06:22,640 --> 00:06:28,840 OK, normally you don't need that kind of information, but if you want to have access to them, you 69 00:06:28,840 --> 00:06:34,240 can easily use this command to find out more about what's happening inside your model. 70 00:06:35,380 --> 00:06:36,220 Thank you very much.