## Units in Euler Math Toolbox

Units have long been an integral part of EMT. I want to show you a few examples. First, let us talk about the non-metric system the US is still using. Quote: „Nobody understands the metric system! We use teaspoons!“.

>1inch
0.0254
>1in -> " cm"
2.54 cm
>inch$, in$
0.0254
0.0254
>1ft -> inch
12
>1yard -> ft
3
>1mile -> yard
1760
>1mile -> km
1.609344


As you see, you simply append the unit to a number and it will be converted into the metric system (in case you do not know that’s meters and kilograms). The units are stored in global variables which end with $. These variables are visible even within functions. So units work in functions too. There is also a conversion operator -> which can either convert to text or to numbers, depending on the type of the parameter after the ->. See the examples. But there is more to it. Often we use fractions or powers of units. EMT can handle that too. Let us start with fractions. In the following example, we introduce a new unit „nautical mile“ which is missing in EMT but will be present in future versions. >sm$ = 1852.216;
>160sm/h -> " m/sec"
82.3207111111 m/sec


As you see, we can now easily convert nautical miles per hours (knots) to meter per second. Assume an airplane departing with 90 knots is forced to use a climb of 200 feet per nautical mile. We want to compute the feet per minute climb which we can read from the VSI.

>200ft/sm * 90sm/h -> " ft/min"
300 ft/min


Of course, you can do this (at least approximately) in the head, if you multiply the numbers and divide by 60. E.g., at 120 knots, you need to double the ft/sm requirement. For just another example, let us compute the sink rate which is necessary at 190 knots to obtain a 3° glide path.

>200ft/sm * 90sm/h -> " ft/min"
300 ft/min
>190sm/h * tan(3°) -> ft/min; print(%,unit=" ft/min")
1008.50 ft/min


The example shows still another way to print with units. By the way, the degree symbol behaves like a unit in many ways.

For further examples, here are some american kitchen units. You will also notice that EMT can handle powers in units on both sides.

>10cm^3
1e-005
>cup$= 236.5882365liter/1000 0.0002365882365 >tablespoon$ = cup$/16; >teaspoon$ = tablespoon\$/2;
>1teaspoon -> " cm^3"
7.39338239062 cm^3
>1liter -> teaspoon
135.256090807


08. April 2016 von mga010
Kategorien: English, Euler | Schreibe einen Kommentar

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.