I have the following code in Mathematica that represents two balls being thrown, one with a velocity v10 (6 in this case) and another ball thrown with a velocity v20 (its just dropped) one second later:
v10 = 6
v20 = 0
a = -9.8
t0 = 0
v1[t_] = Integrate[a, t] + v10
v2[t_] = Integrate[a, t] + v20
x1[t_] = Integrate[v1[t], t] + h
x2[t_] = Integrate[v2[t], t] + h
eq1 = (t /. Solve[0 == x2[t], t]) + 1
eq2 = t /. Solve[0 == x1[t], t]
eq4 = Solve[eq1[[2]] == eq2[[2]]]
{{h -> 0.410596}}
h is the height the balls begin at in order to meet the ground at the same time. All is good. But as soon as I plug in a variable, V, for the velocity v10 everything falls apart:
v10 = V
v20 = 0
a = -9.8
t0 = 0
v1[t_] = Integrate[a, t] + v10
v2[t_] = Integrate[a, t] + v20
x1[t_] = Integrate[v1[t], t] + h
x2[t_] = Integrate[v2[t], t] + h
eq1 = (t /. Solve[0 == x2[t], t]) + 1
eq2 = t /. Solve[0 == x1[t], t]
eq4 = Solve[eq1[[2]] == eq2[[2]]]
{h -> 1.61298*10^-61 (5.40298*10^92 - 1.10265*10^92 V + 5.62576*10^90 V^2 - 1. (-2.32443*10^46 + 2.37187*10^45 V) Sqrt[ 5.40298*10^92 - 1.10265*10^92 V + 5.62576*10^90 V^2])}, {h -> 1.61298*10^-61 (5.40298*10^92 - 1.10265*10^92 V + 5.62576*10^90 V^2 + (-2.32443*10^46 + 2.37187*10^45 V) Sqrt[ 5.40298*10^92 - 1.10265*10^92 V + 5.62576*10^90 V^2])}
Then if I go further and try to plug 6 back into the equation for V:
x[V_] = h /. eq4[[1]]
x[6]
2.62065*10^31
This is obviously the wrong answer. Am I missing something here?
Solve[x10 == x2[t], t]
. Note the undefined variablex10
. $\endgroup$