## Creating and Editing Equations

Word+Equate makes extensive use of the Equation Designer. The designer is standard functionality in Word 2010. The Equation Designer is a tool which is able to format complex mathematical equations correctly, allowing for Greek characters, subscripts, superscripts and other mathematical symbols. The designer has a good understanding of mathematical formatting practice.

The example above shows an example of an equation built in the Equation Designer. By careful placement of parentheses, the layout (and meaning) of the equation can be controlled. For example, in this equation, additional parentheses are placed around the contents of the square root. This causes the square root symbol to have a long top bar. The actual parentheses are not displayed, but remain in the underlying definition. Usage of the Equation Designer is discussed further, below.

To enter a new equation, hit “Alt” + “=”. An empty dialog box is created at the selected location.

To define a variable in Word+Equate the operator “:=” is used. To display the value of a variable then a simple “=” is used.

The following defines a new variable “a” as a value of 5 metres.

If the meaning is clear, Word+Equate will convert an "=" to a ":=" automatically. If for example you type "a=5m" and "a" has not been previously defined, then the line is automatically updated to "a:=5m".

The following is then an equation that uses this variable. The operator “:=” is used as we are defining a new variable “area”. The “=” is used = we want to display the result.

On leaving the Equation Designer, the document is updated to the following.

The value of “25” has been automatically calculated and the unit for the variable “area” has been automatically as square metres. Note also that the equations have been colour formatted. Variables are dark blue in definitions, red for previously defined, known variables and grey for units. This gives visual feedback that the equations are defined correctly.

To use an alternate unit, specify the required after the “=”.

On leaving the designer, the result is displayed. Any specified unit stays as the unit for that equation.

Note that an “=” is used as we are reporting a value. The variable “area” is red as it has been previously defined.

The Word menu ribbon contains a tab “Calculations”. This tab is added by the Word+Equate add-in and is used to define default units.

Changing the default length unit from metres to millimetres causes the document to be updated.

The first equation remains in metres, as this is the unit with which it was initially designed. The second equation has been updated to square millimetres as millimetres are now the default length unit. The third equation remains in square feet as this is the defined unit.

## Using the Equation Designer

In order to create documents efficiently it is important to master the Equation Designer. The Equation Designer has been designed by Microsoft to allow correct formatting of mathematical equations. It was not designed to solve them. That is the additional functionality that Word+Equate provides.

Previously we used “Alt-=” to open a new equation. When we did, a new tab appeared on the Word menu ribbon titled “Equation Tools – Design”.

This tab provides a wide range of options to format an equation. Most are for quite advanced mathematical operations not currently supported by Word+Equate, but several are useful.

You can however use the tab to fetch Greek letters, often used in mathematical equations. To find the Greek letters, select the drop down arrow to the right of the symbols and choose “Greek Characters”.

Then choose an individual character.

To calculate the circumference of a 5 metre circle, add this equation.

Word+Equate has the values of a number of variables (such as π) pre-set. It appears in grey to show it is a constant and not a previously defined variable.

It is possible to overwrite a pre-defined constant and make it a normal variable. For example, the variable “g” is predefined as gravitational acceleration (9.81m/s^{2}) but the variable name can be reused for another purpose.

A faster method of adding Greek characters, however, is to use “back-slash” notation. Enter the variable name as “\pi” and when complete the designer will substitute this for a correct “π” character.

Frequently variables used in equations from manuals or codes use subscripts. A sub-scripted variable might be “A_{2}”. In normal text, using word, a subscript is created using the font menu. The process is different within the equation designer. It is possible to define subscripts using the Script options in the Structures part of the ribbon tab.

A faster method, however, is to type an underscore. The variable “A2” can be written as “A_2”. Once the variable is complete, the Designer will reformat it.

Similarly, a variable can be raised to a higher power using the “^” character. The equation “a:=b^{2}” can be initially typed as “a:=b^2”.

An equation written as

Is reformatted, in an easier to verify format, as

Equations are defined in what is called “linear” format. It is then converted to “professional” format as shown above. To view the contents of an equation in “linear” format, right click on the equation. The context menu shown below appears and linear can be selected. After viewing or editing the equation can be converted back into professional format using the same menu.

Default Units

The units are displayed based on the default selection in the Calculations tab. The Default Units section shows the default unit for each primary quantity.

For example the default output for force in set ‘kN’ so if our variable is defined in ‘N’ the result will be evaluated in ‘kN’ as shown below. Changing the default to ‘N’ in the drop down list will display the variable in N.

The unit default can be overridden by entering the desired unit string after the equal: “2120N=N”

Any variable with an explicitly defined unit retains that unit regardless of any changes to the unit default. Any variable not explicitly defined uses the default unit and the displayed unit will be updated when the default is changed.

## Scientific Notation and Decimal Precision

The accuracy with which variables are displayed is defined in the Accuracy section of the calculations tab.

Values are typically displayed based on the precision specified in the Decimals drop-down. Changing the drop-down value changes the displayed precision of all variables.

The internal precision of all variables is double precision i.e. approximately 14 decimal places. The selection of display accuracy has no effect on any internal calculations.

If the value is too large or too small to be displayed, the display changes to scientific notation. Optionally, engineering notation can be selected.

## Calculate

The Calculate section of the Calculations tab controls when calculations are updated.

By default all calculations are carried out automatically. Updating occurs when you leave an Equation Designer. All equations dependent on the changed equation are updated.

If “On Command” is selected, equations are only updated when “Refresh” is selected. This can have some performance advantages on large files.

Equations are processed in their written order as you would expect in a sequential document. A variable can only be used if it has been defined above. A variable can be redefined within a document. Its value is that defined in the nearest equation above.

## Handling Errors

If Word+Equate is unable to resolve an equation, an error is reported. The reported error maybe caused as the result of invalid syntax or an error in the logic of the calculation. The error is reported as a Microsoft Word comment tag. Once the error is corrected the tag is automatically cleared.

The error tags use “w+e” as the user initials. They therefore do not interfere with tags used for comments or review mark up.

In the example below, the array “a” is defined with 2 elements. An attempt to address the third element results in an “index out of range error”. Similarly a square root of a negative number causes an error.

Error tags can be disabled in the ribbon menu. The number and “?” displayed after the “=” also indicates an error.