How can I be sure of my numerical result?

In summary: It also includes a retarding force, and finds that the time to fall decreases as the drag force increases.
  • #1
Elvis 123456789
158
6

Homework Statement


In this problem you will do numerical computer calculations. A skydiver of mass 75.0 kg jumps out of a plane at an altitude of 30.0 km above the surface of the Earth. His parachute fails to open. Assume there is no horizontal motion and the initial velocity is zero. We ultimately will want to do a calculation that includes variation in the drag force due to variation in atmospheric density as well as the variation of the gravitational force with altitude. But we will start simple

a) Calculate the time to fall to the ground with no air resistance and no variation in g. Compare your result to the analytical result and refine the computer code to achieve no worse than 0.1% accuracy by adjusting the time step.

b) Now include a retarding force of F(v) = c*v2, where c=0.500 kg/m and is constant. You should be able to compare your result to an analytic result from problem 3.

Homework Equations

The Attempt at a Solution

[/B]
this is my program

import numpy as np

# numerical calculation for falling body with constant

#gravitational force only

#

# gravitational acceleration in m/s^2

g = 9.81

# mass in kg

m = 75.

#drag coeffcient in kg/m

c = 0.5

# initial position (measuring down to be positive) in m

y = 0.

# initial velocity in m/s

y1 = 0.

# time interval in seconds

dt = 0.01

a = [] # acceleration array

v = [] # velocity array

p = [] # position array

i = 0

while y<30000.:

i = i + 1

y2 = g - (c*y1**2.)/m # this the differential equation that describes the motion (y2 = a )

y = y + y1 * dt

y1 = y1 + y2 * dt

p.append(y)

v.append(y1)

a.append(y2)

print(i*dt)

in the end i get t = 784.78 s for the total time but how can i be sure about this number?
 
Physics news on Phys.org
  • #2
What do you mean by "sure"?

You can, for example, do an experiment to verify the model you used to arrive at that number.
You can check to see if the result is consistent with what you know of the rest of physics.
ie. for (a) the problem tells you to compare your result, in the case of zero air resistance, to the analytic result. Did you do this?
When you do the problem including air resistance, do you expect the result to be bigger or smaller than without air resistance? What did you get?
 
  • #3
Simon Bridge said:
What do you mean by "sure"?

You can, for example, do an experiment to verify the model you used to arrive at that number.
You can check to see if the result is consistent with what you know of the rest of physics.
ie. for (a) the problem tells you to compare your result, in the case of zero air resistance, to the analytic result. Did you do this?
When you do the problem including air resistance, do you expect the result to be bigger or smaller than without air resistance? What did you get?
Yes I did part a and got the answer to be within about 1 part in 10000 compared with the analytic result. When air resistance is included i expect the amount of time to be significantly larger because the acceleration is not just "g" anymore, its g minus a constant times the square of the velocity, so the acceleration is decreasing at all times until the drag force cancels the gravitational force ( if its in the air that long). So the time I got for part a was like 78.2 seconds which is much smaller than the result in part b (785 s). So at least I know that it has a chance of being right, but I can technically say that about the range 78.2 s < t < infinity, obviously this is an exaggeration but still.
 
  • #4
I can technically say that about the range 78.2 s < t < infinity,
... you can do better than that, you can work out the analytical terminal velocity and figure the time to fall the whole distance at that constant speed. Since some of the time is spent falling faster than that, this will be an upper limit.

What this does is show that the computer calculation is consistent with the physical model you are using. ie. helps you be confident that what the computer is calculating from the physical model (the math equation) that you want to compare with reality.
 
  • #5
Simon Bridge said:
... you can do better than that, you can work out the analytical terminal velocity and figure the time to fall the whole distance at that constant speed. Since some of the time is spent falling faster than that, this will be an upper limit.

What this does is show that the computer calculation is consistent with the physical model you are using. ie. helps you be confident that what the computer is calculating from the physical model (the math equation) that you want to compare with reality.
ah i didn't think of that. my result does indeed lie below that upper limit but barely. I'm assuming this is because the drag force very quickly balances out the gravitational force due to the v^2 term
 
  • #6
Simon Bridge said:
Since some of the time is spent falling faster than that,
Did you mean more slowly?
 
  • #7
Hmmm... with greater acceleration grrr. So the expect correct time to fall close to or bigger than that.
 
  • #8
One way to check the consistency of your numerical calculation is to decrease the time step dt. If your numerical calculation is accurate, it should be independent of dt. So you could start with a large time step, like 0.1, and then decrease dt to 0.01, 0.001, 0.0001, etc. Once dt is small enough, the result should converge to a limit that is independent of dt.
 
  • Like
Likes Simon Bridge

1. How do I know that my numerical result is accurate?

There are a few ways to ensure the accuracy of your numerical result. Firstly, you should double-check your calculations and make sure all the steps are correct. You can also compare your result to other known values or use a different method to calculate the same result as a way of cross-checking. Additionally, using a computer program or calculator with high precision can also improve the accuracy of your result.

2. What are some common sources of error in numerical calculations?

Some common sources of error in numerical calculations include rounding errors, input errors, and algorithmic errors. Rounding errors occur when numbers are rounded to a certain number of decimal places, which can lead to small discrepancies in the final result. Input errors can happen when incorrect values are used in the calculation, while algorithmic errors can occur when the wrong mathematical formula is used or when there are errors in the code.

3. How can I reduce the margin of error in my numerical result?

To reduce the margin of error in your numerical result, you can use a more precise method of calculation, such as using more decimal places or using a computer program with high precision. It is also important to double-check your calculations and use cross-checking methods to catch any errors. Additionally, using well-established and accurate mathematical models can also help reduce the margin of error.

4. Is it possible to have a completely error-free numerical result?

In theory, it is possible to have a completely error-free numerical result. However, in practice, it is nearly impossible to achieve such a result due to the various sources of error mentioned earlier. As humans, we are also prone to making mistakes, so it is important to always double-check our calculations and use reliable methods to minimize errors.

5. How can I be sure that my numerical result is reliable?

To ensure the reliability of your numerical result, you can use multiple methods to calculate the same result and see if they all yield similar values. You can also compare your result to other known values or use established mathematical models to verify the accuracy of your calculation. Additionally, using high precision tools and double-checking your work can also contribute to the reliability of your numerical result.

Similar threads

Replies
6
Views
712
  • Introductory Physics Homework Help
Replies
13
Views
3K
  • Introductory Physics Homework Help
Replies
1
Views
1K
  • Introductory Physics Homework Help
Replies
5
Views
2K
Replies
14
Views
315
  • Introductory Physics Homework Help
Replies
9
Views
2K
  • Introductory Physics Homework Help
2
Replies
41
Views
3K
  • Introductory Physics Homework Help
Replies
5
Views
1K
  • Introductory Physics Homework Help
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
Back
Top