# PSION ORGANISER II Formulator

All rights reserved. This manual and the programs referred to herein are copyrighted works of Psion PLC, London, England. Reproduction in whole or in part including utilisation in machines capable of reproduction or retrieval, without the express written permission of Psion PLC is prohibited. Reverse engineering is also prohibited.

The information in this document is subject to change without notice.

Psion and the Psion logo are registered trademarks of Psion PLC.
Psion Organiser II, Datapak and Rampak are trademarks of Psion PLC.

Please note that formulae provided in this product are designed to illustrate the utility and application of the Formulator. Users must satisfy themselves as to the validity and applicability of any individual formula before use.

Psion accepts no liability for loss, including consequential loss, arising from the use of the formulae contained herein.

Part No. 6100-0074
V1Apr89

## Introduction

The Formulator can work out almost any calculation that can be expressed as a formula. On the Formulator pack there are over 250 formulae. You can use these supplied formulae and you can also enter your own extra ones.

The supplied formulae cover a huge range of common calculation areas, including:

• Finance, e.g. loan repayment
• Statistics, e.g. Poisson probability
• Physics and electronics, e.g. parallel resistance
• Chemistry, e.g. the ideal gas law
• Conversions, e.g. metric to imperial

To enter an extra formula of your own, you just type it in on one line. You only have to type it once - as you save it and use it again later. As a simple example, you could enter a formula to convert litres to pints:

PINTS=LITRES*1.76

Whenever you used this formula, the Formulator would ask you for a value in litres, and display the result in pints.

The Formulator occupies about 4K of Organiser memory, It works on all models.

#### The manual

Chapter 1 explains how to run the Formulator and how to enter and use your own formulae. Chapter 2 explains how to find, save and erase formulae. Chapter 3 has more detail about the format of complex formulae.

Chapter 4 explains how to use the supplied formulae, which are listed in Appendix B.

Chapter 5 explains how to use the Formulator in conjuction with OPL.

Note: The screen messages on the different Organiser models vary slightly - so your screen may not show exactly the same words as the examples in this manual.

## 1 Getting started

### Running the formulator

To run the program:

• Insert the Formulator pack in either of slots B: or C:, and press ON/CLEAR from the main menu.

This adds the option "XFORM" near the end of the main menu.

• To select it, on a Model CM or XP just press X, and on Model LZ or LZ64 press X twice and then press EXE.

The prompt XFORM: appears, and you can use the Formulator. The screen shows:

Model CM or XP:

XFORM:_

Model LZ or LZ64:

f 3:00p   XFORM:_

Using the Formulator is similar to using the Organiser calculator. However, since you type words as well as numbers, the keyboard is normally set to letters.

Once you have added the "XFORM" option, you can if you wish remove the Formulator pack. If you do this, don't press ON/CLEAR when the main menu is displayed, as this removes the "XFORM" option and you then have to reload it from the pack.

### The single-calculation formula

In the introduction, there was a simple example formula to convert litres to pints:

PINTS=LITRES*1.76

• To try out thr Formulator, type this in after the "XFORM:" prompt and press EXE. (You have to use SHIFT to type numbers in a formula.)

You are then prompted for the number of litres to convert to pints, like this:

LITRES=

• Type in the number of litres. (The keyboard is automatically set to numbers when entering values.)

When you press EXE to enter the number, the screen shows the result. So if you entered the number 3, the screen shows:

PINTS=5.28

• Press SPACE and you are returned to the "XFORM:" prompt, with the formula ready to be edited or run again.

Normally, when you type in one of your own formulae you would save it for future use. This is covered in the next chapter.

#### Prompts and result names

When the Formulator runs a simple formula it evaluates the sum on the right of the equals sign, here LITRES*1.76, prompting you for the necessary values, here LITRES.

It then displays the result name (the text on the left of the equals sign), here PINTS, followed by the result it has calculated.

• Prompts names for input should begin with a letter and may contain letters, numbers and space characters.
• Result names may contain any characters, other than equals signs "=", colons ":" and commas ",".

### The multiple-calculation formula

The litres-to-pints formula from the previous section can be altered to produce a second result in gallons, as follows:

PINTS=LITRES*1.76;GALLONS=PINTS/8

This formula now contains two calculations, separated by a semicolon.

• Type this in at the "XFORM:" prompt.

If the formula from the previous section is still there, you can edit it in the usual way. Move around with the cursor keys (↑ and ↓ take you straight to the beginning and end of the line). Use DEL to delete characters, and just type in extra ones.

• Press EXE to run the formula.

As before, you are prompted to enter the number of litres to convert to pints. In the second calculation, GALLONS=PINTS/8, the value for PINTS from the first calculation is automatically used.

The results - in this case, PINTS and GALLONS - are displayed one to a line.

• Press SPACE to return to the XFORM: prompt, with the formula ready to be edited or run again.

This example shows how any result or input value in a formula, here the value of PINTS, can be used anywhere else in the formula. It is not even necessary to arrange the calculations in the correct order, the example could have been entered like this:

GALLONS=PINTS/8; PINTS=LITRES*1.76

