# Finding time it will take an object to move from point a to point b

**URL:** <https://community.wolfram.com/t/finding-time-it-will-take-an-object-to-move-from-point-a-to-point-b/590>\
**Category:** Questions\
**Tags:** computer-science, physics, mathematica, graphics-and-visualization\
**Created:** [September 20, 2013, 11:09pm UTC](https://community.wolfram.com/t/finding-time-it-will-take-an-object-to-move-from-point-a-to-point-b/590 "2013-09-20T23:09:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![darasuum](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@darasuum](https://community.wolfram.com/u/darasuum)\
**Post date:** [September 20, 2013, 11:09pm UTC](https://community.wolfram.com/t/finding-time-it-will-take-an-object-to-move-from-point-a-to-point-b/590/1 "2013-09-20T23:09:20Z")

</div>

Hello.  
&nbsp;&nbsp;&nbsp;&nbsp;An object is observed to move along the x-axis with a varying velocity; v(x)=C[x(d?x)]^1/2, where C=9.0/s and d=48.0m  
&nbsp;&nbsp;&nbsp;&nbsp;A. Use computer simulation to calculate the time it will take for the object to travel from x=0 to x=d.  
Hint: Subdivide the x-axis into N parts of width ?x=d/N. The time for the object to move from xn to xn+1 is ?t=?x/v(x\_a); here x\_a=0.5(x\_n + x\_n+1). Now add up all the time intervals.  
&nbsp;&nbsp;&nbsp;&nbsp;B. Calculate the max speed during this time (plot the function)

```auto
c = 9.0;
d = 48.0;
n = 10;
v[x_] := c (x (d - x))^(1/2)
r = Range[0, d, d/n]
p = Partition[r, 2, 1]
xa = Mean /@ p
deltaV = v /@ xa
deltaT = (d/n)/deltaV
Total[deltaT]
Plot[v[x], {x, 0, d}]
FindMaximum[v[x], x]

```

Here’s a code from Mathematica program  
Top speed is = 216 at x = 24  
But how to find time it will take for x to travel from 0 to 48?

---

<div class="post-metadata">

**Author:** ![grifri](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/grifri/32/23694_2.png) [@grifri](https://community.wolfram.com/u/grifri)\
**Post date:** [September 22, 2013, 9:48pm UTC](https://community.wolfram.com/t/finding-time-it-will-take-an-object-to-move-from-point-a-to-point-b/590/2 "2013-09-22T21:48:33Z")

</div>

I think you shoud integrate 1/V over x from 0 to d to get time:

```auto
Clear[c, d, V]
V[x_] := c Sqrt[x (d - x)]

```

```auto
Integrate[1/V[x], {x, 0, d}, Assumptions -> d > 0]

```

You’ll obtain pi/c and if c=9 then time is equal to 0.349066. Note that if you inrease the value of the parameter n up to, say, 10^7, then you get 0.349023. I’m not sure if the integration procedire is a possibility for your excercise but it’s a good example of what it is useful for.
