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!

I Numerical Integration twice (acceleration to displacement)

  1. Nov 17, 2017 #1
    Hello everyone

    I have the following question regarding numerical integration twice from acceleration to displacement.

    Suppose that a particle has acceleration function of a = tt (which has non-elementary integral), to find the velocity it is easy as I can use Simpson's rule for numerical integration. But now I would like to find the displacement of the particle after some time, let say 5 seconds, how do I calculate it?

    Note that I need very accurate answer, so I usually integrate numerically using Excel with thousand interval.

    I prefer to use Newton-Cotes formula if possible.

    I tried using integration by parts, but I always reach a point where I can't continue.
    a = tt
    Let v = ∫ tt
    s = ∫ v
    = t*v - ∫ t*tt
    = t ∫ tt - ∫ t*tt

    For example, to find the displacement after t = 5 seconds
    ∫ t*tt from 0 to 5 is easy to integrate numerically
    But the problem is t ∫ tt I don't know how to do it because there is variable outside the integral.

    For those who don't know, I am using integration by parts formula for definite integral, it includes find the value of
    ( t ∫ tt ) from 0 to 5
    Last edited: Nov 17, 2017
  2. jcsd
  3. Nov 17, 2017 #2


    User Avatar
    Science Advisor
    Homework Helper
    2017 Award

    Hello pcmath, : welcome:

    You have ## \ a = t^t\ ## and with ##\ a = \displaystyle {dv\over dt} \ ## you get ##\ v = \int a\;dt\ = \int t^t\; dt##.

    Then , with ##\ v= \displaystyle {ds\over dt} \ ## you can write ##\ s = \int \left (\ \int t^t\; dt\ \right ) dt' ##. Written with bounds:$$
    s(t) = \int_{t'= 0}^t \left (\ \int_{t''=0}^{t' } t''^{(t'')} \; dt''\ \right ) dt' $$
    That is your double integral.
    is something I cannot agree with.

    You could do a double numerical integration using forward Euler
    $$ v(t+\Delta t) = v(t) + a(t) * \Delta t \\ s(t+\Delta t) = s(t) + v(t) * \Delta t \ $$ and you would indeed have to take very small steps because a(t) is so steep.
    Last edited: Nov 17, 2017
  4. Nov 17, 2017 #3


    User Avatar
    2017 Award

    Staff: Mentor

    If you just need this once do it with tiny integration steps (or check WolframAlpha). If you need it many times, it is worth implementing a better integration scheme - Verlet integration or one of the other methods discussed there.
  5. Nov 18, 2017 #4
    Thank you guys for your help, I will try it.

    This is actually correct as I have tried it. Assuming that a = x^2 then you can find s using that way, it gives the same value as integrate twice.
  6. Nov 18, 2017 #5


    User Avatar
    Science Advisor
    Homework Helper
    2017 Award

    Note that one successful example does not a proof constitute. It looks like integration by parts and then the question is: what is the time derivative of ##t^t##
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted