Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Tutorial 3
Interpolation and integration

Learning goals

  1. Using data stored in objects.
  2. Using the LININT, DQUAD and LEASQ functions to interpolate in datasets.
  3. Using an object as a function.
  4. Using the INTEGR function to perform numerical integration.
  5. Using the LEASQ function

Prior Knowledge

  1. Interface
  2. Tutorial 1: Getting Started
  3. Tutorial 2: TeLiTabs and Objects

Image Added

1    Objective


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.

...

  •  In the class 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).
  • In the Workbase, select the object 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 B as having two decimal places, providing input with three will give a warning followed by rounding the provided number to two decimals.

...


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.

  •  

...

  • In the class 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.

...

  • In the 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:

  1. HULL(..) is the object from which data will be used, now containing the columns X and B_frame
  2. 2 is the number of dimensions = always 2 using INTEGR.
  3. @X refers to the column that will be used as the parameter X in the integration: X
  4. @B_Frame refers to the column that will be used as the parameter Y in the integration: B_Frame
  5. 2 is the mode of integration, either Riemann (0), Trapezium (1) or Simpson (2). The latter is chosen here.

...

  1. 0 and Lpp are the

...

  1. values between

...

  1. which will be integrated.
  • Image Removed Run Run a solution for the waterplane area Waterplane_Area, using the process manager Process Manager

The waterplane area is calculated for every variation in length and breadth of the ship.

...

Image Added

  • In the solution tree, select the object 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.

Image Removed 

Figure 3   Contents of the object Hull Image Added

5    Calculating the stability

...