# Can the contour surface of a ship be represented by a mathematical function?

Discussion in 'Stability' started by sun, May 31, 2022.

1. Joined: Sep 2018
Posts: 77
Likes: 3, Points: 8
Location: Hongkong

### sunJunior Member

What principle are they based on?

2. Joined: Apr 2015
Posts: 500
Likes: 115, Points: 43, Legacy Rep: 37
Location: Berlin, Germany

### HeimfriedSenior Member

The (upright sitting) hull is mathematically divided in rectangular "sticks", by slicing its leght vertically crosswise in 375 parts (bulkheads) and slicing its halfbreadth vertically in 125 parts (buttocks). The slices are made aequidistant so each stick has the same cross section area (horizontally). There are two arrays with up to 90,000 numbers each, representing the hull of the boat by showing the z coordinate of the upper end of the stick (weather deck) respectively the bottom coordinate of the stick (part of the hull surface). With this data you can determinate for each stick the amount of its buoyancy and the geometrical center of it. By adding it up regarding its lever (moment) you will get the cob of the hull. The cog is given at the start. If they are vertically aligned the ship sits at its equilibrium. If there is some heel and/or trim, you have to calculate the altered cob. For each stick you have to calculate whether the stick is completely immersed, partially submersed to what extent or completely in air to find its contribution to the buoyancy.

You have to transform the ship fixed coordinates into earth fixed ones also and use both of them to be able to find the equilibrium of the boat.

The number of sticks (max. 125 * 375) is only chosen in respect to the answer time of the website. The more slices, the better the approximation but the server would kick me out, if the php script didn't deliver the answer within about 30 seconds. And to find a new equilibrium there are millions and millions of calculations to be done (iteration).

The outline of a third of the bulkhead slices are used to give the graphic impression of the hull, the immersed part shown in blue.

Last edited: Jun 4, 2022
3. Joined: Sep 2018
Posts: 77
Likes: 3, Points: 8
Location: Hongkong

### sunJunior Member

What numerical solver is needed？

4. Joined: Mar 2022
Posts: 113
Likes: 20, Points: 28
Location: Perth, Western Australia

### AlanXSenior Member

Hi @sun,
Although you can solve analytically the intersection for my hull equation as it is a quadratic, you will not be able to solve a higher order polynomials (as per Alan Cattelliot and rxcomposite).
Newton–Raphson method should work here:
x = x - f(x)/f'(x)​
As the hulls are defined by polynomials, f'(x) would be easy to calculate.

Regards AlanX

5. Joined: Aug 2002
Posts: 16,354
Likes: 1,407, Points: 123, Legacy Rep: 2031
Location: Milwaukee, WI

### gonzoSenior Member

The main flaw of most simplifications, is that they are based of flat water. Boat don't normally capsize on flat water, but in heavy seas.

6. Joined: Sep 2011
Posts: 7,153
Likes: 611, Points: 123, Legacy Rep: 300
Location: Spain

### TANSLSenior Member

That is, subtracting "x" from both terms of the equation: -f(x)/f'(x) = 0 from which it follows that f(x) = 0
Nice way to describe the hull surface, no "y" coordinate, no "z" coordinate. I'm probably misunderstanding it.

mc_rash likes this.
7. Joined: Aug 2002
Posts: 16,354
Likes: 1,407, Points: 123, Legacy Rep: 2031
Location: Milwaukee, WI

### gonzoSenior Member

-f(x)/f'(x) = -1

8. Joined: Sep 2011
Posts: 7,153
Likes: 611, Points: 123, Legacy Rep: 300
Location: Spain

### TANSLSenior Member

No, a function divided by its derivative cannot be equal to 1.

9. Joined: Mar 2022
Posts: 113
Likes: 20, Points: 28
Location: Perth, Western Australia

### AlanXSenior Member

@TANSL and @gonzo,

If you are a programmer then x=x-f(x)/f'(x) makes perfect sense.

But it can be written as:
xnew=xold-f(xold)/f'(xold)
and if you can't differentiate then:
f'(x) ~(f(x+h)-f(x-h))/2/h

And if:
f(x) = exp(x)
then
f'(x) = exp(x)

But we are dealing with polynomial models here!

Regards AlanX

10. Joined: Mar 2022
Posts: 113
Likes: 20, Points: 28
Location: Perth, Western Australia

### AlanXSenior Member

If we step back, we have a hull function Fhull(x,y,z) and a Fwaterplane (x,y,z).
The water plane factors A, B, C and D can be calculated for a hull draft and heel fairly easily.
And it is much easier to rotate the waterplane around the hull then to rotate the hull.

When these two function intersect:
Fhull(x,y,z) = Fwaterplane (x,y,z)
For an x we have at least one points where y and z are equal.
These are the points where the water plane intersects the hull shell.
If the z is higher than the sheer, then water will flow in.
But you could model a deck etc, if you want.

For hull polynomials we cannot solve these analytically (i.e. pencil and paper) for polynomial orders greater than 2, (actually we can for polynomials of order 3, but it is hard). Thus we need a numerical method to do this for use.

Before the days of computers you could solve these equations using the Newton-Raphson method using pencil and paper (or a simple calculator).

So I am trying to answer the question without getting too "technical".
The process is quite generally but obviously with computers it is not the approach generally used.

Obviously @sun would like a simple equation but unfortunately, most of real engineering problems don't have simple equations.
But you could put a polynomial to the intersection points if you want using the Legrendre polynomial interpolation method.

Regards AlanX

Last edited: Jun 6, 2022
11. Joined: Sep 2011
Posts: 7,153
Likes: 611, Points: 123, Legacy Rep: 300
Location: Spain

### TANSLSenior Member

Of course, I fully understand that, but if you're looking for the hull surface equation, that doesn't make any sense.
For many years it has been found that looking for a single surface to define the hull was an impractical task. The solution was to look for several "patches" that defined specific areas of the hull, establishing a series of conditions for the common contours between them, such as making the first and second derivatives equal in those points in the adjacent patches. That is, not only the tangents to the patches had to be the same, but also their curvatures. If third-order parametric polynomials (parabolas : x=f1(t), y=f2(t), z=f3(t)) are used for these patches, handling them is very easy given the processing speed of modern computers.

12. Joined: Mar 2022
Posts: 113
Likes: 20, Points: 28
Location: Perth, Western Australia

### AlanXSenior Member

@Tanal,
I don't disagree, I am answering the @sun's question.
AlanX

Forum posts represent the experience, opinion, and view of individual users. Boat Design Net does not necessarily endorse nor share the view of each individual post.
When making potentially dangerous or financial decisions, always employ and consult appropriate professionals. Your circumstances or experience may be different.