I am trying to solve a problem involving collisions, oblique collisions to be exact.
First attempt:
VA1=2VB1=3m1=0.5m2=0.4ThetaA1=30ThetaB1=50VA1x = m1*VA1*cosd(ThetaA1);VB1x = m2*VB1*cosd(ThetaB1);syms VA2x VB2xequ1 = m1*VA1x + m2*VB1x == m1*VA2x + m2*VB2x;equ2 = -0.5*(VB1x - VA1x) == (VB2x - VA2x);sol = solve ([equ1,equ2],[VA2x,VB2x]);solVA2x = sol.VA2x;fprintf('solution is %i \n', solVA2x)
For my second attempt:
VA1=2VB1=3m1=0.5m2=0.4ThetaA1=30ThetaB1=50VA1x = m1*VA1*cosd(ThetaA1);VB1x = m2*VB1*cosd(ThetaB1);syms VA2x VB2xsol=solve([m1*VA1x + m2*VB1x == m1*VA2x + m2*VB2x , 0.5 == -(VB2x - VA2x)/(VB1x - VA1x)],[VA2x,VB2x]);C=sol.VA2x;E=sol.VB2x;fprintf('Value for VA2x %i \n',C);fprintf('Value for VB2x %i \n',E);
I am pretty unexperienced and willing to learn so any additional references would be appreciated. I have read that I should add vpasolve however I have already tried that and the results are the same.
Best Answer