Creating a dynamic model for optimization

  • #1
skrobada
8
1
Thread moved from the technical forums to the schoolwork forums
TL;DR Summary: Applied mechanics, mechanics, optimization, dynamics, kinematics

Hi, I'm trying to finish this assignment and I'm not completely sure how to proceed. Should I first create the constraint equations, then the kinematics to get the derivatives for velocities and accelerations, followed by the Lagrange equation? I'm comfortable with the algorithms, but I'm unsure about how to start, as I haven't done this in at least two years. Also, I'm not sure what max ∣RA∣ means here, but I suppose it's the length of the shoulder Rc starting from point A.

1725366976927.png



1725366994238.png
 
Physics news on Phys.org
  • #2
Edit: The max RA might be more likely the reaction force at A.
 
  • #3
I don't know what ##\mathrm{max}\left| RA \right|## is either. It's hard to optimize something you don't know what is. I believe it might be the length of the red segment but it's impossible to know for sure.
The problem statement doesn't give enough information. Maybe there is an additional context that was given in class?

skrobada said:
Edit: The max RA might be more likely the reaction force at A.
Is there any chance you can confirm it? I don't know how to solve the problem at the moment anyway but it'd be nice to know for sure before trying it.

Assuming that minimizing the reaction ##R## at point ##A## is the objective, I think this is how I'd try to solve the problem.
  1. Find the reactions at ##A## for a general mechanism with the given rotational speed ##\omega_{12}## of the red bar, given densities ##\rho## and arbitrary sizes for the different elements. That is, use all the variables necessary to describe the mechanism.
  2. Limit the possible options to those where the piston stroke takes the value given in the statement. ##y_{Pmax}-y_{Pmin}=L_{yP}##. I believe ##y_{Pmax}## and ##y_{Pmin}## can be found through derivation.
  3. Use an optimization algorithm to minimize the reaction ##R## at point ##A## for the viable possibilities found as described in the previous point. You'll have to juggle many variables that define the position of the characteristic points of each element.
That'd be my mental map to solve it. I'll confess though that's easier said than done. Right now I believe I might be able to just do the first point with some confidence. Maybe the second one as well after putting some time into it. The third one though would require me to study quite a bit.

Please, if you solve the problem post your procedure and results. I find optimization problems especially interesting.
 
  • #4
Thanks for the answer. It's basically what you say and what I stated in the beginning.

First, I need to define all the coordinates, particularly the mass centers, as they will be used in the system's kinetic energy. Since the green segment is treated as one area, I’ll also need to derive the equation for its mass center, as it isn’t located in the middle. After that, I will find the velocities and accelerations by taking derivatives. Additionally, I’ll define the constraint equations. I'm just fighting a bit with the definiton of the coordinates for the triangle.

Once all of this is established, I’ll apply it to Lagrange’s equation of mixed type, which will give me the Lagrange multipliers, ultimately leading to the desired force. After obtaining all this, I’ll implement it in Python using appropriate libraries.

I’ll share the results here once I have them.
 
  • #5
Juanda said:
Maybe there is an additional context that was given in class?
Not really, but after thinking about it and reconsidering the other problems we did in class, it kind of makes more sense. Considering the system, it also seems logical that if I were to imagine a motor down there, I would aim for a smaller reaction force as well.

Also, it sounds harder so...:biggrin:
 
  • #6
For the triangle center of mass, take into account that the CM of any polygon with uniform density the CM of mass is in the average position of the vertices.
For example, in a line, it's in the middle of the two ends. For a triangle I checked a long time ago and it worked too. To be honest, it's so long my memory could be failing but it'd be simple to check.


Also, for the maximum reaction, I forgot to mention that the reaction will be a function of the angle (and all the other variables).
 
  • #7
Well yeah, the CM of the triangle will be calculated based on the angle and the lengths. It's as simple as the equation taught in elementary school, instead of actual numbers there will be the variables. I struggle a bit with the angle Beta_v as I try to create the constraints equation I need to get to point P from the triangle's peak. Xp-e=0, but how do I get the Xp from the side of the triangle? Normally it would be lets say Xc+lpcos(fi), if it would be straight. I haven't done this kind of stuff since my second year so I'm bit unsure now how to implement the beta there.
 
  • #8
Or do I just create two additional angles on each side but make it as Beta_v with these angles equals 180 degrees?
 
  • #9
The following vectors define the position of each of the important nodes.
1725609542744.png

The location of each node will have two variables defined by a position vector. For the articulated rods, you know the distance separating them and for the sliders, you know they move within the dotted line.
  • ##A## is located at the origin so ##\overrightarrow{AO}=0##.
  • ##\overrightarrow{{BA}}## is the vector starting from ##{A}## going to ##{B}## and defines the position of point ##B##. That vector is equivalent to ##\overrightarrow{BO}## because ##A## is the origin.
    I know it might seem counterintuitive to say ##\overrightarrow{BA}## instead of ##\overrightarrow{AB}## but it's done like that so that vector subtraction cancels the letters and vectors point the right way. Since addition is commutative, it makes sense to use subtraction to define the order of the letters. In the end, you can choose to call things any way you want as long as they are coherent.
    I'll recommend you use my notation so we can communicate more easily and because of the reason I previously showed.
  • ##\overrightarrow{BA}## + ##\overrightarrow{CB}## is the vector defining the position of ##C##. That's equivalent to the vector ##\overrightarrow{CO}##.
  • And so on.