When two or more prompts are required, they appear on the screen in turn, according to their position from left to right in the formula. This means that you can swap formulae around to change the order in which prompts appear.

• If a formula produces more results than there are lines on the screen, use ↑ and ↓ to move up or down the result list.

A formula may contain up to 16 different prompts and result names, and up to 16 separate calculations.

#### Abbreviating names

You can abbreviate any prompt or result name when you re-use it in a formula, as long as you use at least the first three characters of the name.

In the previous example, the second occurrence of PINTS could have been typed as PIN or PINT, like this;

PINTS=LITRES*1.76; GALLONS=PIN/8

The Formulator matches things like PIN and PINTS, whatever order they are in.

Take care not to accidentally use prompt names whose first three characters match. If, for example, you tried to run a formula containing prompts for both COST and COST2, the Formulator would treat them as one, and only prompt for COST2.

### Valid expressions

When entering a formula, or typing a number in response to a prompt, you can use any expression which OPL allows, just as you can in the calculator. For example:

2 2+3 \$18 a hexadecimal number SIN(5) an OPL function PI**2 an OPL function DATAGET%:(2,3) a call to an OPL procedure

You should ensure that none of your prompts conflict with the numeric OPL functions "PI", "SECOND", "MINUTE", "HOUR", "DAY", "WEEK", "MONTH", "YEAR", and "RND", or with the logical operators "AND", "OR", and "NOT". The Formulator would evaluate these in the same way that OPL does.

Similarly, you should not use "M0" to "M9" as prompts as these clash with the names of the calculator memories.

See the chapter on operators in the OPL section of your Organiser manual for more detail of the mathematical syntax in OPL.

#### Cancelling a formula

You can cancel the execution of a formula by just pressing ON/CLEAR when you are prompted for a number.

Note that pressing ON/CLEAR while the Formulator is running a formula may cause the Organiser to pause, just as it does in OPL. If you then press Q to Quit, you cancel the calculation; if you press any other key the calculation continues.

### Leaving the Formulator

To leave the Formulator, just press ON/CLEAR at the XFORM: prompt. This returns to the Organiser's main menu.

If you then wish to free the memory used by the Formulator, remove the datapak and press ON/CLEAR.

## 2 Finding and saving formulae

You can save formulae and find them again to re-run at any time. Just as Find and Save on the main menu use a data file called MAIN, Find and Save in the Formulator use a data file called XFORM.

### Saving a formula

To try saving a formula, return to the XFORM: prompt and type:

FEET=METRES*3.28

• Press EXE to run it, then type the number of metres. The number of feet is displayed. Press SPACE to return the formula to the XFORM: prompt.
• Now press MODE to get this menu:

Find Save Erase

• Press S to select Save. The Save prompt appears followed by the current device name, here B:

SAVE B:FEET=METRES*3

• Use MODE again, it necessary, to select device A:, if you want to save the formula in the internal memory. At this point you can also, if you wish, re-edit the formula.
• Press EXE, and your formula is saved in the XFORM data file on device A:.

You can now run the formula again, edit it, or press ON/CLEAR to clear it

#### Duplicate result names

You can't have more than one formula in the XFORM data file which has the same left-hand side.

For example, if you have already saved the metres-to-feet formula above on A:, try typing in and saving this formula on A: too:

FEET=METRES*3.28; YARDS=FEET/3

As the first formula you saved also begins with FEET=, you aaked:

Overwrite Y/N

If you press Y, you delete the first formula and save this new one in its place. If you press N, you keep the first formula and do not save the new one.

### Finding a formula

There are two ways of finding formulae - a quick method and a menu method.

#### Finding a formula

The quickest way to find a formula which has been saved is to:

• Type a search clue at the XFORM: prompt. This can't contain an equals sign - as it would be taken as a new formula. Press EXE.

The XFORM: prompt changes to a FIND prompt, followed by the device name, and the search starts on that device.

• If you wish to change the current device, press MODE. This not only changes the device but also starts searching there automatically.

For example, if you saved the metres-to- feet formula in the previous section:

• Type METRES at the XFORM: prompt.
• Press EXE to start the search.

If the device in use is not A:, use MODE to change device, and search there.

When a formula containing the search text that you typed if found it is displayed.

If the formula is the right one:

• You can now press EXE to run the formula, or ON/CLEAR to return to the XFORM: prompt to edit it.

If the formula is the not right one:

• Press ↓ to find the next formula containing your search clue.

Pressing ↑ returns to the previous matching formula. Once the end of the XFORM data filehas been reached, the search starts again at the beginning. If there are no formulae containing the search clue, this message is displayed:

Pressing ON/CLEAR will in this case return to the XFORM: prompt with the search text.

To see all the formulae on a device, just press EXE at the XFORM: prompt and keep pressing ↓.

There is also a "FIND" option on the Formulator menu, which may be used as an alternative to the quick method.

It operates in th same way as Find on the main menu. You should use this option instead of the quick method if your search text contains an equals sign, or if you prefer to be able to use EXE instead of ↓ to search down the data file for further matches.

