anonymous
  • anonymous
Use of numerical integral method to calculate the length of the path has traversed the car during the time recording below
Computer Science
chestercat
  • chestercat
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this
and thousands of other questions

anonymous
  • anonymous
1 Attachment
anonymous
  • anonymous
Don't you have more informations concerning the method of interpolation of the velocities ? Is this linear interpolation ?
anonymous
  • anonymous
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; }

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
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...
anonymous
  • anonymous
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...

Looking for something else?

Not the answer you are looking for? Search for more explanations.