To calculate the CM of any polygon (line segments or triangles) add the position vectors defining their nodes and calculate the average.

To calculate the mechanism, you see 3 loops. In each loop, the addition of the vectors is 0. That will give you the constraints. Since you have 3 loops and each of them is a 2D vector equation, you'll have 6 equations.
  • A→B→C→D→A is 0 because you come back to the same point.
  • A→B→C→P→F→A is 0 for the same reason.
  • C→P→D is 0 for the same reason.
Create as many angles for the vectors as necessary. In the triangle case, notice that the vector's angles will define its shape so they'll be related to the angle ##\beta_y## given in the exercise. If your mechanism only has one degree of freedom, by considering ##\theta_{12}## (the angular position of the red bar) known, the rest of the mechanism will be defined.

NOTE: Mechanisms sometimes have multiple solutions.
Picture's source
1725610184542.png


In a "normal" exercise where the size of each element is defined, you'd have 6 variables and 6 equations to find the position of the mechanism.
However, in this case, besides those variables, you'll have variables defining the size of each of the elements so you'll have infinite solutions because your 6 equations are not enough to constrain the system.
You're then optimizing for the solution that reduces the maximum reaction ##R## at point ##A## for the duration of a cycle.
 
Last edited:
  • #10
Thank you for the reply. I'm aware of this; I just think we use a different way to apply the constraints (in terms of the number of coordinates - degrees of freedom). Well, that shouldn't change anything since yours works with vectors, so for example, the magnitude of the BA vector will obviously consist of the x and y coordinates at its points. So I have twelve constraint equations, while you have six. Which makes sense, I guess, but it's just the way we've used it so far. I'm not sure if there is a real difference; there shouldn't be, to be honest.

The thing I meant was calculating the distance from point C to P. and from C to D. I thought that I would set an angle φcp, let's say, which I would use to get to the point P as then it would be Xp = Xc+sin(φcp), same for Yp. Then on the other side, I could say that it would be Xd=Xc + sin(βv-φcp) as the beta is constant. I don't know if this makes sense. If not I'll share my iPad notes with sketch.
 
  • #11
Please take a look at the LaTex guide. Knowing LaTex is a useful skill and being able to use it here makes for easier understanding.
https://www.physicsforums.com/help/latexhelp/

skrobada said:
Thank you for the reply. I'm aware of this; I just think we use a different way to apply the constraints (in terms of the number of coordinates - degrees of freedom). Well, that shouldn't change anything since yours works with vectors, so for example, the magnitude of the BA vector will obviously consist of the x and y coordinates at its points. So I have twelve constraint equations, while you have six. Which makes sense, I guess, but it's just the way we've used it so far. I'm not sure if there is a real difference; there shouldn't be, to be honest.
I don't understand how you can get 12 constraints/equations. Having additional constraints implies an over-defined system. Either the additional constraints add no information so you get the same solution as if they weren't there or the information they add makes the system impossible to solve.


skrobada said:
The thing I meant was calculating the distance from point C to P. and from C to D. I thought that I would set an angle φcp, let's say, which I would use to get to the point P as then it would be Xp = Xc+sin(φcp), same for Yp. Then on the other side, I could say that it would be Xd=Xc + sin(βv-φcp) as the beta is constant. I don't know if this makes sense. If not I'll share my iPad notes with sketch.
I'd personally define the angles the way I described in post #9 and ignore the angle ##\beta## given by the exercise.
Juanda said:
The following vectors define the position of each of the important nodes.
View attachment 350857

If they insist on knowing ##\beta## afterward you can always obtain it from the angles that define the vectors I drew.
 
  • #12
Ah okay, you might be right here. We both use different approaches. While I use physical coordinates (Cartesian coordinates) while you describe vector loops. I didn't think about it because last few problems I dealt with this approach due to simplicity and other aspects as springs etc..

Juanda said:
I don't understand how you can get 12 constraints/equations.

The vector method typically works with generalized coordinates, which are closely tied to the internal structure of the mechanism (e.g., lengths of the links, angles between components). These coordinates directly incorporate the constraints present in the system, meaning there is no need for additional equations to explicitly describe the constraints.
The constraints (such as a fixed length of a rod) are implicitly part of the vector loop, so there is no need to add extra equations for these constraints.


But overall your approach is better than mine as I realize now for this problem because it's gonna be easier and more elegant I would say. Thanks!
 
  • Like
Likes Juanda
  • #13
I think all initial doubts are solved then so you can get to it.
Please keep us posted on how you solve it and the result you obtain.
 
Back
Top