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

Click For Summary
SUMMARY

This discussion focuses on simulating Newton's Cannon using Java, specifically how to calculate the x and y components of displacement, velocity, and acceleration over a time interval Δt. The recommended approach is to use an iterative method to track the projectile's position and velocity, leveraging Newton's law of gravitation. Key equations include d = d_0 + v_0d*Δt + 1/2*a_d*Δt^2 for displacement and v_d = a_d*Δt for velocity. The accuracy of the simulation is directly related to the size of Δt, with smaller intervals yielding more precise results.

PREREQUISITES
  • Understanding of Newton's law of gravitation
  • Familiarity with differential equations
  • Basic knowledge of Java programming
  • Concept of iterative methods in numerical simulations
NEXT STEPS
  • Implement iterative methods for solving differential equations in Java
  • Explore the analytic solutions of the Kepler problem
  • Study the motion equations for constant acceleration
  • Investigate the effects of varying Δt on simulation accuracy
USEFUL FOR

Java developers, physics enthusiasts, and anyone interested in numerical simulations of projectile motion and gravitational effects.

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:

Similar threads

  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 49 ·
2
Replies
49
Views
4K
  • · Replies 138 ·
5
Replies
138
Views
8K
  • · Replies 23 ·
Replies
23
Views
3K
  • · Replies 13 ·
Replies
13
Views
1K
  • · Replies 3 ·
Replies
3
Views
11K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
1
Views
1K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K