Derive a carene table from a buoyancy shape¶
from DAVE import *
from DAVE.jupyter import *
Equilibrium-core version = 1.07
default resource folders:
/home/ruben/miniconda3/lib/python3.8/site-packages/DAVE/resources
/home/ruben/DAVE_models
/home/ruben/DAVE_book/DAVE-notebooks
embedWindow(verbose=True): could not load k3d module, try:
> pip install k3d # and if necessary:
> conda install nodejs
s = Scene("cheetah.dave") # use the Cheetah model
Loading /home/ruben/miniconda3/lib/python3.8/site-packages/DAVE/resources/cheetah.dave
Have a look at the names of the nodes
show(s, sea = True, camera_pos = (377.41378393620676, 177.29136875029081, -22.319832341170876), lookat = (52.20246063341496, -52.124244707385635, 2.968568242388601), force_normalize = True, force_scale = 1.6, cog_scale = 0)

s.print_node_tree()
Cheetah [RigidBody]
|-> DP reference point [Axis]
|-> buoyancy [Buoyancy]
|-> Ballast_system [BallastSystem]
|-> visual - vessel [Visual]
|-> Wave Interaction draft 6.75 [WaveInteraction1]
DP setpoint for cheetah [Axis]
DP springs cheetah [LC6d]
from DAVE.marine import carene_table
Calculate the carene table¶
The carene curve is requested based on the buoyancy node [Buoyancy], not the vessel node !
The table is calculated numerically using a small displacement from the even-keel situation.
node = s['buoyancy']
table = carene_table(s, node, draft_min = 0.25, draft_max = 9, stepsize=.5)
table
BM T [m] | BM L [m] | CoF x [m] | CoF y [m] | Awl [m2] | Displacement [m3] | CoB x [m] | CoB y [m] | CoB z [m] | |
---|---|---|---|---|---|---|---|---|---|
Draft [m] | |||||||||
0.25 | 549.000884 | 5942.565819 | 112.103608 | 7.784851e-07 | 6038.173587 | 1395.640155 | 111.616555 | 7.311428e-07 | 0.129644 |
0.75 | 214.740826 | 2708.765262 | 112.158916 | 7.381401e-07 | 6654.911794 | 4592.819177 | 112.173159 | 7.549822e-07 | 0.390179 |
1.25 | 130.593750 | 1821.963021 | 110.752916 | 6.860430e-07 | 7029.141537 | 8016.753434 | 111.897894 | 7.388329e-07 | 0.651599 |
1.75 | 94.702157 | 1427.590275 | 108.768755 | 5.794678e-07 | 7351.936858 | 11614.140624 | 111.246751 | 7.080090e-07 | 0.914965 |
2.25 | 74.717759 | 1207.275426 | 106.610463 | 3.926401e-07 | 7630.726360 | 15360.935796 | 110.375567 | 6.549477e-07 | 1.180002 |
2.75 | 62.134729 | 1063.599542 | 104.621392 | 1.580715e-07 | 7883.494097 | 19240.185343 | 109.412334 | 5.787125e-07 | 1.446416 |
3.25 | 53.585599 | 963.068462 | 102.559857 | -1.063507e-07 | 8139.838123 | 23245.316491 | 108.411198 | 4.836934e-07 | 1.714326 |
3.75 | 47.096220 | 890.022494 | 100.988847 | -3.203614e-07 | 8347.599024 | 27373.555404 | 107.389634 | 3.765399e-07 | 1.983785 |
4.25 | 41.817434 | 811.018803 | 100.184583 | -4.420001e-07 | 8477.435606 | 31580.872606 | 106.480040 | 2.750674e-07 | 2.252478 |
4.75 | 37.577242 | 739.073867 | 99.630973 | -5.291604e-07 | 8582.320523 | 35846.703352 | 105.695682 | 1.843714e-07 | 2.519999 |
5.25 | 34.110135 | 676.705102 | 99.263550 | -6.045918e-07 | 8667.146221 | 40159.854065 | 105.023216 | 1.036123e-07 | 2.786394 |
5.75 | 31.230735 | 622.289585 | 99.057960 | -6.704610e-07 | 8732.345532 | 44510.683481 | 104.448162 | 3.100982e-08 | 3.051674 |
6.25 | 28.795489 | 573.510202 | 98.995541 | -7.008935e-07 | 8781.621794 | 48889.695980 | 103.962116 | -3.379685e-08 | 3.315775 |
6.75 | 26.701756 | 530.195841 | 98.945439 | -7.075419e-07 | 8821.552040 | 53290.759876 | 103.550093 | -8.910007e-08 | 3.578762 |
7.25 | 24.890992 | 493.912250 | 98.877519 | -7.129828e-07 | 8853.256669 | 57709.219927 | 103.193850 | -1.368045e-07 | 3.840718 |
7.75 | 23.309345 | 462.837639 | 98.939135 | -7.008420e-07 | 8888.952877 | 62144.791291 | 102.887864 | -1.775121e-07 | 4.101910 |
8.25 | 21.926919 | 435.770401 | 99.013007 | -6.878314e-07 | 8924.301607 | 66598.087209 | 102.626185 | -2.120737e-07 | 4.362579 |
8.75 | 20.708067 | 412.041705 | 99.110367 | -6.732595e-07 | 8958.803980 | 71068.896571 | 102.401803 | -2.415569e-07 | 4.622867 |
9.00 | 20.150536 | 401.183663 | 99.166632 | -6.646144e-07 | 8975.649310 | 73310.700391 | 102.302008 | -2.546337e-07 | 4.752896 |
Plotting¶
First re-generate the table with a smaller set-size:
table = carene_table(s, node, draft_min = 0.25, draft_max = 9, stepsize=.1)
By default the table in indexed by draft. This means the plot methods will plot with draft on the x-axis:
# Set matplotlib figure size
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = [10, 6]
table.plot();

To be able to plot with in the traditional way with the draft vertical we need to reset the index. The x and y can then be specified by name
table = table.reset_index()
table.plot(x = 'CoF x [m]', y= 'Draft [m]')
plt.grid()

For plotting multiple lines in the same graph it is easiest to create the plots using matplotlib directly.
draft = table['Draft [m]']
cofx = table['CoF x [m]']
cobx = table['CoB x [m]']
plt.plot(cofx, draft,label='CoF x [m]')
plt.plot(cobx, draft,label='CoB x [m]')
plt.grid()
plt.legend();

Observe that the CoBx line is vertical at the point where CoBx = CoFx. Does that make sense?
– done –