Newton's Cannon: Finding the displacement, velocity, acceleration

AI Thread Summary
To simulate Newton's Cannon in Java, use an iterative method to calculate the projectile's displacement, velocity, and acceleration over small time steps. Start with the initial position and velocity components, then apply Newton's Law of Gravitation to find acceleration. The motion equations for constant acceleration can be used to update position and velocity iteratively. The accuracy of the simulation improves as the time step (Δt) decreases, allowing for precise results. This approach balances ease of implementation with robust accuracy in modeling projectile motion.
Duvno
Messages
1
Reaction score
0
I'm working on a Java project to simulate Newton's Cannon (example: http://spaceplace.nasa.gov/how-orbits-work/).

How do I find the x and y components of displacement, velocity and acceleration of the projectile after a time Δt?

I know that I need to use Newton's law of gravitation, however I haven't come much further.

A simple answer would be welcomed warmly. Thanks in advance. :)
 
Physics news on Phys.org
Use an iterative method to track the position and velocity of the ball in small time steps, or use the analytic solutions of the Kepler problem. The first one is easier to implement, the second one is more robust.
 
Form a differential equation using the Newton's Law of Gravitation, resolving x and y components of velocity.

Then solve the differential equation, which can be very hard, and you'll get an exact solution.
 
I modeled something similar earlier this summer. The method I ended up using is really easy.

Your program needs the inital x, y, and z components and the inital v_x, v_y, v_z components. For each time, you want to find what the acceleration is using a = (GM)/(x+y+z)^2.

Once you have that, you can use the motion equations that deal with constant acceleration bodies. This is an approximation that can produce infinitesimally small error given that your Δt is small enough. The relevant equations are:

d = d_0 + v_0d*Δt + 1/2*a_d*Δt^2 (for x, y and z)
v_d = a_d*Δt (for v_x, v_y, v_z)

so the workflow would look like this:

-give the program x0, y0, z0, and v0x,v0y, v0z
-calculate a1 using gravitation equation and x0, y0, z0
-calculate v1x, v1y, v1z using a1x, a1y, a1z (make sure you aren't using a1)
-calculate x1, y1, z1, using v1x, v1y, v1z, and a1x, a1y, a1z
-calculate a2 using gravitation equation and x1, y1, z1
-that is the iterative process you would use should you choose this method.

I found it really incredible that your accuracy is limited only by how small your Δt is. It's cool that even if you found some function x(t), y(t), z(t), the constant acceleration equation produces the same result as Δt->0.

Hope this helped.
 
Last edited:
Hi there, im studying nanoscience at the university in Basel. Today I looked at the topic of intertial and non-inertial reference frames and the existence of fictitious forces. I understand that you call forces real in physics if they appear in interplay. Meaning that a force is real when there is the "actio" partner to the "reactio" partner. If this condition is not satisfied the force is not real. I also understand that if you specifically look at non-inertial reference frames you can...
I have recently been really interested in the derivation of Hamiltons Principle. On my research I found that with the term ##m \cdot \frac{d}{dt} (\frac{dr}{dt} \cdot \delta r) = 0## (1) one may derivate ##\delta \int (T - V) dt = 0## (2). The derivation itself I understood quiet good, but what I don't understand is where the equation (1) came from, because in my research it was just given and not derived from anywhere. Does anybody know where (1) comes from or why from it the...
Back
Top