• Press MODE to get to the menu, then F or EXE.
• Use MODE if necessary to change device, then type your search text and press EXE.
• When you have found the formula you want, press ON/CLEAR to return with it to the XFORM: prompt. You can then run it or edit it.

LZ users should note that you cannot use the wild cards * and + to search in the Formulator.

### Erasing a formula

The "ERASE" option on the menu acts in a similar way to the "Find" option.

• Press MODE then E when at the XFORM: prompt, and press MODE if necessary to change the device.
• Type a small part of the formula you wish to erase, and press EXE.

For example, to erase the metres-to-feet formula if you saved it earlier, make suure you're on device A: then type METRES or FEET.

The first matching formula is displayed.

• Use ↑ and ↓ until you find the formula you want to delete, You can also use MODE again at this point to change the device you are searching on.

When you have found the formula:

• Press DEL, and confirm this by pressing Y. The formula is deleted and the next matching one is displayed.
• Press ON/CLEAR to leave the "ERASE" option and return to the XFORM: prompt.

### Decimal places

You can specify that a result from a formula is displayed to a certain number of decimal places.

• To do this, put a colon after the result name followed by the number of decimal places required (from 0 to 9).

For example, the following formula converts litres to pints, and displays the result to two decimal places:

PINTS:2=LITRES*1.76

This only affects the final display of the results, not the calculations, which are always performed to 12 digit accuracy.

### Intermediate results

You can also specify that a result is just to be used for intermediate calculations and not shown in the final display of results.

• To do this, just put a colon after the result name.

For example, when calculating the area of a triangle from the lengths of its sides, the value of half the sum of the lengths must be calculated, and then used several times in the final calculation. A suitable formula for this is as follows (but all on one line):

HS:=(S1+S2+S3)/2; AREA=SQR(HS* (HS-S1) *(HS-S2)*(HS-S3))

HS stands for half the sum of the sides. As it is followed by a colon it is only an intermediate result, and is not shown in the final display of results. S1, S2 and S3 are the three sides which are prompted for.

#### Forcing the order of prompts

As mentioned in chapter 2, you can change the order in which values are prompted for by rearranging the formula. There may be cases, however, where it is difficult do this. You can then use a dummy intermediate result instead.

• To do this, use a colon with no name before it.

For example, to cause the value UNITS, to be the first prompt, even if normally it would appear near the end of the formula, you can begin your formula like this:

:=UNITS;

This dummy calculation uses an intermediate result with no name, purely to ensure that the name on the right of the equals sign (which would be used later in the formula) is the first value prompted for.

### Titles

You can begin a formula with a title which is displayed before the list of results. This is very helpful as a confirmation to you when you find the formula, and it is ideal to use as search clue.

• Follow your title with a comma. A title may contain any characters, except those such as "=" which are significant.

In the supplied formulae, ">" is used to mean "to" in conversions. Following this style, you could rewrite the litres-to-pints formula like this:

LITRES>PINTS,PINTS=LITRES*1.76

When the formula is run, the title LITRES>PINTS is displayed before the list of results.

## 4 Using the supplied formulae

#### Finding the formula you want

The formulae supplied on the Formulator pack are stored in an ordinary data file, called "XFORM". There is a list of them in Appendix B.

Most of the formulae begin ith a title, and if a formula is a conversion, "to" is represented by ">". For example, there are several formulae to convert between different units of volume, including one to convert from litres to other liquid unit; its title is Litres>. To find this formula:

• Just type: LITRES> at the XFORM prompt, and press EXE

If the current device is not the one containing the Formulator pack, use MODE to change to a different device and start using it.

The formula is displayed, scrolling round - you can use ← and → to control this.

• To run this formula, press EXE. (Or to see the other two formulae containing the search clue LITRES>, press ↓.)
• When you run the formula, enter a number of litres, then use ↓ and ↑ to examine the list of results.

The list includes the number of litres you specified, so you can check the value you typed. There are brackets round the word Litres. This is because Litres=Litres can't be used to force the Formulator to display Litres as a result, as this would be a "circular reference" (see Appendix A), so (Litres)=Litres is used instead.

### Copying the formulae to device A:

You may want to copy some of the supplied formulae from the Formulator pack to the internal memory (device A:).

• Storing the formulae you want on device A: means you can remove the Formulator pack.
• It also makes finding and saving formulae faster, and you don't waste Datapak space if you re-edit formulae.

Even if your Organiser has a lot of free memory, it is not a good idea to copy the entire "XFORM" data file to A:, since filling up memory will affect calculation speed. It is better to copy the formulae you want, one by one. For example, you could copy the supplied formula which converts litres to other liquid units.

• First, find the formula on the Formulator Datapak by typing LITRES> at the XFORM: prompt. (Use MODE if necessary, to select and search on the device which contains the datapak.)

The formula is displayed.

• Press ON/CLEAR to return to the XFORM: prompt with the formula.

At this stage you can, if you wish, modify it to your own requirements.

• Now press MODE and S to enter the "SAVE" option, and use the MODE key to select device A:.
• Press EXE, and the formula is saved in the "XFORM" data file on device A:.

