Message Boards Message Boards

0
|
1084 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to handle UM using Wolfram Language?

Posted 1 year ago

Hi, I'm trying to understand how WM handles UM.
That is I expect that a calculation should give some UM, but I don't succeed. Let's take as an example

(314.159 m Sqrt[((7.34102*10^-6 - 0.0000178801 I) s^2)/m^2])/s

The results should be a scalar that I can calculate using coth[] but I'm unable to "convince" WM to give me that,
Thanks for any help

3 Replies

Applying your second "trick" and crashing my head against the wall I've got the desired result. However plotting a graph with the resulting function is much faster (0.235151) when I disregard the UM's than when I use them (2.97654). Doing physics calculations with WM can be a nightmare.

$Assumptions = {m > 0, s > 0, kg > 0}
Z[x_] := Sqrt[R[x] K[x]] // Simplify;

Cleaner Thanks again

Look up Quantity in the documentation:

Quantity[314.159, "Meters"] *
 Sqrt[Quantity[7.34102*10^-6 - 0.0000178801 I,
    "Seconds"^2/"Meters"^2] ]/Quantity[1, "Seconds"]
% // Coth

You can also use your notation, but adding the information that s and m are positive:

(314.159 m *
   Sqrt[((7.34102*10^-6 - 0.0000178801 I)
        s^2)/m^2])/s
Simplify[%, s > 0 && m > 0]
POSTED BY: Gianluca Gorni
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