Question: Solving equation with units problem

Hi,

What am I doing wrong? Seems like some unit compatibility problem when tryaing to solve simple task with momentum conservation rule...

with(Units);
Automatically loading the Units[Simple] subpackage


m__2 := 0.400*Unit('kg');
m__1 := 0.300*Unit('kg');
x__w := 0.700*Unit('m');

v__2p := 0.000;

v__1p := 2*Unit(('m')/('s'));



Download zadanie_z_jednostakim_-_problem.mw

m__1*v__1p + m__2*v__2p = m__1*v__1k + m__2*v__2k;
                                               /s\
             0.6 = (0.3 v__1k + 0.4 v__2k) Unit|-|
                                               \m/


subs(v__2p = 0, 0.600 = (0.300*v__1k + 0.400*v__2k)*Units[Unit](s/m));
                                               /s\
             0.6 = (0.3 v__1k + 0.4 v__2k) Unit|-|
                                               \m/

v__1k := solve(0.600 = (0.300*v__1k + 0.400*v__2k)*Units[Unit](s/m), v__1k);
                                                  /m\
           v__1k := (-1.333333333 v__2k + 2.) Unit|-|
                                                  \s/

 

1/2*m__1*v__1p^2 + 1/2*m__2*v__2p^2 = 1/2*m__1*v__1k^2 + 1/2*m__1*v__2k^2;


Error, (in Units:-Simple:-+) the following expressions imply incompatible dimensions: {.1500000000*(-1.333333333*v__2k+2.)^2*Units:-Unit(J)+.1500000000*Units:-Unit(kg)*v__2k^2}

Sitting and trying find solution in help and on forum but no chance.

I hope if someone copy code into maple it will look lik on my screen. Anyway I have uploaded file and below You have screen picture.

If I remove units from variables on the top all is working like a charm.

Please help me find an error guys.

Reagrds

Marcin

Please Wait...