# Software for unit aware calculations?

When doing engineering calculations it is great convenience to do have software that keeps track of units.

Example when calculate something trivial as stress:

$\sigma = \frac FA$

And be able to write:

$\frac {1kN}{1m*1mm}$ and get the answer in MPa

This is by nature a poll thread that i know is frowned upon on StackOverflow, is it going to be closed?

-
One of the top search results for "units software" is the appropriately named GNU Units, which lets you say "You have: ten furlongs per fortnight / You want: kilometers per hour" and tells you "0.0059871429". – Rahul Nov 1 '12 at 9:08
Write that as an answer, I guess F# is an answer too though I was looking for a GUI app. – Johan Larsson Nov 1 '12 at 9:11

The Squants library provides units of measure for Scala, including a natural-language DSL:

val load1: Power = Kilowatts(12)        // returns Power(12, Kilowatts) or 12 kW
val load2: Power = Megawatts(0.023)     // Power: 0.023 MW
val sum = load1 + load2                 // Power: 35 kW - unit on left side is preserved
sum should be(Kilowatts(35))
sum should be(Megawatts(0.035))         // comparisons automatically convert scale

val load1 = 100 kW                  // Simple expressions don’t need dots
val time = 3.hours + 45.minutes     // Compound expressions may need dots


-

I'll throw my hat in the ring too. Maxima [1] has an add-on package ezunits which carries out various dimensional operations. Quantities can be symbolic (e.g. x meters per year) as well as numerical. The notation is, I hope, convenient: single left quote to indicate units, double left quote to indicate conversions. For the given example:

load (ezunits);
F : 1  kN;
A : 1  m * 1  mm;
sigma : F/A  MPa;
=> 1  MPa


There's more to be said, but I'll let it be enough for now. Disclaimer: I wrote the ezunits package.

-

You might be interested in Frink.

It has an interpreter that you can download as a desktop app. It also has a web interface, which lets you type

in  >> 1 kN / (1 m * 1 mm)
out >> MPa


to get

result >> 1 MPa


There is a list of sample calculations covering a wide variety of physical applications.

-

There is SpeQ Mathematics for Windows environments. It is probably more of what your looking for.

http://www.speqmath.com/index.php?id=1

-

One of the top search results for "units software" is the appropriately named GNU Units, which lets you say

You have: ten furlongs per fortnight
You want: kilometers per hour


and tells you "0.0059871429".

-
I feel a little silly posting an answer that's basically "I googled your question and got this", but there it is. – Rahul Nov 1 '12 at 15:47
Can still be some use with a comprehensive list. I up-voted. – Johan Larsson Nov 1 '12 at 16:05

MathCad handles units in a nice way but it is too expensive for home use.

-

I'll add F# to the list.

Floating point and signed integer values in F# can have associated units of measure, which are typically used to indicate length, volume, mass, and so on. By using quantities with units, you enable the compiler to verify that arithmetic relationships have the correct units, which helps prevent programming errors.

-