Graphing and Linear Interpolation

Lesson 1: Graphing and Linear Interpolation

Graphing

A graph is a diagram which visually represents a system of connections or relationships, amoung two or more variables. We will be plotting points and/or lines to show the relationships between variables, such as Righting Lever, Angle of Heel, and Displacement. We will be using a rectangular coordinate system to graph our points.

Rectangular Co-ordinates

In rectangular coordinate systems, a point or a position is located relative to a point called the 'origin' or the point (0,0). Two perpendicular lines (one horizontal and one vertical) are drawn through the origin. Conventionally, the horizontal line is labeled as the 'X-axis' and the vertical line as the 'Y-axis'. Beginning at the origin, a scale is used to divide the axes into equal segments. The position of a point is known relative to that scale. For example:

m08_L01_intro_graph1 m08_L01_intro_graph2

Notice that the x-coordinate is written first, followed by the y coordinate (the coordinates are given in alphabetical order). The pair (x,y) is called an ordered pair and represents the location of a particular point on the rectangular coordinate system.

For more information on graphing and how to plot points click here.

Example 1: The following table shows the fuel consumption for certain vessel speeds:
Speed (knots) 5 10 15 20 25
Fuel (tonnes per day) 2 8 27 64 125
Draw a graph, plotting Speed along the Y-axis and Fuel along the X-axis

Solution:

Choosing a scale: The Y-axis has a scale of 1 division = 5 knots since all the values are multiples of 5.
Along the X-axis a scale of 1 division = 20 tonnes per day can be used, since the values become quite large.
Now plot the points on the graph and join the dots to create a smooth curve.

m08_L01_example1
Loading the player...

Example 2: A ship has the following righting levers (GZ) when inclined:
Heel (degrees) 10 20 30 40 60 80
GZ (metres) 0.32 0.71 0.92 1.07 0.97 0.39
a) Plot the curve of statical stability. (For a given displacement, the curve of statical stability of a ship is the graph obtained by plotting the Righting Lever (Y-axis) against the Angle of Heel (X-axis)
b) Find GZ when the Angle of Heel equals 35°

Solution:
a) M08_l01_EX2A

Scale:
Along X-axis 1 division = 2 degrees or 5 divisions = 10 degrees
Along Y-axis 1 division = 0.04 metres or 5divisions = 0.2 metres

b) m08_L01_ex2b

From the graph we can approximate the value of GZ = 1.02 m when Heel = 35°

Loading the player...

In the last example we found the value of GZ corresponding to an angle of heel, using the graph we plotted. Suppose we had to find the GZ value without a graph.
Can we do it? Yes. How? Using linear interpolation.

Linear Interpolation

Linear interpolation is a method for constructing new data points between two existing data points assuming that a straight line joins the given points.
In other words, linear interpolation can be used to determine a value of 'y' corresponding to an 'x' which lies between x1 and x2 where (x1, y1) and (x2,y2) are two known points. In linear interpolation it is assumed that a straight line joins the given points which may not always be true. However, this method provides a good approximation, especially when the known points are very close to each other. Linear interpolation assumes that any change in x is proportional to the change in y.


Let's look at an example to clarify:

In Part (b) of Example 2, we can say that the value of GZ at a heel of 35° is approximately 1 metre. Now let us use linear interpolation to approximate the value of GZ . Since 35 lies between 30 and 40, therefore we will use the given points (30, 0.92) and (40, 1.07) for interpolation.
According to linear interpolation: Change in x Change in y = 3530 c0.92 = 4030 1.070.92 or, 5 c0.92 = 10 0.15 5×0.15=10×(c0.92)  (Cross mutliplication) 0.75=10c9.2   (Multiplication, Distributive Law) 0.75+9.2=10c  (Addition Principle) 9.95=10c or,c= 9.95 10 =0.9951  (Mutliplication Principle)
To simplify the whole process we can use the following technique:

