# Solving Equations with units is not working

I have the code

    Clear[distance, time, Vavg];
Solve[Quantity[Vavg, "Meters"/"Seconds"] ==
Quantity[distance, "Meters"]/Quantity[time, "Seconds"], distance]


The Answer is

{{distance -> time Vavg}}


I wonder why doesnt it shows the units in meters ... Please help

• Also tried Solve[Quantity[Vavg, "Meters"/"Seconds"] == Quantity[distance, "Meters"]/Quantity[time, "Seconds"], Quantity[distance, "Meters"]], which give {} as result... Lol wtf – TraceKira Jun 4 '17 at 15:05
• Because the units are getting cancelled as solve sees it. What (v m/s) == (dist m)/(t s), when solved for dist simply gives v t because the units have cancelled. Use just dist without units and solve it. – Lotus Jun 4 '17 at 15:05
• Units are not cancelled totally. Remains only meters. – TraceKira Jun 4 '17 at 15:07
• Look at the equation (v m/s) == (dist m)/(t s) and tell me which unit remains Both m and s get cancelled don't they ? – Lotus Jun 4 '17 at 15:18

## 1 Answer

If you put distance inside Quantity[#,"Meters"]& you can think of it as a unitless number that you are multiplying by "Meters".

Alternatively

Clear[distance, time, Vavg];
Solve[Quantity[Vavg, "Meters"/"Seconds"] == distance/Quantity[time, "Seconds"], distance]

(* {{distance -> time Vavg (Quantity[1, "Meters"])}} *)


shows how you can an answer with units attached.

• Looks nice , but before accepting the answer .... why it works if i dont put any units on distance. And another question , how do i apply to the solution the values 0.25 m/ s and 4.00 minutes ? – TraceKira Jun 4 '17 at 15:12