Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

gerryliyana

Use of numerical integral method to calculate the length of the path has traversed the car during the time recording below

  • one year ago
  • one year ago

  • This Question is Closed
  1. gerryliyana
    Best Response
    You've already chosen the best response.
    Medals 0

    • one year ago
    1 Attachment
  2. Patapom
    Best Response
    You've already chosen the best response.
    Medals 2

    Don't you have more informations concerning the method of interpolation of the velocities ? Is this linear interpolation ?

    • one year ago
  3. Patapom
    Best Response
    You've already chosen the best response.
    Medals 2

    Well, assuming linear interpolation of velocities, you can write: \[V(t) = V0 + (V1-V0) t\]\[D(t) = \int\limits\limits_{0}^{t}v(x).x.dx\] Here, V0 and V1 are 2 consecutive values in your array. Like 124 and 134 for the first 2 values. D(t) is the distance you went through during time t. For this particular example of yours, we're going to always use t=6 because your time steps are constant and always equal 6 seconds. I used http://integrals.wolfram.com/index.jsp?expr=a+x+%2B+b+x%5E2&random=false to perform the integral (although it's very easy to write it yourself) so we find that: \[D(t) = \int\limits\limits_{0}^{t}v(x).x.dx\ = \left[ \frac{ V0 }{ 2 } t^2 + \frac{ V1-V0 }{ 18 } t ^{3} \right]\] When solving for D(6) (t varying in [0,6]) we get: \[D(6) = 18 V0 + 12(V1-V0) = 12 V1 + 6 V0\] All you need to do next is to write a loop that sums \[12 V1 + 6 V0\] for all you time intervals. It goes like: float SumDistance = 0; for ( int TimeStepIndex=0; TimeStepIndex < TimeValuesCount-1; TimeStepIndex++ ) { float TimeStepDistance = 6 * Velocities[TimeStepIndex] + 12 * Velocities[TimeStepIndex+1]; SumDistance += TimeStepDistance; }

    • one year ago
  4. Patapom
    Best Response
    You've already chosen the best response.
    Medals 2

    Sorry, my first equation should read: \[V(t) = V0 + \frac{ V1 - V0 }{ 6 } t\] because starting from V0 at t=0 second, we only reach V1 after 6 seconds...

    • one year ago
  5. Patapom
    Best Response
    You've already chosen the best response.
    Medals 2

    If the actual assignment was to perform numerical integration using many small time steps then I suppose my solution is wrong, instead you should go all code and write something like: int IntegrationStepsCount = 1000; // The more you use, the more precise it will get, but never as precise as an analytical integration obviously... float SumDistance = 0; for ( int TimeStepIndex=0; TimeStepIndex < TimeValuesCount-1; TimeStepIndex++ ) { float TimeStepDistance = 0; float StartVelocity = Velocities[TimeStepIndex]; float EndVelocity = Velocities[TimeStepIndex+1]; float IntegrationStepSize = 6.0 / IntegrationStepsCount; for ( int i=0; i < IntegrationStepsCount ; i++ ) { float CurrentVelocity = StartVelocity + (EndVelocity - StartVelocity) * i / IntegrationStepsCount; TimeStepDistance += CurrentVelocity * IntegrationStepSize; // Distance += Velocity * DeltaTime } SumDistance += TimeStepDistance; } This is a purely numerical integration...

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.