Tutorial 3 Interpolation and integration | Learning goals
| Prior Knowledge |
In this third tutorial, you will store the waterline data of the previous tutorial in a new object within the object Ships
. You will perform linear and quadratic interpolation to obtain the relative width of unknown frames at the waterline. This will be checked with the exact solution, and the error is to be calculated. Some hydrostatic calculations will be performed: by numerical integration the waterplane area and the moment of inertia of this area are calculated. The stability GM will be calculated and compared to other ships using the least squares method.
...
Geometry
, create a new object (i.e. a parameter of type Object) called Hull
. As we want you need to store static data in this object, make sure it is determined by Value from Object/Database (as described in tutorial 2).Ships
(under Dataset). In the Knowledge Browser, right click the parameter Hull
and select Parameter to Dataset (or press Ctrl+O or drag Hull
tot Ships
). The new object is now placed within Ships
....
The workbase is full of solutions weyou'll not use anymore. So now first let's clean it up.
...
To find out how accurate the interpolation is, we let's introduce an Error
parameter. The interpolated parameter uses static data from the object Hull
, but we you also defined the relative width analytically (the parameter Rel_B
).
...
Info |
---|
You can change the number of decimal places presented in the Workbase by changing the value Decimal places in the Properties window. |
...
Note |
---|
For input values, the number of decimal places also defines the maximum accuracy accepted for this input. So, when you define |
...
By numerical integration, the waterplane area can be calculated. Therefore, the dimensionless length and width should be transformed to the real length and width. For the width we you can use the existing relation for B_Frame
, for the length in meters we add a new relation is needed.
...
Geometry
, add the following relation:X = Frame/20 * Lpp
which
Which is the position in meters along the longitudinal direction of the ship. By now you should know a what proper dimension, reference and determined by value should must be provided.
To calculate the waterplane are for a certain ship, we would like Quaestor to Quaestor has to integrate the width with respect to X. The dimensionless width table is already present in our your object Hull
, so let's use it in the integration.
...
Top Goals/Undefined
class, add the following relation...
Waterplane_Area = INTEGR(Hull(@X, @B_Frame, Lpp, B), 2, @X, @B_Frame, 2, 0, Lpp)
...
which is the waterplane area in square meters (m^2).
The syntax used here may seem a bit confusing at first.
First, we take a look at the arguments after Hull
. Data within the object Hull
will be used in the integration, but yet it only contains dimensionless frame numbers and dimensionless widths. By putting (@X, @B_Frame, Lpp, B)
behind it, you ask Quaestor to calculate X
and B_Frame
using data from within Hull
, using Lpp
and B
from outside Hull
and add all these parameters to the object Hull
. You do actually use the object Hull
as a function to calculate other parameters. This is a very powerful ability of Quaestor (see also QuaestorSyntax).
The arguments for the INTEGR function are as follows:
HULL(..)
is the object from which data will be used, now containing the columns X
and B_frame
2
is the number of dimensions = always 2 using INTEGR.@X
refers to the column that will be used as the parameter X in the integration: X
@B_Frame
refers to the column that will be used as the parameter Y in the integration: B_Frame
2
is the mode of integration, either Riemann (0), Trapezium (1) or Simpson (2). The latter is chosen here....
0
and Lpp
are the ...
...
Waterplane_Area
, using the process manager Process Manager. The waterplane area is calculated for every variation in length and breadth of the ship.
...
Hull
...
The telitab of the object hull is visible now (figure 3). Because we solved a multiple case problem, the object has been used as function and reused for every case. Only the contents of the last case calculated remains in the object.
Figure 3 Contents of the object Hull
...