0
^
|
|
|
|                   +
|                  +|
|                +  |
|              +    |
|            +      |
|          +        |
|        +          |
|      +            |
|    +              |
|  +                |
|+                  |
+----------------------------->
o                  x1

(X axis is distance and Y is acceleration)

Excuse my crappy ASCII graph but I can't post images so please imagine that the line made of + is actually a concave curve

My question is: knowing x1 how would I calculate the acceleration increase needed to get from O to x1 without overpassing x1?

  • 1
    It'll help if you could post a fuller explanation, as well as explain more clearly what your problem is, currently the question is very confusing. What kind of a system are you talking about? One can go between two points in space at a constant velocity, without any acceleration as well. Also, what does "overpassing" mean here? – Kitchi Feb 13 '13 at 11:38
  • It's a cartesian coordinate system. I know how to do a constant velocity but it's not what I need. By overpassing I mean going past the value of x1 ( for example when it reaches 1 unit before x1 and the acceleration is > 1 it would pass it) – user1233963 Feb 13 '13 at 11:45
  • 1
    Do you mean you want to stop at x1? Or reach a particular acceleration at the same time you reach x1? – Michael Feb 13 '13 at 12:27
  • 2
    If you have a clearer image please give a link to it and someone with the rep. can edit it into your post. – Michael Feb 13 '13 at 12:28
  • 1
    This reads like an XY problem. Please can you add more detail about the broader picture? That is, why do you want this question answered? What will you do with the solution? If you can answer that, we'll be able to give you better answers. – 410 gone Feb 13 '13 at 12:38
  • I want to use this to move a sprite (which is at x1) in my application on 1 axis until it gets to a point x2 with acceleration but I need a formula for the acceleration so that the sprite doesn't go past x2. I only know x1, x2, initial accceleration and speed = 0. Not sure how much clearer I can make this – user1233963 Feb 13 '13 at 12:54
  • 1
    There are many solutions to this problem depending on your requirements. Do you know the velocity at x1 and x2? Do you have to get from x1 to x2 in a certain amount of time? Do you need to stop at x2? Do you need realistic physics? - If it's a game or something you could maybe get away with just moving at a uniform velocity and stopping on a dime. – Michael Feb 13 '13 at 12:59
  • @user1233963: You could e.g. define initial and final state (position?, velocity?, time?) of the point particle; allowed accelerations (only constant jerk?); criteria for optimal solution (fastest time?; less fuel consumption?; the double integrator?), etc, etc. – Qmechanic Feb 13 '13 at 13:00
  • I managed to come up with this: http://www.wolframalpha.com/input/?i=%28sum+i%3D0+to+10+%28integrate+from+1+to+10+%28x%2Bi%29%29%29 ,the end of the curve seems about right. Any way to get the start of the curve to begin from a specific point on X ? – user1233963 Feb 13 '13 at 13:01
  • @MichaelBrown: the velocity at x1 is 0 because that's the starting point, I don't know the velocity at x2. There's no time limit. Yes, I need to stop EXACTLY at x2. It doesn't have to be very realistic. I can't get away with moving at a uniform velocity because this is a slidebar, so moving uniformly would look weird. – user1233963 Feb 13 '13 at 13:14
  • If you need to stop at x2 that means you do know the velocity at x2 has to be zero. :) Well then in your case the simplest solution is to pick any acceleration $a(x)$ you want until you get to the half way point $x = (x_1 + x_2)/2$, then exactly reverse that, accelerating at $-a(x_2 - x + x_1)$ until you reach a stop at $x_2$. You are guaranteed to come to a stop (if your numerical accuracy is good enough) since the acceleration profile is symmetric about the midpoint. – Michael Feb 13 '13 at 13:45
  • A simple function with the requisite behaviour is $a(x) = A \left(\frac{x_1 + x_2 - 2x}{x_2 - x_1}\right)$ where $A>0$ is the maximum acceleration. There are many other solutions which fit the bill as well. – Michael Feb 13 '13 at 14:03
  • See my answer below for more details. Hope it helps. – Michael Feb 13 '13 at 14:31

2 Answers2

0

If you know the initial velocity and final velocity then you can calculate the acceleration from the $O$ to $X_1$.

$v^2 = u^2 + 2as$

$v = $ velocity at point $X_1$
$u = $ velocity at point $O$
$s = $ distance traveled (which is $X_1$ units)
$a = $ acceleration of the point from $O$ to $X_1$

Here $a$ is nothing but the increment in the acceleration.

-1

This solution is based on the following interpretation of the OP's question (see the comments beneath the question):

Give a function $a(x)$ such that $a(x)$ is the acceleration of a particle at $x$:

$$ \ddot{x} = a(x) $$

and the motion is subject to the following boundary conditions:

$$ \begin{array}{lcl} x(0) &=& x_1 \\ \dot{x}(0) &=& 0 \\ x(T) &=& x_2 \\ \dot{x}(T) &=& 0 \end{array} $$

where the final time $T$ is unspecified and we take $x_2 > x_1$ for simplicity.

This is an ill-posed problem in the mathematical sense in that there are clearly many solutions. Any function $a(x)$ which obeys the condition

$$ a(\frac{x_1+x_2}{2} - x) = -a(\frac{x_1+x_2}{2} + x) $$

will satisfy the final constraint by symmetry.

A simple solution is

$$ a(x) = A \frac{x_1 + x_2 - 2 x}{x_2 - x_1} $$

for $A>0$. Integrating the equation of motion subject to the initial conditions gives

$$ x(t) = \frac{x_1 + x_2}{2} - \frac{x_2 - x_1}{2} \cos\left( \omega t \right) $$

where

$$ \omega \equiv \sqrt{\frac{2 A}{x_2 - x_1}} $$

The final time $T$, originally unspecified, can be found from the final condition $x(T)=x_2$:

$$ T = \frac{\pi}{\omega} = \pi \sqrt{\frac{x_2 - x_1}{2 A}}$$

Michael
  • 16,512
  • 2
  • 49
  • 69