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:
Hello everyone, Consider the problem in which a car is told to travel at 30 km/h for L kilometers and then at 60 km/h for another L kilometers. Next, you are asked to determine the average speed. My question is: although we know that the average speed in this case is the harmonic mean of the two speeds, is it also possible to state that the average speed over this 2L-kilometer stretch can be obtained as a weighted average of the two speeds? Best regards, DaTario
The rope is tied into the person (the load of 200 pounds) and the rope goes up from the person to a fixed pulley and back down to his hands. He hauls the rope to suspend himself in the air. What is the mechanical advantage of the system? The person will indeed only have to lift half of his body weight (roughly 100 pounds) because he now lessened the load by that same amount. This APPEARS to be a 2:1 because he can hold himself with half the force, but my question is: is that mechanical...
Some physics textbook writer told me that Newton's first law applies only on bodies that feel no interactions at all. He said that if a body is on rest or moves in constant velocity, there is no external force acting on it. But I have heard another form of the law that says the net force acting on a body must be zero. This means there is interactions involved after all. So which one is correct?
Back
Top