You can now run or edit the formula again. You can freely modify formulae on A:, since the originals still exist as backup on the Formulator datapak.

A few of the supplied formulae use OPL programs which are supplied on the Datapak. To copy these formulae to device A: and run them from there, either copy their OPL programs as well or leave the Datapak plugged in when you run them.

### Analysing a formula

• The first thing in a formula is a title; the title ends in a comma.
• Semicolons separate the different calculations. Generally the order of calculations is from left to right.
• Each calculation contains a result name followed by an equals sign.
• If the result name is followed by a colon and a number, it will be displayed to that number of decimal places.
• If the result name is followed by just a colon, it is an intermediate result to be used in calculations but not to be displayed in the final list of results.
• The text on the right of the equals sign is the calculation. It may contain names whose values will be prompted for, and names whose values are calculated elsewhere in the formula.

See chapters 1 and 3 for more details.

#### Making substanstial changes to formulae

If you wished to make substantial changes to the formulae, you could use the Psion Comms Link to transfer the XFORM data file to a desktop computer for editing. You can also modify the XFORM data file using OPL.

### Functions provided

This is a list of the functions provided by the supplied formulae. The actual formulae are printed in the appendix.

The titles and key words which are useful as search clues are printed in bold here.

• Try finding and running a few formulae to see the prompts they give display and the results they give.

If a formula does not quite suit your requirments, you can easily modify it and save the changed version on A:.

Note that although all calculations are performed to 12 digit accuracy, many of the constants used in the formulae have less than 12 digits, adjust them if you require greater accuracy

#### Financial

The data file begins with financial formulae. Some of these are specific to the U.K., but you can adjust them, if necessary.

They include conversion between price, net and VAT (UK 15% sales tax); mark up and discount; compound interest, current value, annuity future and current, loan repayment and APR, repayment mortgage, endowment mortgage and take home pay.

The UK 15% sales tax formulae (for VAT) are followed by the corresponding formulae for France 18.6%, France 33%, Germany 14%, Austria 20%, Portugal 16%, Spain 12%, Italy 18%, Belgium 19%, Holland 20%, Turkey 12% and Morocco 19%.

You can adapt the UK formulae for use with a US sales tax by replacing every occurrence of 15 in the formula by the correct percentage.

For the formulae involving interest rates, the prompt Incrs Per Year refers to the number of times per year the accrued interest is added to the capital sum - daily, weekly, monthly, quarterly or yearly.

The mortgage repayments calculate the repayments first with no allowance for tax, then under MIRAS, assuming a tax rate of 25%. Additional payments may be required, so you should consult the lending institution for the total cost.

The take home pay formulaa apply to the UK, in the years 1989/90, assuming non-contracted out N.I. contributions and tax in the 25% tax bracket - however, you can adjust it. Because of rounding errors and discrepancies between weekly and monthly N.I. contributions, the result may be out by a few pence.

Note that when a prompt ends with a % sign you should type in a percentage, not a fraction: e.g. to specify 75%, type 75, not 0.75.

#### Number converter

The next formula is a number converter. You can only give it as input a simple decimal number, octal number (prefixed by the letter 'O'), or hexadecimal number (prefixed by '\$'). It then lists the number in all three notations.

#### Mathematics and statistics

Then comes a group of mathematical and statistical functions and formulae.

This includes factorial, Gamma function, Beta function, Bessel function of the 1st kind, Euler numbers, Bernoulli numbers, Rieman Zeta function, and Chebyshev polynomial (1st and 2nd) for values between zero and one; binomial distribution, binomial probability, Poisson probability, chi-squared distribution, Student's t distribution and normal probability.

Some of the above formulae may take some time to execute since they rely on the convergence of series.Remember that you can always exit from a calculation by pressing ON/CLEAR and Q.

#### Geometry

The next group contains geometry formulae. These are triangle sizes (SAS for specifying side-angle-side, SAA for side-angle-angle and SSS for side-side-side), triangle area, regular polygon (from edge length, short radius and long radius), circle, sphere, and cone (from height and slant).

There then follow conic formulae: two formulae for calculating the Y and X of a parabola, three for the Y, X and eccentricity of an ellipse, and three for the Y, X and eccentricity of a hyperbola.

#### More mathematics

Next come asin, acos, hyperbolic functions, sum arithmetic series, sum geometric series, real quadratic (equation with real solutions), complex quadratic (equation with imaginary solutions), complex arithmetic (add, subtract, multiply, divide, exp, sinh and cosh), polar coords (to and from cartesian), polar arithmetic (add, multiply and divide), spherical coords (to and from cartesian), vector dot product and vector cross product.

#### Conversions

The following formulae are conversions. In each case, the units which are converted from are also the title of the formula, followed by a ">" character meaning "to". The titles are in groups here, each group separated by a "/".

If, for example, you want to convert from metres to microns, you need the third formula whose title is "metres>", the one in the group which converts microns, angstroms, and fermis.