interpolation_explain
5 10 = c 0.15 5×0.15=10×c(Cross multiplying) 0.75=10c 0.75 10 =c  (Multiplication Principle) 0.075=c Hence, GZ=0.92+c=0.92+0.075=0.9951m

Watch a video explaining this method:

Loading the player...

Use Table 8.1.3 for Examples 3 and 4: (M.V. Almar — KN Values Chart taken from your module course pack)

DISPLACEMENT
(t)
ANGLE OF HEEL - DEGREES
10 20 30 40 60 80
7000 2.97 5.35 6.72 7.55 8.53 8.32
8000 2.75 5.10 6.52 7.47 8.60 8.35
9000 2.56 4.87 6.38 7.40 8.65 8.38
Table 8.1.3

Example 3: For a displacement of 7000 t , find KN (the righting lever measured from keel) if the angle of heel is 50°

Solution:
Using the table we can find two points corresponding to 7000 t displacement (40, 7.55) and (60, 8.53) which we need for applying linear interpolation.
m08_L01_exaple3
10 20 = c 0.98 10×0.98=20×c(Cross multiplying) 9.8=20c 9.8 20 =c  (Multiplication Principle) 0.49=c Since the value of KN increases as the angle of heel increases from 40 to 60, therefore we will add the value of c to 7.55 to get the KN value corresponding to 50° . That is, KN=7.55+0.49=8.04m
Loading the player...

Example 4: For heel angle 30° find the value of KN if the displacement is 8200 t. Use the table 8.1.3

Solution:
Using the table we can find two points corresponding to 30° heel : (8000, 6.52) and (9000, 6.38) which we need for applying linear interpolation.
m08_L01_example4
200 1000 = c 0.14 200×0.14=1000×c(Cross multiplying) 28=1000c 28 1000 =c  (Multiplication Principle) 0.028=c Since the value of KN decreases as the displacement increases from 8000 to 9000, therefore we will subtract the value of c from 6.52 to get the KN value corresponding to 8200 t . That is, KN=6.520.028=6.492m
Alterntatively, we can look at the Displacement as decreasing from 9000 to 8200:
m08_L01_ex4_other 800 1000 = c 0.14 800×0.14=1000×c(Cross multiplying) 112=1000c 112 1000 =c  (Multiplication Principle) 0.112=c In this case, the KN value will increase as the Displacement decreases from 9000 to 8200, so we will add c to 6.38 to find the required KN.
KN=6.38+0.112=6.492m
Loading the player...

Example 5: Find the value of KN corresponding to a displacement of 17500 t when the angle of inclination (or heel) is 30°
a) Using the following graph (click on it to enlarge it)
m08 Cross graph

b) Using linear interpolation using the points (15000, 5.65) and (20000, 5.36)

Solution:

The given graph is called a 'cross curve of stability'. The graph shows the relationship between a number of different, independent curves which sometines 'cross' each other on this graph. You will learn more about these variables and the relationships between them in your ship stability course.

a) From the graph: Notice that the scale along the Y-axis is 1 division = 5000 t and that 17500 lies halfway between 15000 and 20000. From the division between 15000 t and 20000t we draw a horizontal line to the curve for a heel of 30°. Then, we drop a straight line from that point, down to the X-axis.
Using the scale along the X-axis: 1 division = 1 m; we can approximate the relevant KN value to be 5.5 m

m08_L01_ex5
b) Using linear interpolation: We are given two points (15000, 5.65) and (20000, 5.36)
Finding the differences: 2000015000=5000 1750015000=2500 5.655.36=0.29 Therefore, 2500 5000 = c 0.29 2500×0.29=5000×c  (Cross multiplying) 725=5000c 725 5000 =c   (Solving for c) 0.145=c Since the value of KN is decreasing from 5.65 to 5.36 when the value of displacement increases from 15000 t to 20000 t, therefore we will subtract c from 5.65 to get the required KN. KN=5.650.145=5.5055.5m
Loading the player...