Time for Distance with variable velocity

Hi!
I have an object that is moving towards a wall. The closer it gets to the wall the slower it gets, but it reaches the wall with a certain velocity (it does not stop at the wall).
So the velocity is depending on the distance to the wall: v(x) = K*(x^2) where K is a constant.
At the beginning, the object is located with the distance L to the wall. How can I calculate how long it takes for the object to reach the wall? I know the function of the velocity.
Is there a fast way to solve that in matlab?
Thanks very much!

3 Kommentare

Teja Muppirala
Teja Muppirala am 8 Mär. 2011
You said "it reaches the wall with a certain velocity (it does not stop at the wall)"
However
v(x) = K*x^2 <--- This equals zero at the wall (v(0) = 0).
Can you clear up this miscommunication?
Paulo Silva
Paulo Silva am 8 Mär. 2011
If the starting point is L units from the wall than v(0)=0 should be your velocity at the wall, now it depends on the kind of motion, see http://en.wikipedia.org/wiki/Equations_of_motion , find the position equation that fits your motion and substitute the position values and speed, that will get you the time.
Steve
Steve am 8 Mär. 2011
Hi, I'm sorry, you're right. My Problem is correctly described like this:
At the beginning the object is located with the distance L (e.g. 100m) to the wall. When does it reach the distance D (e.g. 30m) from the wall.
Sorry for the confusion!

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

the cyclist
the cyclist am 8 Mär. 2011

0 Stimmen

This seems like a straightforward calculus problem, so I am not sure why you are trying to solve it in MATLAB. Is this homework for a MATLAB class? If so, I suggest you show us what you've managed to do so far in trying to solve it.
If this is homework in a calculus or physics class, I suggest you find a forum for help in those subjects.
Finally, you might want to check that you have the problem statement correct. I calculate that to go from a distance L1 to a closer distance L2, it will take
T = (1/L2 - 1/L1)/K
which goes to infinity as L2 approaches 0 (i.e. the wall).
I could be wrong, though. Been a long while since I've taken calculus (or even used it much).

3 Kommentare

Steve
Steve am 8 Mär. 2011
Hi, thanks for your answer. No, this is not for any class. I'm working on a project for myself but unfortunately I don't know how to solve this. So I thought there might be a standard function in matlab to do this.
I've described my problem a little bit wrong, correctly it must be:
At the beginning the object is located with the distance L (e.g. 100m) to the wall. When does it reach the distance D (e.g. 30m) from the wall.
Are you sure that your solution is correct? I've tried to solve the differential equation v=-k*x^2 (the minus because it gets slower). That would give me for x(t)=1/(k*t+1/L) and for the time in my case t=(1-(x/L))/(k*x), where I set x=30 and L=100.
Is that correct?
the cyclist
the cyclist am 9 Mär. 2011
Pretty sure that your answer and mine are equivalent. (I just used different variable names.)
Steve
Steve am 9 Mär. 2011
I just checked it.. you're right. The equation for t is
t = ((1/x)-(1/L))/k.
Thanks very much!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by