Message Boards Message Boards

GROUPS:

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

Posted 5 months ago
580 Views
|
2 Replies
|
0 Total Likes
|
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]}
2 Replies
Posted 5 months 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] *)

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

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