Calculations Window

Maxsurf has two ways of performing calculations on the model:

·   Calculations from the Data menu

·   Calculations in the Calculations Window

 

In this section the Calculations window will be discussed. For more information on the calculations available from the data menu, see the Calculations section on page 170.

 

In the Calculations window, Maxsurf is capable of evaluating calculations entered by the user and solving them in a form much like a simple programming language. These calculations may be simple arithmetic expressions, or may include variables that are pre-calculated by Maxsurf. Formulae, together with relevant comments, are displayed on the left, with the result of each calculation displayed in the second column. You can also add comments (e.g. units of the result) in the right hand column.

Note:

- Although the calculations window allows user customisable calculations, more accurate results can be achieved by using the calculations from the data menu. This is recommended in case there is no need for customised calculations.

- The calculations sheets provided with Maxsurf are examples only. They should be checked thoroughly before use in your office, and your attention is drawn to the conditions of use outlined in the disclaimer at the front of this manual. Also ensure that you are using the Calculation sheet consistent with your current Units setting.

Expressions

Expressions use standard arithmetic notation and are evaluated based on the level of precedence of their operators, and their left to right ordering. Precedence levels determine the order of computation of expressions. For example, a multiplication (level three) would be computed before an addition (level four). The operators and their precedence levels are:

 

( )

PARENTHESES

Level one

^

EXPONENTIATION

Level two

*,  /

MULTIPLICATION, DIVISION

Level three

+, -

ADDITION, SUBTRACTION

Level four

Statement Syntax

Syntax for each statement should be similar to the following:

Built-in Variables

Built-in variables contain information about the volume enclosed by the surfaces being designed, and the plane specified by the Datum Waterline (DWL). Once the DWL has been positioned and the Frame of Reference set up correctly, Maxsurf determines the waterline length and calculates data for 13 immersed stations (stations 0 to 10, plus half stations 0.5 and 9.5), in addition to several general variables. Station 0 is the forward-most station and Station 10 the aft-most. The variables available to be included in calculations are:

 

SPACING

Immersed Station Spacing

MAXA

Maximum Immersed Sectional Area

MAXB           

Maximum Waterline Beam

MAXD

Maximum Draught

STAT0. .STAT10

Immersed Station Position

SA0 . . SA10

Immersed Sectional Area

DR0 . . DR10

Draft

WLB0 . . WLB10

Waterline Beam

IGIR0 . . IGIR10

Immersed Girth

TGIR0 . . TGIR10

Total Girth

CAH0 . . CAH10

Transverse Centre of Immersed Area

CAV0 . . CAV10

Vertical Centre of Immersed Area (above DWL)

 

Half stations at 0.5 and 9.5 have the following variable names:

 

STAT0.5

Immersed Station Position at position 0.5

STAT9.5

Immersed Station Position at position 9.5

Likewise for the fields :

SA, DR, WLB, IGIR, TGIR, CAH, CAV.

 

Note:

- The station positions used for the volumetric analysis of the hull in the calculations are completely independent of the station positions set up by the Grid Spacing function from the Data Menu. Maxsurf determines the position of the STAT0 to STAT10 variables, and therefore the SPACING variable, purely on the position of the Datum Waterline you have specified.

- The calculations performed in the Maxsurf calculations window use 13 sections. The Hydrostatic and Area calculations available from the data menu use a number of sections that is dependent on the precision setting in Maxsurf, where for example medium uses 50 sections. The calculation results will be different each time a different number of sections are used. The hull shape is approximated most accurately at highest precision (200 sections). For more information see Calculations.

Built-in Functions

Built-in functions provided are:

 

PI

Pi

SIN(x)

Sine of x

COS(x)

Cosine of x

TAN(x)

Tangent of x

LN(x)

Logarithm to base e of x

ARCTAN(x)

ArcTangent of x

SQRT(x)

Square root of x

Calculation Units

Calculations are solved in the current units as set by the Units function in the Data Menu. Please ensure that any expressions used are correct for the units in use.

Solving Calculations

To open and solve an existing calculations sheet

·  Select the Calculations window.

·  Select Open Calculations from the File Menu.

·  Select a file of calculations to open from the disk. (Samples are provided in the Maxsurf\Calcs directory.)

·  Click Open and the calculations sheet will be opened and displayed in the calculations window.

·  Choose Solve Calculations from the Data menu.

 

A dialog appears that allows you to specify a longitudinal range over which to perform calculations. The dialog will have the Use current DWL option selected. If you click the OK button, calculations will proceed using the current waterline length of the hull.

If, however, you select the Set range option and specify new fore and aft limits for the analysis, the calculations performed when you click OK will be restricted to this zone of the hull. The Simpson's stations created by Maxsurf are displayed on the screen as a visual check. Note that calculations using Simpson’s stations are approximate. While these are usually sufficient for initial design checks, for accurate calculations you should use Hydromax, which uses more accurate integration and allows a much larger number of stations to be used.

 

Note: When you are setting the range you may refer to stations on the grid directly by typing S followed by the number of the station you want. For example, if S3 is typed in, the longitudinal position for Station 3 of the grid will be automatically substituted.

When you click OK, Maxsurf will evaluate the arithmetic expressions in each statement of the calculation window and calculate the result, which is displayed in the second column.

 

Maxsurf also assigns the result to the variable name on the left, so that the result may be referred to in later statements.

 

If a division by zero has been found, NAN (not a number) will be displayed in the results column. If there is an error in your entered expressions, an error message will be displayed. Locate and correct the error and solve again to continue.

 

You may insert comments into your calculations by preceding a comment line with a $ symbol. This line will then be ignored by the calculations routines.

 

There is no practical limit to the size of the calculations sheet that can be solved. To enable you to see all of a large sheet of calculations you may use the scroll bar on the right hand side of the Calculations window.

Saving Calculations

To save a calculations sheet

·   Select the Calculations window.

·   Select Save Calculations or Save Calculations As from the File menu.

 

If you choose Save As you will be prompted to enter a name for the new calculations sheet.