inches>, feet>, yards>, miles>, nautical miles (nmiles>), metres> and km>/ fathoms>, yards> and metres>/ microns>, angstroms>, fermis> and metres>/
Au>(astronomic units), light years>, parsec> and metres>/
BMU>, points>, picas>, inches> and cm>/
sq inches>, sq feet>, sq yards>, acres>, sq miles>, sq metres>, hectares> and sq km>/
fl oz>, pints>, gallons>, litres>, US gallons> and barrels>/
cu inches>, cu feet>, cu yards>, cc> and litres/
oz>, pounds>, stone>, CWT>, short tons>, long tons>, kg> and tonnes>/
oz fine or troy>, oz avoirdupois>, and gram>/
sec of arc>, min of arc>, degrees> and radians>/
seconds>, minutes>, hours>, days>, weeks> and years>/
MPH>, FPS> (feet per second), KPH>, metres/sec> and knots>/
milesUKg>, milesUSg>, and kmLitres>/
poundals>, lbf> and newtons>/
dynes> and newtons>/
joules>, ergs>, calories>, therms>, btu> and KWH>/
joules>, eVolt>, Hertz>, Kelvin> and kg>/
PSI> (pounds per square inch), Pascals>, mmHg>, inHg>, Millibars> and atmosphere>/
Tesla> and Gauss>/
Curie> and Becquerel>/
Horsepower> and Watts>/
RPM> and Hertz>/
electron masses (em>), proton masses (pm>), neutron masses (nm>) and Kg>.

UK nautical miles have been used, which are equal to 6080 ft. International nautical miles are 1852 metres, so one UK nautical mile is approximately equal to 1.00064 international nautical miles.

IT calories have been used, equal to 4.1868 joules. Thermodynamic calories are 4.1840 joules.

#### Physics and chemistry

The next section is concerned with physical and chemical formulae. It covers Watts (from Amps and Volts, Amps and Ohms, and Volts and Ohms), Joules (from farads and volts), Farads (from Joules and volts), Volts (from amps and ohms), Amps (from volts and ohms) and Ohms (from volts and amps); constant acceleration formulae (where units are unspecified they should be determined by the user), including velocity (from either time or distance), distance (from either time or final velocity), and energy (from initial and final velocity); some fundamental relationships including force (from mass and acceleration), momentum (from velocity and mass), final speed when two objects moving in the same direction collide, circular motion acceleration (from velocity and radius) and centripetal force (from velocity, radius and mass); unit definitions for Joules (from newtons and metres) and newtons (from Kilograms and acceleration); lens focal length (from image and object distance) and image distance (from object distance and focal length); pendulum period (from pendulum length); earth satellite velocity and period (from height); Resistance value of two resistors in parallel; charge growth and charge decay for an RC circuit; Amps growth and Amps decay for an RL circuit; Volts, Amps and Impedance for an AC series circuit, resonant frequency for a LC circuit and Coulombs Law for force, energy and voltage; pressure and volume from Boyles law; Adiabatic gas law and Ideal gas law; Joules from expanding gas (isothermal) and expanding gas (adiabatic); denier (from Kilograms and metres), Kg (from deniers and metres) and metres (from deniers and Kilograms). Rads/hour (from Curies, MeVolts and metres) and radiation decay (from initial radiation, half life of source and time).

Next come navigational formulae including radar range, sea horizon, extreme range and approximate barometer correction (each from feet and metres), true speed and bearing (from apparent speed, apparent bearing, drift speed and drift bearing) and apparent speed and bearing (from true speed, true bearing, drift speed and drift bearing).

#### Miscellaneous

The list of formulae ends with new exposure time for photo printing (from old exposure, old distance from lens and new distance from lens), and wall area, ceiling and total area of a rectangular room (from width, length and height).

A few of the formulae (the APR formula, the number converter and some of those concerning statistics and probability) use OPL programs which are supplied on the Datapak.

## 5 Using the formulator from OPL

Using XFORM: is like calling one of your own OPL procedures - so remember the final colon.

You can use it to simply run a formula:

XFORM:("formula")

Or to find then run one:

XFORM:("search-clue")

#### Running formulae from the main menu

You can use XFORM: to run formulae stright from the main menu. For example, you could enter a simple one-line OPL procedure called P:

P: XFORM:("PINTS=LITRES*1.76")

When you've translated and saved the procedure, you could insert its name as an option on the main menu. Whenever you select this option, it will run the formula.

### Finding and running formulae

