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.
...
The solution Waterline
containing the shape of the dimensionless waterline, has been created in tutorial 2. In order to store this data and use it for further operations, the contents will be placed in a new object within the object Ships.
Geometry
, create a new object (i.e. a parameter of type Object) called Hull
. As 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
....
Top Goals/Undefined
:Intpol_Rel_B=LININT(@Hull,2,@Frame,@Rel_B,Frame)
Intpol_Rel_B
is dimensionless and determined by SYS: System/Equation. The syntax of every intrinsic function in Quaestor is described in this documentation, see the functions overview. The syntax above means the following.
...
When Quaestor calculates this function, it determines the value of Frame
(which is user input). This value is then compared to the values of the given column for X (which is the column Frame
of the object Hull
), and an interpolated value for Rel_B
with respect to the input Frame
is assigned to the parameter Intpol_Rel_B
. Notice that an @
is used to identify the data within the object.
Intpol_Rel_B
using the Process Manager and selecting the Ships
object. Make sure that Intpol_Rel_B
is in the class Top Goals/Undefined
to see it in the Process Manager. The Process Manager is crucial here, as static data from the Ships
object should be used (which contains the object Hull
). For Frame
, enter 3.20....
Top Goals/Undefined
class:Error = Intpol_Rel_B - Rel_B
in which Error
is a dimensionless SYS parameter.
Intpol_Rel_B
will be calculated by Quaestor automatically because it is required by Error
. Make sure you use the Process Manager to select the Ships
object as dataset. For Frame
, enter 3.20 again.The solution in two-digit format (0.00) will be presented in the list of the Workbase. When you select this value, more digits are shown in the Explanation window.
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 |
...
Error
, Intpol_Rel_B
and Rel_B
to 4.Intpol_Rel_B
toIntpol_Rel_B = DQUAD(@Hull, 2, @Frame, @Rel_B, Frame)
which uses the same data, but now performs a quadratic interpolation. It's not necessary to initialize existing solutions.
Editing relations was covered in tutorial 2. Remember that the use, syntax and examples of all Quaestor functions are available in the documentation: functionsoverview.
...
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 you can use the existing relation for B_Frame
, for the length in meters a new relation is needed.
Geometry
, add the following relation:X = Frame/20 * Lpp
which is the position in meters along the longitudinal direction of the ship. By now you should know what proper dimension, reference and determined by value must be provided.
To calculate the waterplane are area for a certain ship, Quaestor has to integrate the width with respect to X. The dimensionless width table is already present in 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.
...
The initial stability (GM) of the ships can also be calculated using numerical integration.
Stability
, as sub-class of Geometry
. Add the following relation to this class:GM = KB + BM - KG
The dimensions of all new parameters must be meters (m), and they are SYS parameters. Their relations follow. GM
is a Top Goal and should be moved to Top Goals/Undefined
.
Stability
, enter the following relations.Distance between keel K and center of buoyancy B, select KB
, right-click and select New Relation... (or press Ctrl+N). By selecting KB
it is automatically presented as left side part of the relation:
KB = 0.7 * T
Distance between keel K and center of gravity G, KG
, in meters:
KG = 0.8 * T
Distance between center of buoyancy B and metacenter M, BM
, in meters:
BM = Moment_of_Inertia / (DISP * 1000/ Rho)
Third power of the width at a specified frame number in m^3:
B3_Frame = B_Frame^3
Moment of inertia of the waterplane area in m^4:
Moment_of_Inertia = 1/12 * INTEGR(Hull(@X, @B3_Frame, Lpp, B), 2, @X, @B3_Frame, 2, 0, Lpp)
Note that the syntax of the moment of inertia relation is similar to that of the waterplane area relation.
...
Finaly, let's compare the obtained values for GM
to other ships. Data of the GM
value for a certain ship length is available, so we only have to compare them. You canl use the least squares method to obtain an average GM
value for a certain length, using the data of some other ships.
Top Goals/Undefined
:GM_Check = LEASQ(TEXTITEM$(1), 2, "L", "GM", Lpp, 2)
GM_Check
is in meters.
GM_Check
:...
Note that the syntax of the relation uses TEXTITEM$(nr)
, but in the data slot the syntax TEXTITEM1=
is used. The TeLiTab is written between two | characters. Multiple textitems can be available in a relation (TEXTITEM$(10, TEXTITEM$(2) .. TEXTITEM$(n))
.
Note |
---|
Please note that "the devil is in the detail". Small errors in your syntax will always be a problem for software such as Quaestor. Therefore, keep checking the correctness of your syntax. |
...
You can verify your results by comparing it to [Tutorial 3 Finished]