Solving a Basic Physics Problem in MATLAB: Finding Object's Position at t=10s

  • Thread starter Thread starter CR3
  • Start date Start date
  • Tags Tags
    Matlab Physics
AI Thread Summary
To find the object's position at t=10s given its velocity data, the trapezoidal integration method is recommended. Instead of calculating acceleration, the distance can be estimated by averaging the velocities at each second and multiplying by the time interval. This involves summing the distances calculated for each second based on the instantaneous velocities provided. The approach effectively integrates the velocity over time to yield the total distance traveled. Understanding this method allows for accurate position determination without needing advanced calculus knowledge.
CR3
Messages
2
Reaction score
0

Homework Statement



Problem from: A Concise Introduction to MATLAB (McGraw Hill)

pg. 346 # 6

A certain object moves with the velocity v(t) given in the table below:
Determine the object's position x(t) at t= 10s if x(0)= 3

Time (s) = [0,1,2,3,4,5,6,7,8,9,10]

Velocity (m/s) = [0,2,5,7,9,12,15,18,22,20,17]

Homework Equations





The Attempt at a Solution



I am having trouble with this problem because I have not had Calculus yet. I think it is a pretty basic Calculus problem but I have very little prior knowledge of Calculus so if anyone could explain this to me I would really appreciate it.

The only way I can think to solve it using what I do know is use the diff(v)./diff(t) equation in MATLAB to find the acceleration and then use the equation x(t) = x(0) + v(0)t + .5at^2 but I am not sure how to type this into MATLAB.

Thanks so much for your help.
 
Physics news on Phys.org
CR3 said:

Homework Statement



Problem from: A Concise Introduction to MATLAB (McGraw Hill)

pg. 346 # 6

A certain object moves with the velocity v(t) given in the table below:
Determine the object's position x(t) at t= 10s if x(0)= 3

Time (s) = [0,1,2,3,4,5,6,7,8,9,10]

Velocity (m/s) = [0,2,5,7,9,12,15,18,22,20,17]

Homework Equations





The Attempt at a Solution



I am having trouble with this problem because I have not had Calculus yet. I think it is a pretty basic Calculus problem but I have very little prior knowledge of Calculus so if anyone could explain this to me I would really appreciate it.

The only way I can think to solve it using what I do know is use the diff(v)./diff(t) equation in MATLAB to find the acceleration and then use the equation x(t) = x(0) + v(0)t + .5at^2 but I am not sure how to type this into MATLAB.

Thanks so much for your help.
You're going the wrong way - you don't need the acceleration. From the listed velocity values you can calculate distance the object has traveled. As a very simple example, if a car's velocity is 60 mi/hr and it travels at that velocity for two hours, then its position is 120 mi. from its starting position (d = vt).

Your problem is a little more complicated, but not too much more. You are given the instantaneous velocities at each second. At t = 0, v = 0. At t = 1, v = 2. I would estimate the distance as the average of the two velocities, and then multiply by the time elapsed.

Distance (first second) \approx (v(1) - v(1))/(t(1) - t(0)] = (2 - 0)/(1 - 0) = 2. Do the same thing for each 1-second interval, and then add up all of the distances. That will give you the total distance the object has traveled.
 
Thank you so much! This is so helpful!
 
What I've suggested is called trapezoidal integration, since you are in effect calculating the area of a bunch of trapezoids.

To get the acceleration, you take the derivative of the velocity, but to get the distance, you integrate the velocity. There are many techniques for numerical integration, of which the trapezoid method is just one.
 
Back
Top