To search for a formula from within a procedure, pass XFORM: a search clue instead of a formula. (The clue can't contain "=".) For example:

XFORM:("WATT")

This will search "XFORM" data file for a formula which contains the search text and you can then use ↑ and ↓ to search for different formulae, or MODE to change the device.

When you press EXE, the Formulator will execute the formula, and then return to wherever you ran the procedure from.

If you press ON/CLEAR you return to OPL without having run a formula.

See the OPL section of your Organiser manual for how to enter, translate and save an OPL procedure.

## APPENDIX A ERROR MESSAGES

If a formula contains an error, a message is displayed when you run it. The message may come from the Formulator or OPL.

• You should press SPACE, correct the formula, and try running it again.

#### The four formulator errors are:

CIRCULAR REF:
The formula contains a "circular reference", such as the LITRES result depending on PINTS while the PINTS result depends on LITRES. The Formulator is unable to find a place to begin calculation. One of the names in the circle is displayed after the message.

TOO MANY NAMES
The formula has more than 16 different prompts and result names.

TOO MANY CALCS
The formula contains more than 16 separate calculations.

REPEATED RESULT
The formula assigns to the same result name twice.

#### The most likely OPL errors you may get when using the Formulator are:

STRING TOO LONG
The result list is more than 254 characters in length (add one character for the end of every line).

OUT OF MEMORY
The Formulator has run out of memory while trying to calculate a formula.

DIVIDE BY ZERO
Division by zero was attempted - e.g. you specified 0 payments per year in the loan repayments formula.

SYNTAX ERROR
The formula contains an error and could not be calculated.

The arguments to an OPL function are of the wrong type, such as sin(x,y).

MISSING PROC
A formula referred to a procedure which does not exist anywhere on the Organiser. This happens if you copy a formula which calls an OPL program to A: and run it from there when the datapak containing the OPL program has been removed.

FN ARGUMENT ERR
An invalid input combination was used, such as entering 2 as input to the ACOS formula, or specifying the three sides of a triangle as lengths 1, 1 and 3.

An invalid character such as % has been used.

A meaningless number, such as 2.3.4 has been used, or an invalid number of decimal places was specified for the display of a result

MISMATCHED ()'s
The left and right brackets in a formula do not match up.

EXPONENT RANGE
A number is too large to be held, e.g. the factorial of 100.

An attempt has been made to call the Formulator either from within itself or from within the calculator.

TYPE MISMATCH or MISMATCHED "
One or more quote characters (") have been used in a calculation.

If you come across such an error press SPACE to re-edit the formula at the "XFORM:" prompt.

## APPENDIX B Supplied formulae

All the formulae supplied on the Formulator Datapak are printed in this appendix.

Note that although each formula is one line only on the Organiser, many of them here carry over on to more.

#### Financial

UK 15%,VAT:2=Price*(.15/1.15);Net:2=Price-VAT;(Price):2=Price UK 15%,Price:2=Net*1.15;VAT:2=Price-Net;(Net):2=Net France 18.6%,TVA:2=Prix*(.186/1.186);Net:2=Prix-TVA;(Prix):2=Prix France 18.6%,Prix:2=Net*1.186;TVA:2=Prix-Net;(Net):2=Net France 33%,TVA:2=Prix*(.33/1.33);Net:2=Prix-TVA;(Prix):2=Prix France 33%,Prix:2=Net*1.33;TVA:2=Prix-Net;(Net):2=Net Germany 14%,MWSt:2=Preis*(.14/1.14);Netto:2=Preis/1.14;(Preis):2=Preis Germany 14%,Preis:2=Netto*1.14;MWSt:2=Preis-Netto;(Netto):2=Netto Austria 20%,MWSt:2=Preis*(.20/1.20);Netto:2=Preis/1.20;(Preis):2=Preis Austria 20%,Preis:2=Netto*1.20;MWSt:2=Preis-Netto;(Netto):2=Netto Portugal 16%,IVA:2=Preco*(.16/1.16);Liquido:2=Preco/1.16;(Preco):2=Preco Portugal 16%,Preco:2=Liquido*1.16;IVA:2=Preco-Liquido;(Liquido):2=Liquido Spain 12%,IVA:2=Precio*(.12/1.12);Neto:2=Precio/1.12;(Precio):2=Precio Spain 12%,Precio:2=Neto*1.12;IVA:2=Precio-Neto;(Neto):2=Neto Italy 18%,IVA:2=Prezzo*(.18/1.18);Netto:2=Prezzo/1.18;(Prezzo):2=Prezzo Italy 18%,Prezzo:2=Netto*1.18;IVA:2=Prezzo-Netto;(Netto):2=Netto Belgium 19%,BTW:2=Prijs*(.19/1.19);Netto:2=Prijs/1.19;(Prijs):2=Prijs Belgium 19%,Prijs:2=Netto*1.19;BTW:2=Prijs-Netto;(Netto):2=Netto Holland 20%,BTW:2=Prijs*(.20/1.20);Netto:2=Prijs-BTW;(Prijs):2=Prijs Holland 20%,Prijs:2=Netto*1.20;BTW:2=Prijs-Netto;(Netto):2=Netto Turkey 12%,KDV:2=Fiat*(.12/1.12);Net:2=Fiat-KDV;(Fiat):2=Fiat Turkey 12%,Fiat:2=Net*1.12;KDV:2=Fiat-Net;(Net):2=Net Morocco 19%,TVA:2=Prix*(.19/1.19);Net:2=Prix-TVA;(Prix):2=Prix Morocco 19%,Prix:2=Net*1.19;TVA:2=Prix-Net;(Net):2=Net Price:2=Cost*(1+Mark Up%/100);(Cost):2=Cost Sale Price:2=Price*(1-Discount%/100);(Price):2=Price Compound Interest,Balance:2=Deposit*(1+Annual Rate%/(100*Incrs Per Year))**(Years*Inc) Current Value,:2=Future Value*(1+Annual Rate%/(100*Incrs Per Year))**(-Years*Inc) Annuity Value,Future:2=Annual Amount*(((1+Annual Rate%/(100*Incrs per Year))**(Years*Incr)-1) /(Annual R/100));Current:2=Annual A*((1-(1+Annual R/(100*Incr))**(-Years*Incr))/(Annual R/100)) Loan Repayment,:=Loan;Rate:=Annual Rate%/(100*Number Payments per Year); :2=Loan*Rate/(1-(1+Rate)**-(Years*Number)) Loan Repayment(APR),:=Loan;Rate:=(1+APR%/100)**(-1/Number Payments per Year); :2=Loan*((1-Rate)/(1-Rate**(Years*Number))/Rate) APR%:1=apr:(Loan/Payment,Number Payments per Year,Years) Repayment Mortgage,:=Loan;Rate:=Annual Rate%/100;X:=(1+Rate)**Years;Monthly :2=Loan*Rate*X/(12*(X-1)); Z:=1+Rate*.75;Z1:=Z**Years;Monthly(MIRAS):2=-(Loan<=30000)*(Loan*Z1*(Z-1)/(Z1-1)/12)-(Loan>30000)* (Monthly -625*Rate) Endowment Mortgage - does not include policy premiums,:=Loan;Rate:=Annual Rate%/1200;Monthly :2=Rate*Loan; Z:=Loan+(Loan>30000)*(Loan-30000);Monthly(MIRAS):2=(Loan-.25*(Loan+(Loan>30000)*(Loan-30000)))*Rate Take Home Pay(to 10/89),A:=Annual Salary*(1-Pension%/100); NI:=-A*.05*(A>=2236)-.02*A*((A>=3900)+(A>=5980))+.09*(A-16900)*(A>16900);Y:=A-Allowance; Z:=-.25*Y*(Y>0)-.15*(Y-20700)*(Y>20700);Pay:2=(A-NI-Z)/12;Tax:2=Z/12;N.I.:2=NI/12;Pension :2=(Annual-A)/12 Take Home Pay(from 10/89 to 4/90),A:=Annual Salary*(1-Pension%/100); NI:=-(A>2236)*(.09*(A+(A-16900)*(A>16900))-156.52);Y:=A-Allowance;Z:=-.25*Y*(Y>0)-.15*(Y-20700)*(Y>20700); Pay:2=(A-NI-Z)/12;Tax:2=Z/12;N.I.:2=NI/12;Pension :2=(Annual-A)/12

Converter,:=Hex:

#### Mathematics and statistics

Factorial,=fact:(int(r));(r)=int(r) Gamma:4=Gamma:(n);(n)=n Beta:4=Gamma:(n)*Gamma:(m)/Gamma:(n+m);(n)=n;(m)=m Bessel:4=JBessel:(n,x);(n)=n;(x)=x Euler=euler:(int(n));(n)=int(n) Bernoulli=bernli:(int(n));(n)=int(n) Zeta=zeta:(int(n));(n)=int(n) Chebyshev Poly 1st,Y:=atan(sqr((1/(x*x))-1));:8=cos(n*Y) Chebyshev Poly 2nd,Y:=atan(sqr((1/(x*x))-1));:8=sin((n+1)*Y)/sin(Y) Binomial Coefs,=binomial:(int(n),int(r));(n)=int(n);(r)=int(r) Binomial Dist,=binomial:(int(n),int(r))*(p**r)*((1-p)**(n-r));(n)=int(n);(r)=int(r);(p)=p Poisson Prob,=exp(-a)*(a**int(r)/fact:(int(r)));(a)=a;(r)=int(r) Chi:4=Chi:(p%,n);(p%)=p%;(n)=n t Dist,Certainty%:4=100*Tdist:(int(n),x);(n)=int(n);(x)=x Normal Prob:4=normal:(x);Ordinates:4=exp(-x*x/2)*.39894;(x)=x

#### More mathematics

Asin:2=deg(atan(x/sqr(1-x*x)));(x)=x Acos,t:=deg(atan(sqr((1/(x*x))-1)));Acos:2=t-(x<0)*(180-t-t);(x)=x Hyperbolics,Y:=exp(x);Z:=exp(-x);COSH=(Y+Z)/2;SINH=(Y-Z)/2;TANH=1-2/(exp(2*X)+1);(x)=x Sum Arithmetic Series,=(First Term+Last Term)*No of Terms/2 Sum Arithmetic Series,=First*No of Terms+Increment*No of T*(No of T-1)/2 Sum Geometric Series,:2=First*(1-R**No of Terms)/(1-R) Real Quadratic,:=a;R:=sqr(b*b-4*a*c);X1:8=(-b+R)/(2*a);X2:8=(-b-R)/(2*a);(a)=a;(b)=b;(c)=c Complex Quadrtic,:=a;I:=sqr(-b*b+4*a*c);Real:8=-b/(2*a);Imag(+/-):8=I/(2*a);(a)=a;(b)=b;(c)=c Complex Add,:=a;:=b;:=c;:=d;Real=a+c;Imag=b+d Complex Subtact,:=a;:=b;:=c;:=d;Real=a-c;Imag=b-d Complex Multiply,:=a;:=b;:=c;:=d;Real=a*c-b*d;Imag=a*d+b*c Complex Divide,:=a;:=b;:=c;:=d;X:=c*c+d*d;Real=(a*c+b*d)/X;Imag=(b*c-a*d)/X Complex Exp,X:=exp(a);Real:9=X*cos(b);Imag:9=X*sin(b) Complex Sinh,X:=exp(a);Y:=exp(-a);Real:9=(X*cos(b)-Y*cos(-b))/2;Imag:9=(X*sin(b)-Y*sin(-b))/2 Complex Cosh,X:=exp(a);Y:=exp(-a);Real:9=(X*cos(b)+Y*cos(-b))/2;Imag:9=(X*sin(b)+Y*sin(-b))/2 Polar Coords,r=sqr(x*x+y*y);Z:=deg(atan(y/x))-180*(x<0);theta:4=Z-(Z<0)*360;(x)=x;(y)=y Polar Coords,x=r*cos(rad(theta));y=r*sin(rad(theta));(r)=r;(theta)=theta Polar Add,:=r1;T1:=theta 1;:=r2;T2:=theta 2;Z:=pi-rad(T1-T2);r3=sqr(r1*r1+r2*r2-2*r1*r2*cos(Z)); X:=T1+(1+2*(((T2<T1)and((T2+180)>T1))or((T2>T1)and(T2>(T1+180))))) *deg(atan(sqr((1/(1-(sin(Z)/r3*r2)**2))-1)));theta 3:4=X+360*((X>=360)-(X<0)) Polar Multiply,:=r1;T1:=theta 1;:=r2;T2:=theta 2;r3=r1*r2;Z:=T1+T2;theta 3:4=Z+(Z>360)*360 Polar Divide,:=r1;T1:=theta 1;:=r2;T2:=theta 2;r3=r1/r2;Z:=T1-T2;theta 3:4=Z-(Z<0)*360 Spherical Coords,:=x;:=y;:=z;r=sqr(x*x+y*y+z*z);A:=deg(atan(y/x))-180*((Y<0)and(X<0)); phi:4=A-360*(A<0);B:=z/r;C:=deg(atan(sqr((1/(B*B))-1)));Theta:4=(C-180)*(z<0)-C*(z>0);(x)=x;(y)=y;(z)=z Spherical Coords,:=r;P:=rad(phi);T:=rad(theta);x=r*sin(T)*cos(P); y=r*sin(T)*sin(P);z=r*cos(T);(r)=r;(phi)=phi;(theta)=theta Dot Product,:=A1;:=A2;:=A3;:=B1;:=B2;:=B3;=A1*B1+A2*B2+A3*B3 Cross Product,:=A1;:=A2;:=A3;:=B1;:=B2;:=B3;i=A2*B3-A3*B2;j=A3*B1-A1*B3;k=A1*B2-A2*B1

#### Physics and chemistry

Radar range,Nmiles:1=2.21*sqr(Height in Metres);Km:1=1.85*Nmiles Sea Horizon,Nmiles:1=2.12*sqr(Height in Metres);Km:1=1.85*Nmiles Extreme range,Nmiles:1=2.12*(sqr(Observer Height in Metres)+sqr(Object Height in Metres));Km:1=1.85*Nmiles Barometer Correction to Mean Sea Level,approx:1=Metres/8-Celsius*Metres/2100 A:=App Speed;B:=App Bear;C:=Drift Speed;D:=Drift Bear;X:=pi-rad(B-D);True Speed:2=sqr(A*A+C*C-2*A*C*cos(X)); Y:=B+(1+2*(((D<B)and(D+180>B))or((D>B)and(D>B+180))))*deg(atan(sqr((1/(1-(sin(X)*C/True Speed)**2))-1))); True Bear:0=Y+360*((Y>=360)-(Y<0)) A:=True Speed;B:=True Bear;C:=Drift Speed;D:=Drift Bear;X:=rad(D-B);App Speed:2=sqr(A*A+C*C-2*A*C*cos(X)); Y:=B-(1+2*(((D<B)and(D+180>B))or((D>B)and(D>B+180))))*deg(atan(sqr((1/(1-(sin(X)/App Speed*C)**2))-1))); App Bear:0=Y+360*((Y>=360)-(Y<0))

#### Miscellaneous

Photo printing,New Exposure:2=Old exposure*(New Height/Old Height)**2 Rectangular room,Wall Area=2*Height*(Width+Length);Ceiling/Floor=Width*Length;Total Area=Wall+2*Ceiling

## Index

Input types

#### K

Keyboard mode, (2) ON/CLEAR

#### X

XFORM data file XFORM: entry prompt OPL instruction