Is it possible to solve this equation for $t$
$$x_f = x_0 + v_0t + \tfrac{1}{2}at^2~?$$
It feels like its a quadratic but since x final and initial are not the same and sometimes initial is not zero any idea?
I asked this question on physics stack over flow and someone gave me this answer
$$t=-v_0+{\frac{\sqrt{(v_0^2-2a(x_0-x_f)}}{a}}$$
which is not right in my understanding I'm solving a problem $$ x_0 = 0, x_f = 0, v_0 = 8.1\ a = -9.81$$ if I solve in the first equation I get 1.65 but -8.1 if I use the 2nd one
I'm trying to solve this by matlab this is why I use trying to separate the t
We are trying to find the positive real root of the equation $$\frac{1}{2}at^2+v_0t+(x_0-x_f).$$ Since this is a quadratic equation in $t$, it has roots at $$t=\frac{-v_0\pm \sqrt{{v_0}^2-4(a/2)(x_0-x_f)}}{2(a/2)}$$ Or more succinctly, $$t=\frac{-v_0\pm \sqrt{{v_0}^2+2a(x_f-x_0)}}{a}$$ Putting these into our equation, we get $$t=\frac{-8.1\pm \sqrt{{8.1}^2+2(-9.81)(0-0)}}{-9.81}$$ Simplifying and ignoring the zero root, $$t=\frac{-2\times 8.1}{-9.81}$$ Thus $t\approx 1.651.$