I'm not sure where to ask this question. I solved some equations by hand, and I know the answer is right. I can't get `solve` to give me the same answer, and I'm wondering why.
It's a physics problem with two objects and conservation of momentum. Their final velocities are v_1f and v_2f. The question is "what is u when the two velocities are equal".
Why doesn't `solve` give me that value for `u`?
syms m m_1 m_2 v_1 v_2 v_1f v_2f u;
expression1 = (v_1*m_1 + v_1*m + u*m) / (m+m_1);
expression2 = (v_2*m_2 + m*(v_1f-u)) / (m_2 + m);
eq1 = v_1f == expression1
eq2 = v_2f == expression2
eq3 = v_1f == v_2f
solve([eq1 eq2 eq3], u)
answerByHand = -(m_2*(m + m_1)*(v_1 - v_2))/(m*(m + m_1 + m_2))
X = simplify(subs(expression1,u,answerByHand))
Y = simplify(subs(subs(expression2,v_1f,expression1),u,answerByHand))
It might be useful or interesting to know more about the physics problem...
It's about 2 astronauts in zero-gravity throwing a mass between them.
Everything is 1-dimensional. v_1 and v_2 are the initial velocities of the two astronauts. They are both moving to the right. #2 is initially faster. #1 throws a mass (m) to #2, at relative speed u. v_1f and v_2f are their final velocities. So the question is: how fast must #1 through the mass m so that the two astronauts have the same speed after astronaut #2 catches it.
The equations come from the conservation of momentum (m*v).