Calculating Angular Velocity for Falling Object Simulation

AI Thread Summary
The discussion focuses on calculating the angular velocity (ω) of a falling object in a simulation, using potential energy (PE) and kinetic energy (KE) equations. The user attempts to derive ω by calculating the difference in PE at various angles, leading to the equation ω = √(6Δ(gh)/l²). There is confusion regarding the transition from ω to the animation frames, particularly how to assign ω per frame in a simulation running at 25 fps. Participants suggest using a list of ω values corresponding to each angle and adjusting the angle incrementally based on the calculated ω for accurate animation. The conversation highlights the importance of maintaining consistent units in calculations and clarifies the need for proper reference points in energy equations.
GeorgeM
Messages
30
Reaction score
0

Homework Statement


This is an academic project related to a falling object simulation.
I have come to the point where I'm trying to calculate the per degree angle of the falling object seen in the attached images. The object has known height and length in pixels and is fixed on a pivot.

Homework Equations


PE = mgh
KE = ½Iω2
I = ⅓ml2

The Attempt at a Solution


Will calculate the difference in PE between two angles, eg: ΔPE = PE(90°) - PE(89°) = KE
So, ΔPE = KE
Δ(mgh) = ½Iω2
Δ(mgh) = ½(⅓ml22 (cancel m)
Δ(gh) = 1/6 l2 ω2
6 Δ(gh) = l2 ω2
...
ω = √6Δ(gh)/l2

Also, h is the height of the COM calculated at every angle using h = sin(angle)*hyp
hyp is the distance of centroid to the rotation point.

ω is measured in rad/sec
I'm confused on how to go back from ω to the actual animation of the falling object and also if what I calculated is correct.

Any help is very much appreciated.
Thanks
 

Attachments

  • image0.png
    image0.png
    268 bytes · Views: 445
  • image1.png
    image1.png
    550 bytes · Views: 419
Physics news on Phys.org
Hello George,
GeorgeM said:
I'm trying to calculate the per degree angle of the falling object
You are trying to calculate what ?
GeorgeM said:
Will calculate the difference in PE between two angles
And why would you want to do that?

As comments: I don't see much wrong, but you should realize the pivot point is moving when you round off the bottom of your object. And the moment of inertia is no longer that for a rectangular block.
GeorgeM said:
I'm confused on how to go back from ω to the actual animation
I wouldn't use 'back' here ? Unless you have calculated ##\phi(t)## already ...
 
  • Like
Likes GeorgeM
Hello BvU

Thanks for the comments.

I'm trying to calculate the KE at every angle starting from 90° to 0° clockwise. I assume that KE will give me ω. This ω is the angular velocity at every angle. Is this assumption correct?
KE must be equal to the difference in PEs, that's why I use this. May I ask whether you have a different method to solve this?

Finally, I have ω, which is rad/sec, my simulation will work in 25fps, so in every frame I will have to consume 25 degrees - 1 degree per frame.
I'm confused on how to assign ω per frame.

Thanks
 
your background isn't in physics ?

What would you do to simulate an object that someone let's go at 1.25 m from the floor and that drops to the ground in 0.5 s ?
Or a projectile trajectory ?
GeorgeM said:
in 25fps, so in every frame I will have to consume 25 degrees - 1 degree per frame.
It seems to me you then get a uniform rotation - 25 degrees/sec, so 3.67 seconds and it's flat on the floor.

The thing to do is to solve the equation of motion. In the above example (dot means ##d\over dt## -- are you familiar with differentiation ? -- ): $$
\ddot y = -g \quad \Rightarrow \quad \dot y = \dot y_0 - gt \quad \Rightarrow \quad y = y_0 + \dot y_0 t - {1\over 2} gt^2$$But now something similar for the orientation (##\theta##) for the falling rod.

If you insist, your approach can be made equivalent to numerically solving the equation of motion: You get ##\Delta \omega \over \Delta \theta ## in steps of one degree and - with initial conditions - you can add them up to get ##\omega(\theta) ##. And an angle of 1 degree is traversed in ##{2\pi\over 360\;\omega}## giving you the time (number of frames) from one angle to the next (1 degree further) angle.
 
Let me clarify something: There two phases here, one to calculate the velocity at every degree, that is, for 90° ω=0 ...for 59° ω=2.89 ... for 19° ω=3.78 etc.

Then, having the above stored in memory, I'll have to draw the rod and simulate the falling action. The question is how I will go from ω to fps. Is so confusing!
 
I thought you had fps fixed at 25 :wink: !

Basically you want ##\theta(t)##, right ? You can draw the thing at an angle ##\theta## and time runs with 0.04 s between two frames.

And you are somewhere already: starting with ##\theta = 0## isn't very interesting: nothing happens...

But if you have a list with omegas life is easy ! Say you start at 89 degrees and draw Frame 1 for t = 0. Look up omega and do ##\theta(0.04) = \theta(0) + 0.04 \omega## (be sure to convert back to degrees !)
Look up (or interpolate) ##\omega(\theta(0.04))## and repeat! Happy falling !
 
  • Like
Likes gracy
The list of ω doesn't look great though, I would expect to see some higher acceleration at the end - when the rod reaches the ground - rather than at the start of the fall. See the diagram of velocity-frame no.
 

Attachments

  • diag.jpg
    diag.jpg
    11.5 KB · Views: 432
In the equation of motion there is a ##\sin\theta## And your series 4 shows something looking like that ? But I don't really know what 1, 2,3 and 4 stand for...
 
Series 1 shows the ω for every degree (0-90)
sin(θ) is used to calculate the height of COM
 

Attachments

  • theta-sin.jpg
    theta-sin.jpg
    3 KB · Views: 400
  • #10
BvU said:
But I don't really know what 1, 2,3 and 4 stand for...
Oh, well, series 1 also looks like a sine on that scale...
 
  • #11
It doesn't look right. I would expect a different graph.
 
  • #12
Namely ?
 
  • #13
I would expect to see some higher acceleration at the end - when the rod reaches the ground - rather than at the start of the fall
 
  • #14
Yes you said that. But you still haven't said which is which or what you do to get these results.

In post #1, if you write ΔPE = KE, do you understand that that in fact should be ΔPE = ΔKE ?
 
  • #15
I was advised to use ΔPE = KE by another fellow in this forum. Is not my idea, I'm afraid.
To get these results, I do what I say in Post#1, nothing more...
 
  • #16
Well, how do you think you describe the change from potential energy to kinetic energy for a falling object ?
With ΔPE = KE, or with ΔPE = ΔKE ?

I know lots of other fellows (and a few ladies) in PF and none of those would advise the former. Could it be you misinterpreted ?
 
  • #17
Perhaps I was misinterpreted...
If GPE loss = KE gain, then loss in PE is calculated by the difference in PEpre - PEpost
Since PE = mghCOM, is mainly h the only changing parameter here. But there is something missing and that's why I get the graph series 1 as the sin graph.
 
  • #18
Can you show your steps ? I still don't know which is which or what you do to get these results.
Or why you think it's wrong, for that matter. It may well be correct.

As long as you do ΔPE = ΔKE with respect to the same reference point. If that is the starting position in both cases you are relatively OK. Note that you run into trouble with the initial conditions very easily this way! ##\ \ \theta(0) = 0 \ \ \& \ \ \omega(0) = 0\quad ## is a (non-stable) equilibrium point: theoretically nothing happens.
If (your post #1) $$ {\rm PE} =mg{l\over 2} \sin \theta \quad
$$then $${\Delta \rm PE} = mg{l\over 2}(1-\sin \theta) \quad
$$and you easily get $$\omega^2 = {3g\over l} (1-\sin\theta)\quad $$which does increase nicely for ##\theta \downarrow 0##. So I don't really see a problem -- even for this very cumbersome method :smile: .

--
 
Last edited:
  • #19

Attachments

  • ejs-graph.jpg
    ejs-graph.jpg
    12.8 KB · Views: 430
  • #20
I see that, but I don't see why you think your thingy is wrong becasue you still haven't said what it shows. I only see a meaningless series 1, 2, 3, 4 and no idea what is on the abscissa. Should I read from left to right or from right to left ?
Can you show your steps ?
 
  • #21
Sure. BTW, there is only one series (see attach). In this graph (x axis = frame no, y-axis = ω)

I have simplified the problem with a rod falling, not an object as in post #1.

So, here are the parameters and steps:

length_rod = 400
comDistance = length_rod/2
gA = 9.8

loop angle 90 - >0

com_height = sin((angle) * PI / 180.0)*comDistance;

//calculate angular vel of Pi
gh = gA*com_height
velP = (sqrt(3*(gh_pre-gh)/length))

gh_pre = gh

This is pretty much the actual process in the software. Let me know if this makes sense.
Thanks!
 

Attachments

  • diag.jpg
    diag.jpg
    11.7 KB · Views: 410
  • #22
Code:
velP = (sqrt(3*(gh_pre-gh)/length))

gh_pre = gh
should be
Code:
velP = velP_pre + (sqrt(3*(gh_pre-gh)/length))

velP_pre = velP
gh_pre = gh
in accordance with ΔPE = ΔKE with the previous point as reference. You could also take
Code:
velP = vel_0 + (sqrt(3*(gh_0 - gh)/length))
in accordance with ΔPE = ΔKE with the starting point as reference
 
  • #23
Great! And now the diagram looks like that...
I did one run with height of rod = 100 and ω seems the same. I would expect that due to (sqrt(3*(gh_0 - gh)/length)) , when length goes up, ω goes down...
 

Attachments

  • diag.jpg
    diag.jpg
    12.4 KB · Views: 415
  • #24
The final bit is to get the simulation running. Here I'm trying to implement what you wrote at post #6
I iterate the list of ω (there are 90 different values there) as follows:

loop list of ω
{
thetaF0 = (theta_pre - 0.04*list)
theta_pre = thetaF0

///then draw the animation
}

It looks very promising, but the rod stops at 37.1 degrees- it doesn't go all the way to 0°.
Hmmm..
 
  • #25
GeorgeM said:
Great! And now the diagram looks like that...
I did one run with height of rod = 100 and ω seems the same. I would expect that due to (sqrt(3*(gh_0 - gh)/length)) , when length goes up, ω goes down...
And what is h ?
 
  • #26
GeorgeM said:
The final bit is to get the simulation running. Here I'm trying to implement what you wrote at post #6
I iterate the list of ω (there are 90 different values there) as follows:

loop list of ω
{
thetaF0 = (theta_pre - 0.04*list)
theta_pre = thetaF0

///then draw the animation
}

It looks very promising, but the rod stops at 37.1 degrees- it doesn't go all the way to 0°.
Hmmm..
1. You don't want list(n) but the omega that matches theta
2. list is 90 long, has nothing to do with the number of frames you want to draw.
 
  • #27
BvU said:
And what is h ?
Height is in pixels, say 100 pixels long rod. Is this what you ask?
 
  • #28
BvU said:
1. You don't want list(n) but the omega that matches theta
2. list is 90 long, has nothing to do with the number of frames you want to draw.

I know, I'm wrong here, I just cannot visualise it as an example...
 
  • #29
GeorgeM said:
Height is in pixels, say 100 pixels long rod. Is this what you ask?
No, I mean ##h = {L\over2} \sin\theta\ \ ## (your post #9). You can't have a height in pixels and multiply it with g in m/s2 in a calculation. !
GeorgeM said:
I know, I'm wrong here, I just cannot visualise it as an example...
0 Start
1 You have a theta. Draw the frame.
2 You look up the omega that goes with that theta. Interpolate if necessary.
3 You decrease theta with 0.04 * omega to get the next theta
4. goto 1 if theta > 0.
5 Finish​
 
  • #30
So, I'll need to have an assumption i.e. how many pixels per metre (pixPerM = 100) and then multiply all my x, y variables with this?

What do you mean by look up the omega that goes with theta?
Say theta(0) = 90°, I draw this, then I look an omega that goes with that theta(0)?
Give me one example please, to get what you mean.

Thanks
 
  • #31
GeorgeM said:
So, I'll need to have an assumption i.e. how many pixels per metre
Of course you do. For drawing purposes.
But you want to do the physics with physical units.
Keep them separate for the picture drawing variables you need.

I don't understand you have to ask these questions. You yourself wrote velP = (sqrt(3*(gh_pre-gh)/length)) (-- which I see is wrong -- *) and of course you can only do this if h and length have the same units !

GeorgeM said:
What do you mean by look up the omega that goes with theta
You have a list of omegas. Omega (89 degrees) omega (88 degrees) etcetera. If the angle is 88 degrees, you take omega (88 degrees).

*) Post #1 clearly has 6 Δ(gh) = l2 ω2 and then -- confusingly -- ω = √6Δ(gh)/l2 and you fell into that hole
 
  • #32
There is also another reason: my frame rate is not stable at 25 fps, so multiplying by 0.04 is not always right.

You are saying that (sqrt(3*(gh_pre-gh)/length)) is incorrect, is this because of the mixed units?
 
  • #33
g is m/s2
h is m
length is m
g h / length is m/s2
sqrt of that is not 1/s but (√m)/s
 
  • #34
So my units for ω are in (√m)/s ? I shouldn't then use this formula if this what you are saying.
 
  • #35
Read the expression in post #1
 
  • #36
This is actually ω = √(6Δ(gh)/l2) l square is in the root.

Another note re the formula in post #18: velP = velP_pre + sqrt(((3*gA)*(1-sin((angle) * PI / 180.0) ))/length ) (this is eq2 attached image)
This equation will give different ω from the one in post #1, see attached. ω based on post #18 at 90° is 180 rad/sec! This is given a rod of 2m.
 

Attachments

  • eq1.jpg
    eq1.jpg
    12.4 KB · Views: 334
  • eq2.jpg
    eq2.jpg
    13.3 KB · Views: 341
  • #37
Could you post a list of symbols, their dimension, and what they stand for ? You have way too many different symbols for a simple 1 degree of freedom simulation. One moment vertical is 90 degrees, the other horizontal. Intractable.
There is no way to check your dimensions are correct. ##\omega## is pretty unambiguous, but vel is confusing and now I see an A pop up, etc. etc.
The pictures are meaningless, you don't say what is plotted.
GeorgeM said:
ω based on post #18 at 90° is 180 rad/sec
This is so easy to check with the formulas in post #1 that I am surprised you post it (that takes longer, and it's clearly nonsense)
 
  • #38
I have the graphs annotated, x-axis = degrees, y-axis = omega.
If formulas in post #1 are nonsense, then why you couldn't say this in the first place? The other thing, is that none else did any commitment for this question, or said that my answer is wrong. I'm not saying it is right, I know is not right and that's why I'm here!
 

Attachments

  • eq1.jpg
    eq1.jpg
    14.7 KB · Views: 361
  • eq2.jpg
    eq2.jpg
    15.8 KB · Views: 353
  • #39
I'm sorry, I still can't make out what these pictures represent. I know I see omega as a function of some angle. I suppose the angle is in degrees and omega is in radians/second ? But you do not give me anything that I can use to reproduce these results.

The formulas in post #1 are fine. Your subsequent processing in the algorithm is not.
That's why you end up with something like
GeorgeM said:
ω based on post #18 at 90° is 180 rad/sec
when it is so easy to see that
GeorgeM said:
ω = √(6Δ(gh)/l2)
gives ##\omega^2 = 6 * 10 \, m/s^2 * 1 m / (2m)^2 = 15 /s##
GeorgeM said:
This is actually ω = √(6Δ(gh)/l2) l square is in the root.

Another note re the formula in post #18: velP = velP_pre + sqrt(((3*gA)*(1-sin((angle) * PI / 180.0) ))/length )
There I do not see L2in the root. So this is the one that is wrong. It is also confusing to use a symbol vel that is not explained. We are now at post #39 and not making much progress.

GeorgeM said:
The other thing, is that none else did any commitment for this question, or said that my answer is wrong
The simple reason is that it has become hard to follow for others than you. I don't know how I can help you get on a better track. It does not help if I do the exercise for you. I have interspersed some sensible (imho) advice. Can you do something with that ? How would you want to be assisted better in this ?
 
  • #40
BvU said:
There I do not see L2in the root.
There isn't a L2 since

\omega^2 = {3g\over l} (1-\sin\theta)\quad so
\omega = \sqrt{{3g\over l} (1-\sin\theta)\quad} \ \ \ (1)
Given by the equation in post #18

As I said, I also tried the formula form post #1 \omega = \sqrt{\frac{6\Delta(gh)} { l^2}} \ \ \ (2)

Then I have two different equations for ω. And, I did a comparison to see on whether they return the same values, but they don't.

In code those are:
Note velP is the ω

for(float angle=90;angle>0;angle--) // loop from 90 → 0
{
hyp = length/2; // half of rod's height
cenX = sin((angle) * PI / 180.0)*hyp; // height of COM

gh = gA*cenX; // g*height of COM

velP = velP_pre + sqrt((6*(gh_pre-gh))/pow(length, 2)); //--- > Equation 2
velP = velP_pre + sqrt(((3*gA)*(1-sin((angle) * PI / 180.0) ))/length ); // --> Equation 1

omegaList.push_back(velP); // store omegas

velP_pre = velP;
gh_pre = gh;
}

omegaList will store the 90 different omegas. I used the list to draw the graphs for post #38

Is this clear so far please?

Thank you!
 
  • #41
I'll have to ask again in the future then about this. It is not a coursework, or an assignment. I have worked out formula (1) post #40, but I don't see an option to iterate the angles (90-0) without a loop (starting from 90->0). Then again, I cannot draw the rod without using another loop for each resulted ω from the previous step.
Anyhow, thank you very much for committing to this.
 
Back
Top