Hi again, and this lecture is referring to the problem of center of but this some it's referring to
a negative mass.
What does it mean?
Suppose you have a, um, playing surface and you do have some holes inside that surface and you want
to find out what is the center of mass, uh, of this new shape.
OK, so in order to solve the problem, we can follow the same, uh, formulation, which is X is equal
to X.
I am I divided by summation of, uh, M and also the same for Y, but with the small differences.
So we can assume that the center of mass of the uh.
Plane is located at its central point.
So suppose the dimension of the surface is one by one, I suppose it's a square and the dimensions are
both equal to each other one and this size one as well.
So the center of mass is located at the center of this square, half and half, OK?
And we do have, um, some holes inside that plane.
So you can see here on this graph, there are three holes.
And depending on the surface, um, you can see.
That they can have different masses, so the mass is proportional to the area of each circle.
OK, so for simplicity, we are assuming that we know the locations of the each hole and also the surface
of each hole then and in order to solve that, we can easily apply the same formula.
So let's have a look at the.
Uh, Pathankot, so, as I said, the mass of the plane is positive because it exists and those hold,
since they do not exist and we will consider them as negative masses.
OK, so here you can see the Python code.
So here, first of all, we import the required packages and then, um, we define them all abstract
model.
And also there are some parameters needed.
The number of, uh, circles does assume, uh, the default value is five and six I which is ranging
from one to N.
We do need to, um, a random generator in order to scatter the points on the plane and also the air
masses.
And then X location Y locations are also are the parameters, input, parameters and maps as well.
And the variables, we do have two variables model that X Y, these variables change between zero and
one, because the center of mass will be inside that plane and the rule is the same, but with a small
difference this time.
And the mass of the plane is let's assume it's, um, um, proportional to the area of that, then we
can say that it's one multiplied by 1/2 minus summation of those.
Ms.
And, uh, actually, the area of them is specified here, the M is the radius of those, uh, circles.
And, uh, divided by the summation of those areas, and you can do the same for why and as I explained,
as since this example doesn't have any specific objective function, you can choose any of your, uh,
decision variables is a linear programming approach.
You don't have any non-linearity if you see, uh, a square here, since M is known there will know
and non-linearity be created.
Sorry.
Um.
And also we have to choose the solver I chose.
Go pick and then I will create uh instance so everything will be fed into the model I use the matched
plots lead to.
And draw the, uh, graphical shape to show the results for us.
So for simplicity, I have chosen two points.
One for the salt solution, the red one you can see here, and the yellow one yellow one is exactly
at the center of that square.
And those white ones are representing the, um, holes inside that plate.
So as far as those random numbers are not overlapping each other, then the solution is correct.
Otherwise, it this approach doesn't give you a valid solution, OK, because those white ones should
not overlap each other to be able to represent their weight on the solution.
I run it again.
To show you the new results, so every time you run the code, it will give you another set of new solutions
and here you can see that the center of minds doesn't change that much compared to the center of that
square.
I run it again, hoping I can get a better solution, so this time you can see why the solution is not
correct, because there is an overlap between these two white ones.
Hmm.
And so, um, this new calculator at the center of gravity, a center of mass, is not, um, uh, precise
because those masses are calculated two times.
I run it again hoping I can get, uh, non overlapping kind of circles.
OK, so here you actually there are well, there is overlap.
I run it again.
If you manually specify the location, you don't need to run it multiple times.
OK, so here you can see that sees all of those wide circles are these side of the plane, then the
center of mass will move to the opposite direction.
OK.
Thank you very much.