Message Boards Message Boards

0
|
4119 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Simplifying units (found method)

Posted 9 years ago

So I just started using Mathematica today and I'm trying to figure out how to get my units to come out correctly solving a simple kinematic equation. Searched through the domain on the website and I wasn't able to find anything that I could decipher.

ClearAll["Global`*"]
v1 = UnitConvert[Quantity[100, "kilometers / hour"], "meters / second"];
v2 = UnitConvert[Quantity[60, "kilometers / hour"], "meters / second"]
d = Quantity[1000, "meters"];
a = Quantity[-0.05,  "meters / second^2"] ;
time = NSolve[v1 + a*t == v2, t] 

I keep getting the output of {{t->222.2s/None}}. How can I fix the code to just get the output in seconds?

POSTED BY: IK C
Posted 9 years ago

I rewrote the code without the UnitConvert and that fixed the problem.

POSTED BY: IK C
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract