Why Does My Ball Trajectory Simulation Show Only Positive Vertical Velocities?

Click For Summary

Discussion Overview

The discussion revolves around a user's attempt to model the flight path of a sphere considering air resistance, while encountering issues with vertical velocity values in their simulation. The focus is on the recursive definitions of velocity and position, as well as the correct incorporation of gravitational acceleration.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Homework-related

Main Points Raised

  • The user describes their recursive equations for velocity and position, noting an issue where vertical velocity remains positive throughout the simulation.
  • One participant points out that the vertical acceleration lacks the gravity term, suggesting that it should always be greater than 9.8 when vertical velocity is positive.
  • Another participant confirms the absence of the gravity term and mentions that removing certain ad hoc calculations led to negative vertical velocity and altitude in later iterations.
  • The user expresses confusion regarding the initial position and velocity equations and questions whether the acceleration formulas should use the next iteration values instead of the current ones.
  • A later reply suggests that the simulation looks improved but recommends using a smaller time step to avoid large velocity changes between iterations.

Areas of Agreement / Disagreement

Participants generally agree on the need to include the gravity term in the vertical acceleration, but there is no consensus on the correctness of the initial position and velocity equations or the use of current versus next iteration values in the acceleration formulas.

Contextual Notes

There are unresolved questions regarding the initial conditions for position and velocity, as well as the implications of using different time step sizes on the accuracy of the simulation.

Chelonian
Messages
10
Reaction score
0
I am attempting to create a spreadsheet that models the flight path of a sphere. My model should consider air resistance, but I've opted to ignore magnum. As a resource to help me, I'm using http://www.team2834.com/team_documents/Projectile_motion_with_air_resistance.pdf, but I have ran into some trouble. I have the velocity and position defined recursively as:
$$v_x(n+1)= v_x(n)+a_x(n)Δt$$
$$v_y(n+1)= v_y(n)+a_y(n)Δt$$
$$x(n+1)=x(n)+v_x(n)Δt+a_x(n)(Δt)^2$$
$$y(n+1)=y(n)+v_y(n)Δt+a_y(n)(Δt)^2$$
The acceleration has given me some trouble, though. I tried defining acceleration as it the page seemed to indicate:
$$a_x(n)=-(D/m)v_x(n) \sqrt{{v_x(n)}^2+{v_y(n)}^2}$$
$$a_y(n)=-g-(D/m)v_y(n) \sqrt{{v_x(n)}^2+{v_y(n)}^2}$$
When I used this to finish my spreadsheet, I noticed that the vertical velocity was always positive, an obvious error. It is very possible that I have made an error unrelated to the acceleration equations (I am a novice at best at mechanics and Excel), but I saw this as the most likely candidate. The [erroneous] spreadsheet I currently have is attached.

What is causing these incorrect values? If there is any additional information I can give to help, let me know, and I will be happy to do so. I'd hate for all of my work to be wasted, so any help you can give is very much appreciated. Thank you for your time and for your assistance.
 

Attachments

Physics news on Phys.org
Your vertical acceleration does not include the term due to gravity. This is seen directly from the numeric values: its magnitude should always be greater than 9.8 while the vertical velocity is positive, and always less than 9.81 otherwise.

I have also noticed that you inserted some ad hoc calculations of the position and vertical velocity in the first iteration. When I removed those, and added the missing gravity term to vertical acceleration, I got negative vertical velocity on the 7th iteration, and negative altitude at the 16th iteration.
 
  • Like
Likes   Reactions: 1 person
voko said:
Your vertical acceleration does not include the term due to gravity. This is seen directly from the numeric values: its magnitude should always be greater than 9.8 while the vertical velocity is positive, and always less than 9.81 otherwise.

I have also noticed that you inserted some ad hoc calculations of the position and vertical velocity in the first iteration. When I removed those, and added the missing gravity term to vertical acceleration, I got negative vertical velocity on the 7th iteration, and negative altitude at the 16th iteration.
Thank you very much. I don't know how my g value slipped out of my functions, but I'm glad I fixed it. When I just made that change, I ended up with negative values one iteration earlier then you did. What should the initial position and velocity equations be? I don't see what's wrong with them.
To clarify, is the acceleration formula in my first post correct, or should it be [itex]a_x(n+1)[/itex] and [itex]a_y(n+1)[/itex] instead of [itex]a_x(n)[/itex] and [itex]a_y(n)[/itex]?
I made a new version of the spreadsheet which I think addresses and fixes the problems you mentioned. Let me know if there's anything I need to fix on this one.
Thanks again for the help.
 

Attachments

Last edited:
It looks good to me now. The only thing I would change is the time step, I would make it much smaller, you do not want big velocity changes between steps.
 

Similar threads

  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 8 ·
Replies
8
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
3
Views
2K
  • · Replies 22 ·
Replies
22
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K