Hi,
I am new to Maple and doing a trivial calculation raised a few questions. I tried to calculate the average density of a wire with the following specs:
- diameter = .40 inches
- length = 1000 feet
- weight = 61 pounds
Here's what I have come up with.
with(Units[Standard]):
wirediameter:=.40[inch]:
wirelength:=1000[ft]:
wirevolume:=(wirediameter/2)2 * Pi * wirelength:=
wireweight:=61[lb]:
wiredensity:=wireweight/wirevolume
I get a result of: (3517.654557[kg/m3])/π. I then had to (Rt Click | Approximate | 5) and Replace units] from kg/m3 to g/cm3
Going through this process left me with a few questions:
- Can I get Maple to approximate π to a few decimal places automatically or will any calculation involving π give me a result with the letter? Should I just use 3.1415 instead? For the purposes of this calculation, four decimal places is more than sufficient. To be honest, throwing the spool of wire into a pool would really give me the information I need :)
- Can I get Maple to give me results in specific units without the need to (Rt Click | Units | Replace Units)? I tried to specify wiredensity[g/cm3] but that didn't give me the results I wanted.
- Can I "preload" the Units package (is that the right term?) so that I don't have to manually call it every time I want to use units?
Many thanks,
Perry
![> with(Units[Standard]); > wirediameter := Units[Natural][`*`](.40, Unit('inch')); > wirelength := Units[Natural][`*`](1000, Unit('ft')); > wirevolume := Units[Natural][`*`](Units[Natural][`*`](Units[Natural][`^`](Units[Natural][`*`](wirediameter, Units[Natural][`/`](2)), 2), Pi), wirelength); print(??); # input placeholder print(??); # input placeholder > wireweight := Units[Natural][`*`](61, Unit('lb')); > wiredensity := Units[Natural][`*`](wireweight, Units[Natural][`/`](wirevolume));]()