moorepants / learn-multibody-dynamics

Interactive computational book on multibody dynamics
https://moorepants.github.io/learn-multibody-dynamics/
Other
121 stars 28 forks source link

Implicit assumption on the velocity calculation in one of the equations #139

Closed tjstienstra closed 7 months ago

tjstienstra commented 1 year ago

I got an e-mail of two students, who failed one of the multiple choice questions by miss interpreting equation 70 of the translation kinematics chapter. This equation assumes that point O is also fixed in reference frame B, while that is not mentioned explicitly in the text.

Peter230655 commented 1 year ago

Stupid question: is O not really a function, a constant function so to speak? Then in would not change in any frame as I understood it?

tjstienstra commented 1 year ago

O is a point fixed in B.

Peter230655 commented 1 year ago

If O was (implicitly) assumed to be the origin of A, then it would be fixed in any other frame?

tjstienstra commented 1 year ago

A point is a location and not equal to a vector. However to say something about a point, you kind of always need a reference point with respect to which you are saying something, so you'll actually get a vector. If you by example have the following equation: $${}^A\bar{v}^P = \frac{{}^A\bar{r}^{P/O}}{dt}$$ This equation says that the velocity of point P observed from frame A is defined as the derivative with respect to time of the vector from O to P, where O is an arbritrary point fixed in A. You can say O is an origin of A, but actually every point is, as long as it has zero velocity in A. This point O however can have a different velocity in the B frame (or be undefined as you know from sympy).

Peter230655 commented 1 year ago

A point is a location and not equal to a vector. However to say something about a point, you kind of always need a reference point with respect to which you are saying something, so you'll actually get a vector. This makes emminent sense, thanks for putting it this way!

So, eq (70) in Jason's script would be correct for any O on the line given by omega, the angular velocity vektor of the rotation of B w.r.t. frame A? If true, it should be correct in particular if O is the origin of A?

Peter230655 commented 1 year ago

A while back, I raised issue #24669, where I got the suspicion, that there may be an issue with v2pt_theory: A ball rolls on a street without slipping or sliding or bouncing, the street being a line in the X / Y plane If I apply v2pt_theory for the center (Dmc) of the ball, and with the contact point (assumed) momentaryly fixed in the body frame of the ball, I get incorrect results ( total energyis not constant), unless the street is a horizontal line. If I use Dmc.set_vel(N, Dmc.pos_from(P0).diff(t, N)) the result is correct regardless of the shape of the street. In both cases the contact point "moves".

Could this in any way be related to the discussion here? (Frankly, I did not try the case, where the street is an inclined straight line, if you feel this might enlighten the issue, I will be happy to try it, just let me know.)

I did the same thing in a 3D version, same results.

tjstienstra commented 1 year ago

Around these things you always have to be careful in how you define your system. Personally I like to do it all on derivatives and use the velocity 2 point theorem to get the constraint. Below is some quick code showing two possible method to compute the problem. If you were however to create some kind of situation. The reason why I personally don't like the second approach is that if you were to use Point.vel and for some reason it happens to take CP as a reference in N, then you actually get a wrong answer. Though I have to say if you correctly define your relationships, then it should never come in this situation.

from sympy import symbols
from sympy.physics.mechanics import ReferenceFrame, Point, dynamicsymbols
N, A = ReferenceFrame('N'), ReferenceFrame('A')
A.orient_axis(N, N.z, dynamicsymbols('q'))
O = Point('O')
CP = O.locatenew('CP', dynamicsymbols('x') * N.x)
P = CP.locatenew('P', symbols('r')*N.y)
O.set_vel(N, 0)
P.vel(N)  # Derivative(x(t), t)*N.x
CP.set_vel(N, 0)
P.v2pt_theory(CP, N, A)  # -r*Derivative(q(t), t)
Peter230655 commented 1 year ago

Thanks for this simply but INSTRUCTIVE example! I guess, there is nothing wrong with v2pt_theory, but rather with my thinking! I will test my 'new' understanding with my example and revert.

wwolfie commented 1 year ago

This is a slightly tricky notation issue; it is not needed that point O is fixed wrt B. It's just important to be careful to realize that B_v_P still involves movement of O as well (which is not shown in the notation, only in the definition of the velocity above).

I think the change in the pull request linked below clears up the notation with only a little bit of extra text. What do you think @TJStienstra?

Pull request

tjstienstra commented 1 year ago

It is not a notation issue, it is a conceptual trick, related to the fact that a reference frame does not have an origin. However when quickly looking over equation used for deriving this one I don't immediately spot where it goes wrong in the notation/calculation.

wwolfie commented 1 year ago

The equation you refer holds for any vector, including the vector that describes how to move from a moving point A to another moving point B. You can show this by picking a third "fixed" point, and writing the relative position as the difference between the two vectors from A and B to the third point.:

image

As an aside: completely different vectors (key example angular momentum) abide by this rule.

In the specific velocity case in the book, the vector of which a derivative is taken is r^{P/O}, where point O is considered fixed. As long as we keep both indices, nothing goes wrong. However, if we want to drop the /O in the velocity {}^A r_{P}, we run into an issue, because we either have to drop the /O on the B side (in which case we don't remember that part of this term comes from the moving of O wrt frame B), or we have to choose to drop it only sometimes.

wwolfie commented 1 year ago

It is of course a different question whether it is worthwhile introducing a relative velocity notation (like v^{A/O}) to just write this down in a slightly more general form. After all, it is never used anymore, as we only ever end up using the two specific cases which are explained in detail further down (the one and two point velocity theorems). Especially if the fully general version valid for any vector is already referred to and present in the book.

I think it is, because I think the fully general version is very useful and important., so showing applications is a good thing. But it clearly comes at the cost of a bit of extra text and notation.

Peter230655 commented 1 year ago

Maybe dumb question: what is "F" in the equations above? Thanks!

wwolfie commented 1 year ago

N and F are frames, A, B and O are points. The last step uses the distributivity of both the derivative and the cross product.

Peter230655 commented 1 year ago

It WAS a dumb question! Thanks!

moorepants commented 7 months ago

I'm closing this. I don't think there is anything to fix here.