I'm trying to calculate the maximum velocity of an object given:
- acceleration
- deceleration
- starting position (0)
- ending position
- initial velocity
I've been trying to use formulas from: https://stackoverflow.com/questions/153507/calculate-the-position-of-an-accelerating-body-after-a-certain-time http://easycalculation.com/physics/classical-physics/constant-acc-velocity.php
but I still can't seem to figure it out.
The closest I've gotten is: $$t = \frac{V_{max} - V_0}{a} + \frac{0 - V_{max}}{d}$$
But even trying to solve that for Vmax leaves an unknown '$t$' in the equation, and doesn't take into account the ending position either.
A sort of real world example for this, if it helps, is of a car. The car starts at p=0, with a rolling start (in either direction). At the finish line (ending position) is a brick wall. The car must stop with the front bumper touching the brick wall. It must accelerate at a for as long as possible, then decelerate at d, ending at that brick wall, with v=0.
(I'm writing an Arduino library for controlling servos, with speed limits, acceleration and deceleration. I need to know whether the max velocity it can reach given the acceleration and deceleration will ever exceed the max velocity the library user specifies, so I can calculate whether there needs to be any time spent "coasting" between acceleration and deceleration.)