1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: How can I be sure of my numerical result?

  1. Sep 26, 2016 #1
    1. The problem statement, all variables and given/known data
    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.

    2. Relevant equations

    3. The attempt at a solution
    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





    in the end i get t = 784.78 s for the total time but how can i be sure about this number?
  2. jcsd
  3. Sep 26, 2016 #2

    Simon Bridge

    User Avatar
    Science Advisor
    Homework Helper

    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?
  4. Sep 26, 2016 #3
    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.
  5. Sep 26, 2016 #4

    Simon Bridge

    User Avatar
    Science Advisor
    Homework Helper

    ... 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.
  6. Sep 26, 2016 #5
    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
  7. Sep 26, 2016 #6


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Did you mean more slowly?
  8. Sep 26, 2016 #7

    Simon Bridge

    User Avatar
    Science Advisor
    Homework Helper

    Hmmm... with greater acceleration grrr. So the expect correct time to fall close to or bigger than that.
  9. Sep 26, 2016 #8


    User Avatar
    Science Advisor

    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.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted