1 00:00:01,190 --> 00:00:09,150 Hi again, and this lecture is referring to the problem of center of but this some it's referring to 2 00:00:09,150 --> 00:00:10,100 a negative mass. 3 00:00:10,990 --> 00:00:11,730 What does it mean? 4 00:00:11,750 --> 00:00:22,340 Suppose you have a, um, playing surface and you do have some holes inside that surface and you want 5 00:00:22,340 --> 00:00:26,840 to find out what is the center of mass, uh, of this new shape. 6 00:00:27,150 --> 00:00:35,270 OK, so in order to solve the problem, we can follow the same, uh, formulation, which is X is equal 7 00:00:35,270 --> 00:00:35,870 to X. 8 00:00:35,870 --> 00:00:44,480 I am I divided by summation of, uh, M and also the same for Y, but with the small differences. 9 00:00:44,870 --> 00:00:50,830 So we can assume that the center of mass of the uh. 10 00:00:52,510 --> 00:00:56,320 Plane is located at its central point. 11 00:00:57,250 --> 00:01:05,830 So suppose the dimension of the surface is one by one, I suppose it's a square and the dimensions are 12 00:01:05,980 --> 00:01:10,010 both equal to each other one and this size one as well. 13 00:01:10,420 --> 00:01:17,110 So the center of mass is located at the center of this square, half and half, OK? 14 00:01:17,590 --> 00:01:23,550 And we do have, um, some holes inside that plane. 15 00:01:23,710 --> 00:01:26,530 So you can see here on this graph, there are three holes. 16 00:01:27,010 --> 00:01:31,180 And depending on the surface, um, you can see. 17 00:01:32,540 --> 00:01:41,090 That they can have different masses, so the mass is proportional to the area of each circle. 18 00:01:41,480 --> 00:01:50,690 OK, so for simplicity, we are assuming that we know the locations of the each hole and also the surface 19 00:01:50,690 --> 00:01:58,080 of each hole then and in order to solve that, we can easily apply the same formula. 20 00:01:58,220 --> 00:01:59,780 So let's have a look at the. 21 00:02:00,830 --> 00:02:08,840 Uh, Pathankot, so, as I said, the mass of the plane is positive because it exists and those hold, 22 00:02:08,850 --> 00:02:13,680 since they do not exist and we will consider them as negative masses. 23 00:02:13,730 --> 00:02:17,440 OK, so here you can see the Python code. 24 00:02:18,020 --> 00:02:27,140 So here, first of all, we import the required packages and then, um, we define them all abstract 25 00:02:27,140 --> 00:02:27,530 model. 26 00:02:28,580 --> 00:02:31,610 And also there are some parameters needed. 27 00:02:31,760 --> 00:02:40,790 The number of, uh, circles does assume, uh, the default value is five and six I which is ranging 28 00:02:40,790 --> 00:02:41,990 from one to N. 29 00:02:43,420 --> 00:02:51,040 We do need to, um, a random generator in order to scatter the points on the plane and also the air 30 00:02:51,040 --> 00:02:51,580 masses. 31 00:02:53,960 --> 00:03:02,450 And then X location Y locations are also are the parameters, input, parameters and maps as well. 32 00:03:02,990 --> 00:03:10,430 And the variables, we do have two variables model that X Y, these variables change between zero and 33 00:03:10,430 --> 00:03:18,650 one, because the center of mass will be inside that plane and the rule is the same, but with a small 34 00:03:18,650 --> 00:03:19,910 difference this time. 35 00:03:19,910 --> 00:03:28,100 And the mass of the plane is let's assume it's, um, um, proportional to the area of that, then we 36 00:03:28,100 --> 00:03:34,340 can say that it's one multiplied by 1/2 minus summation of those. 37 00:03:35,300 --> 00:03:35,860 Ms. 38 00:03:36,530 --> 00:03:44,360 And, uh, actually, the area of them is specified here, the M is the radius of those, uh, circles. 39 00:03:45,590 --> 00:03:55,640 And, uh, divided by the summation of those areas, and you can do the same for why and as I explained, 40 00:03:55,640 --> 00:04:01,340 as since this example doesn't have any specific objective function, you can choose any of your, uh, 41 00:04:01,490 --> 00:04:04,250 decision variables is a linear programming approach. 42 00:04:04,730 --> 00:04:13,070 You don't have any non-linearity if you see, uh, a square here, since M is known there will know 43 00:04:13,080 --> 00:04:15,290 and non-linearity be created. 44 00:04:15,330 --> 00:04:15,650 Sorry. 45 00:04:16,250 --> 00:04:16,680 Um. 46 00:04:16,850 --> 00:04:20,720 And also we have to choose the solver I chose. 47 00:04:21,200 --> 00:04:32,110 Go pick and then I will create uh instance so everything will be fed into the model I use the matched 48 00:04:32,120 --> 00:04:33,950 plots lead to. 49 00:04:35,370 --> 00:04:40,490 And draw the, uh, graphical shape to show the results for us. 50 00:04:40,550 --> 00:04:44,280 So for simplicity, I have chosen two points. 51 00:04:44,700 --> 00:04:49,740 One for the salt solution, the red one you can see here, and the yellow one yellow one is exactly 52 00:04:49,740 --> 00:04:51,300 at the center of that square. 53 00:04:51,960 --> 00:05:01,720 And those white ones are representing the, um, holes inside that plate. 54 00:05:02,070 --> 00:05:09,200 So as far as those random numbers are not overlapping each other, then the solution is correct. 55 00:05:09,360 --> 00:05:16,440 Otherwise, it this approach doesn't give you a valid solution, OK, because those white ones should 56 00:05:16,440 --> 00:05:20,880 not overlap each other to be able to represent their weight on the solution. 57 00:05:21,090 --> 00:05:22,590 I run it again. 58 00:05:24,010 --> 00:05:30,510 To show you the new results, so every time you run the code, it will give you another set of new solutions 59 00:05:31,150 --> 00:05:38,200 and here you can see that the center of minds doesn't change that much compared to the center of that 60 00:05:38,380 --> 00:05:39,000 square. 61 00:05:40,520 --> 00:05:47,750 I run it again, hoping I can get a better solution, so this time you can see why the solution is not 62 00:05:47,750 --> 00:05:52,550 correct, because there is an overlap between these two white ones. 63 00:05:52,880 --> 00:05:53,140 Hmm. 64 00:05:53,540 --> 00:06:03,410 And so, um, this new calculator at the center of gravity, a center of mass, is not, um, uh, precise 65 00:06:03,860 --> 00:06:07,250 because those masses are calculated two times. 66 00:06:07,880 --> 00:06:13,880 I run it again hoping I can get, uh, non overlapping kind of circles. 67 00:06:14,200 --> 00:06:18,860 OK, so here you actually there are well, there is overlap. 68 00:06:20,050 --> 00:06:21,250 I run it again. 69 00:06:22,470 --> 00:06:27,160 If you manually specify the location, you don't need to run it multiple times. 70 00:06:27,180 --> 00:06:37,110 OK, so here you can see that sees all of those wide circles are these side of the plane, then the 71 00:06:37,110 --> 00:06:40,260 center of mass will move to the opposite direction. 72 00:06:40,980 --> 00:06:41,370 OK. 73 00:06:42,700 --> 00:06:43,570 Thank you very much.