-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstrength-of-ship_v3.py
156 lines (138 loc) · 5.95 KB
/
strength-of-ship_v3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
"""
Created on Fri Nov 19 22:23:32 2021
@author: nedir ymamov
"""
import numpy as np
from scipy.interpolate import interp1d
from scipy.integrate import cumtrapz
import matplotlib.pyplot as plt
boy = 69
genislik = boy / 8
draft = genislik / 2.5
derinlik = 1.5 * draft
H = boy / 20 # DALGA YÜKSEKLİĞİ
CB = .7
yogunluk = 1.025
posta = np.linspace(0, boy, 101)
deplasman = boy * genislik * draft * CB * yogunluk
offset = np.loadtxt("s60.txt", dtype = float)
ymax = derinlik - .4 * derinlik # TARAFSIZ EKSEN KABULU [İ. Bayer]
suhatti = np.array([0, .3, 1, 2, 3, 4, 5, 6]) * draft / 4
offset_new = np.zeros((101, 8)) # GEMİYİ 100 POSTAYA BÖLÜNÜR
posta0 = np.array([0, .5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9.5, 10]) * boy / 10
for i in range(8):
f = interp1d(posta0, offset[:, i], kind = "cubic")
offset_new[:, i] = f(posta)
offset_new *= genislik / 2
alan = np.zeros((101, 8)) # BON-JEAN ALANLARI
for i in range(101):
alan[i, 1:] = 2 * cumtrapz(offset_new[i, :], suhatti[:])
qx = np.zeros(101) # TOPLAM GEMİ AĞIRLIK DAĞILIMI (PROHASKA YÖNTEMİ)
a = .68 * deplasman / boy
b = 1.185 * deplasman / boy
c = .58 * deplasman / boy
n = 1
for i in range(101):
if i < 34:
qx[i] = a + i * (b - a) / 34
if i > 33 and i < 68:
qx[i] = b
if i > 67:
qx[i] = b - n * (b - c) / 33
n += 1
Ix = np.zeros(101) # ATALET MOMENT DAĞILIMI
Wmax = .193
Iy = 3 * Wmax * boy / 100 # ORTA KESİT ATALET MOMENTİ [m4]
for i in range(100):
if posta[i] <= boy / 20:
Ix[i] = 5 * Iy * posta[i] / boy
if boy / 20 < posta[i] <= 7 * boy / 20:
Ix[i] = .25 * Iy + (15 * Iy) * (posta[i] - boy / 20) / (6 * boy)
if 7 * boy / 20 < posta[i] <= 15 * boy / 20:
Ix[i] = Iy
if 15 * boy / 20 < posta[i] <= 19 * boy / 20:
Ix[i] = Iy - 2.5 * (Iy / boy) * (posta[i] - 15 * boy / 20)
if posta[i] > 19 * boy / 20:
Ix[i] = .5 * Iy - 10 * (Iy / boy) * (posta[i] - 19 * boy / 20)
ax = alan[:, 5] * yogunluk
px = ax - qx
dpx0 = np.array([0, *cumtrapz(px, posta)])
dpx = dpx0 - dpx0[-1] * posta / boy # LİNEER DÜZELTME (%0.03dpx.son<dpx.max [M. Savcı])
ddpx = np.array([0, *cumtrapz(dpx, posta)])
dax = np.array([0, *cumtrapz(ax, posta)]) # ARTIK MOMENT DÜZELTME [M. Savcı 1980]
Qx = dpx + (-ddpx[-1] / deplasman) * ax
Mx = ddpx + (-ddpx[-1] / deplasman) * dax
W = Ix / ymax # KESİT MODÜLÜ
gerilme = np.array([0, *(9.81 * Mx[1 : -1]) / (W[1 : -1] * 1000), 0]) # 1[ton] = 9.81[kN]
plt.figure(figsize = (10, 4))
plt.title("SAKİN SU", fontweight = "bold")
plt.xlabel("Gemi Boyu [m]", fontweight = "bold")
plt.plot(posta, ax, posta, qx, posta, Qx / 3, posta, Mx / 50, posta, gerilme / 3)
plt.legend(["a[ton/m]", "q[ton/m](", "Q[ton]", "M[ton.m]", "σ[MPa]"], loc = "best")
plt.grid(color = "green", linestyle = "--", linewidth = .7)
plt.plot([-1, 70], [0, 0])
plt.show()
# DALGA ÇUKURU
posta1 = np.array([0, .5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5]) * boy / 10
dalga_katsayi = [1, .966, .871, .795, .578, .422, .28, .16, .072, .018, 0]
c = np.interp(posta[:51], posta1, dalga_katsayi) # YARIM DALGA DEĞERLERİ
c = np.concatenate((np.delete(c, -1), np.flipud(c)), axis = 0) # YARI DALGAYI TAM YAPMA
ksi = draft - H / 2 + H * c
ax = np.zeros(101) # DALGAYI DİKEY KAYDIRARAK a(x) BULMAK
for i in range(200):
for j in range (101):
ax[j] = yogunluk * np.interp(ksi[j], suhatti, alan[j, :])
if round(deplasman) < round(np.trapz(ax, posta)):
ksi -= .004
elif round(deplasman) > round(np.trapz(ax, posta)):
ksi += .004
else: break
px = ax - qx
dpx0 = np.array([0, *cumtrapz(px, posta)])
dpx = dpx0 - dpx0[-1] * posta / boy # LİNEER DÜZELTME (%0.03dpx.son<dpx.max [M. Savcı])
ddpx = np.array([0, *cumtrapz(dpx, posta)])
C = 1 - np.cos(2 * np.pi * posta / boy) # ARTIK MOMENT DÜZELTME [M. Savcı 1980]
d1Qx = - (ddpx[-1] * C) / boy
Qx = dpx - d1Qx
Mx = ddpx + np.array([0, *cumtrapz(d1Qx, posta)])
W = Ix / ymax # KESİT MODÜLÜ
gerilme = np.array([0, *(9.81 * Mx[1 : -1]) / (W[1 : -1] * 1000), 0]) # 1[ton] = 9.806[kN]
plt.figure(figsize = (10, 4))
plt.title("DALGA ÇUKURU", fontweight = "bold")
plt.xlabel("Gemi Boyu [m]", fontweight = "bold")
plt.plot(posta, ax, posta, qx, posta, Qx / 4, posta, Mx / 20, posta, gerilme / 2)
plt.legend(["a[ton/m]", "q[ton/m]", "Q[ton]", "M[ton.m]", "σ[MPa]"], loc = "best")
plt.grid(color = "green", linestyle = "--", linewidth = .7)
plt.plot([-1, 70], [0, 0])
plt.show()
# DALGA TEPESİ
dalga_katsayi = [0, .018, .072, .16, .28, .422, .578, .795, .871, .966, 1]
c = np.interp(posta[:51], posta1, dalga_katsayi) #YARIM DALGA DEĞERLERİ
c = np.concatenate((np.delete(c, -1), np.flipud(c)), axis = 0) #YARI DALGAYI TAM YAPMA
ksi = draft - H / 2 + H * c
ax = np.zeros(101) # DALGAYI DİKEY KAYDIRARAK a(x) BULMAK
for i in range(200):
for j in range (101):
ax[j] = yogunluk * np.interp(ksi[j], suhatti, alan[j, :])
if round(deplasman) < round(np.trapz(ax, posta)):
ksi -= .004
elif round(deplasman) > round(np.trapz(ax, posta)):
ksi += .004
else: break
px = ax - qx
dpx0 = np.array([0, *cumtrapz(px, posta)])
dpx = dpx0 - dpx0[-1] * posta / boy # LİNEER DÜZELTME (%0.03dpx.son<dpx.max [M. Savcı])
ddpx = np.array([0, *cumtrapz(dpx, posta)])
dax = np.array([0, *cumtrapz(ax, posta)]) # ARTIK MOMENT DÜZELTME [M. Savcı 1980]
Qx = dpx + (-ddpx / deplasman) * ax
Mx = ddpx + (-ddpx[-1] / deplasman) * dax
W = Ix / ymax # KESİT MODÜLÜ
gerilme = np.array([0, *(9.81 * Mx[1 : -1]) / (W[1 : -1] * 1000), 0]) # 1[ton] = 9.806[kN]
plt.figure(figsize = (10, 4))
plt.grid(color = "green", linestyle = "--", linewidth = .7)
plt.title("DALGA TEPESİ", fontweight = "bold")
plt.xlabel("Gemi Boyu [m]", fontweight = "bold")
plt.plot(posta, ax, posta, qx, posta, Qx / 6, posta, Mx / 100, posta, gerilme / 6)
plt.legend(["a[ton/m]", "q[ton/m]", "Q[ton]", "M[ton.m]", "σ[MPa]"], loc = "best")
plt.plot([-1, 70], [0, 0])
plt.show()