Message Boards Message Boards

0
|
4213 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Why does the 2/pi term appear in the units portion of the calculation below

Posted 3 years ago
In[783]= 
HB[P_, DD_, d_] := 2*P/(Pi*DD*(DD - (DD^2 - d^2)^(1/2)))
HB[{500, Quantity[1, "Kilograms"]}, {10, Quantity[1, "Millimeters"]}, 
{1.62, Quantity[1, "Millimeters"]}]

Out[784]= {240.975, Quantity[2/\[Pi], ("Kilograms")/("Millimeters")^2]}
POSTED BY: Edward Davis
2 Replies
Posted 3 years ago

Hi Edward,

Because lists are being passed to HB and many operations thread across lists.

Pi * {10, Quantity[1, "Millimeters"]}
(* {10 \[Pi], Quantity[\[Pi], "Millimeters"]} *)

Pass the right quantities instead

HB[Quantity[500, "Kilograms"], Quantity[10, "Millimeters"], Quantity[1.62, "Millimeters"]]
(* Quantity[240.975, ("Kilograms")/("Millimeters")^2] *)
POSTED BY: Rohit Namjoshi

Thank you thank you thank you......

POSTED BY: Edward Davis
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