kib-lap 0.5__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- Examples/Cross_Section_Thin.py +61 -0
- Examples/__init__.py +0 -0
- KIB_LAP/Betonbau/Bemessung_Polygon.py +667 -0
- KIB_LAP/Betonbau/Bemessung_Zust_II.py +648 -0
- KIB_LAP/Betonbau/Cross_Section_Kappa.py +925 -0
- KIB_LAP/Betonbau/Druckglied_KGV.py +179 -0
- KIB_LAP/Betonbau/Iterative_Design.py +723 -0
- KIB_LAP/Betonbau/Materialkennwerte_Beton.py +196 -0
- KIB_LAP/Betonbau/Querschnittsbreite.py +194 -0
- KIB_LAP/Betonbau/Querschnittsbreite_Kreis.py +63 -0
- KIB_LAP/Betonbau/__init__.py +2 -0
- KIB_LAP/Betonbau/beam_plate_T.py +921 -0
- KIB_LAP/Betonbau/beam_plate_T_reverse.py +915 -0
- KIB_LAP/Betonbau/beam_rectangular.py +635 -0
- KIB_LAP/Betonbau/beam_sub_section.py +9 -0
- KIB_LAP/Dynamik/Cross_Section_Properties.py +155 -0
- KIB_LAP/Dynamik/Deformation_Method.py +587 -0
- KIB_LAP/Dynamik/Duhamel_SDOF.py +221 -0
- KIB_LAP/Dynamik/FFT.py +87 -0
- KIB_LAP/Dynamik/Kontinuum_Eigenmodes.py +418 -0
- KIB_LAP/Dynamik/Kontinuum_Schwingung.py +757 -0
- KIB_LAP/Dynamik/Pendulum_Spring_Linearized.py +91 -0
- KIB_LAP/Dynamik/Pendulum_Spring_Problem.py +94 -0
- KIB_LAP/Dynamik/__init__.py +0 -0
- KIB_LAP/Examples/Cross_Section_Thin.py +61 -0
- KIB_LAP/Examples/Cross_Section_Thin_2.py +14 -0
- KIB_LAP/Examples/Plattentragwerke.py +39 -0
- KIB_LAP/Examples/Plattentragwerke_2.py +60 -0
- KIB_LAP/Examples/ShearDesign.py +28 -0
- KIB_LAP/Examples/__init__.py +0 -0
- KIB_LAP/Plattenbeulen/Plate_Design.py +276 -0
- KIB_LAP/Plattenbeulen/Ritz_Optimiert.py +658 -0
- KIB_LAP/Plattenbeulen/__init__.py +2 -0
- KIB_LAP/Plattenbeulen/dist/__init__.py +0 -0
- KIB_LAP/Plattenbeulen/plate_buckling.cpp +561 -0
- KIB_LAP/Plattenbeulen/plate_buckling_cpp.cp313-win_amd64.pyd +0 -0
- KIB_LAP/Plattenbeulen/plate_buckling_cpp.cpp +561 -0
- KIB_LAP/Plattenbeulen/setup.py +35 -0
- KIB_LAP/Plattentragwerke/Functions.cpp +326 -0
- KIB_LAP/Plattentragwerke/Functions.h +41 -0
- KIB_LAP/Plattentragwerke/NumInte.cpp +23 -0
- KIB_LAP/Plattentragwerke/NumericalIntegration.cpp +23 -0
- KIB_LAP/Plattentragwerke/PlateBendingKirchhoff.py +843 -0
- KIB_LAP/Plattentragwerke/__init__.py +1 -0
- KIB_LAP/Plattentragwerke/plate_bending.cpp +341 -0
- KIB_LAP/Plattentragwerke/plate_bending_cpp.cp313-win_amd64.pyd +0 -0
- KIB_LAP/Plattentragwerke/setup.py +39 -0
- KIB_LAP/Querschnittswerte/Querschnitt_Duenn.py +526 -0
- KIB_LAP/Querschnittswerte/__init__.py +1 -0
- KIB_LAP/STABRAUM/InputData.py +92 -0
- KIB_LAP/STABRAUM/Programm.py +1403 -0
- KIB_LAP/STABRAUM/Steifigkeitsmatrix.py +275 -0
- KIB_LAP/STABRAUM/__init__.py +3 -0
- KIB_LAP/Stahlbau/__init__.py +0 -0
- KIB_LAP/Verbundbau/Verbundtraeger_Bemessung.py +766 -0
- KIB_LAP/Verbundbau/__init__.py +0 -0
- KIB_LAP/__init__.py +4 -0
- KIB_LAP/main.py +2 -0
- KIB_LAP/plate_bending_cpp.cp313-win_amd64.pyd +0 -0
- KIB_LAP/plate_buckling_cpp.cp313-win_amd64.pyd +0 -0
- kib_lap-0.5.dist-info/METADATA +25 -0
- kib_lap-0.5.dist-info/RECORD +64 -0
- kib_lap-0.5.dist-info/WHEEL +5 -0
- kib_lap-0.5.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
|
|
2
|
+
import numpy as np
|
|
3
|
+
class Baustoffe:
|
|
4
|
+
def __init__(self, liste_baustoffe, h_c=0.13, b_c=4, traeger="FT", t0=1, t=365,ts = 1):
|
|
5
|
+
"""
|
|
6
|
+
Klasse zur Berechnung der Baustoffparameter: Eingabe in [MN/m², m , MN, etc.]
|
|
7
|
+
liste_baustoffe: Eingabe von [fck,fyk] \n
|
|
8
|
+
h_c = Höhe des Betonträgers zur Berechnung von h0 in [m] \n
|
|
9
|
+
b_c = Bezugsbreite in [m] \n
|
|
10
|
+
traeger = Eingabe des Umfangs, welcher der freien Trocknung ausgesetzt ist \n
|
|
11
|
+
Für Fertigteile ergibt sich hier: h0 = 2*h ("FT")
|
|
12
|
+
Für Ortbetonplatten folgt: h0 = h ("Ortbeton")
|
|
13
|
+
t0 = Tatsächliches Betonalter beim Belastungsbeginn \n
|
|
14
|
+
t = Betrachteter Zeitpunkt für die ermittelte Kriechzahl
|
|
15
|
+
"""
|
|
16
|
+
# Teilsicherheitsbeiwerte für Baustoffe
|
|
17
|
+
self.gamma_c = 1.5
|
|
18
|
+
self.gamma_s = 1.15
|
|
19
|
+
# Stahlbeton
|
|
20
|
+
self.fck = liste_baustoffe[0]
|
|
21
|
+
self.fcd = self.fck / self.gamma_c * 0.85
|
|
22
|
+
self.fctm = 0.30 * self.fck ** (2 / 3) # Nach Eurocode 2 Tabelle 3.1
|
|
23
|
+
self.fctk_005 = 0.7 * self.fctm
|
|
24
|
+
self.fcm = self.fck + 8
|
|
25
|
+
self.Ecm = 22000 * (0.1 * self.fcm) ** (0.3)
|
|
26
|
+
|
|
27
|
+
self.alpha_T = 1.2e-5
|
|
28
|
+
|
|
29
|
+
# Kriechen und Schwinden
|
|
30
|
+
|
|
31
|
+
self.traeger = traeger
|
|
32
|
+
self.Zement = "I42.5N"
|
|
33
|
+
self.LF = 80
|
|
34
|
+
|
|
35
|
+
self.t0 = t0 # Annahme: Belastungsbeginn der Fertigteile nach 28 d
|
|
36
|
+
self.t = t
|
|
37
|
+
self.ts = ts
|
|
38
|
+
|
|
39
|
+
# Querschnittswerte für Kriechen / Schwinden
|
|
40
|
+
|
|
41
|
+
self.b_c = b_c
|
|
42
|
+
self.h_c = h_c
|
|
43
|
+
|
|
44
|
+
self.A = self.b_c * self.h_c
|
|
45
|
+
if self.traeger == "FT":
|
|
46
|
+
self.u = self.b_c
|
|
47
|
+
elif self.traeger == "Normal":
|
|
48
|
+
self.u = self.b_c * 2 # Zur Trocknung freigesetzter Umfang
|
|
49
|
+
else:
|
|
50
|
+
self.u = self.b_c * 2
|
|
51
|
+
|
|
52
|
+
self.h_0 = 2 * self.A / self.u
|
|
53
|
+
|
|
54
|
+
# Stahl
|
|
55
|
+
self.fyk = liste_baustoffe[1]
|
|
56
|
+
self.fyd = self.fyk / self.gamma_s
|
|
57
|
+
self.Es = 2e5
|
|
58
|
+
self.Materialgesetz_Beton()
|
|
59
|
+
self.Kriechzahlen()
|
|
60
|
+
self.Schwindzahlen()
|
|
61
|
+
|
|
62
|
+
def Materialgesetz_Beton(self):
|
|
63
|
+
self.eps_c1 = 0.7 * self.fcm**0.31
|
|
64
|
+
self.eps_c1 = min(self.eps_c1, 2.8) # Sicherstellen, dass eps_c1 <= 2.8
|
|
65
|
+
|
|
66
|
+
def Kriechzahlen(self):
|
|
67
|
+
self.Zement = "I42.5N"
|
|
68
|
+
|
|
69
|
+
if self.Zement == "I42.5N" or self.Zement == "I32.5R":
|
|
70
|
+
self.alpha = 0
|
|
71
|
+
elif (
|
|
72
|
+
self.Zement == "I42.5R"
|
|
73
|
+
or self.Zement == "I52.5N"
|
|
74
|
+
or self.Zement == "I52.5R"
|
|
75
|
+
):
|
|
76
|
+
self.alpha = 1
|
|
77
|
+
else:
|
|
78
|
+
self.alpha = -1
|
|
79
|
+
|
|
80
|
+
self.t_0 = self.t0
|
|
81
|
+
|
|
82
|
+
self.t_0_eff = max(
|
|
83
|
+
self.t_0 * (1 + 9 / (2 + self.t_0 ** (1.2))) ** self.alpha, 0.5
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
self.t_infty = (
|
|
87
|
+
self.t
|
|
88
|
+
) # self.t_0+15 #70 * 365 Annahme: 15 Tage nach der Betonage
|
|
89
|
+
|
|
90
|
+
self.RH = self.LF # Außenliegendes Bauteil
|
|
91
|
+
|
|
92
|
+
# Fallunterscheidung für Druckfestigkeit
|
|
93
|
+
self.alpha_1 = min((35 / self.fcm) ** 0.7, 1)
|
|
94
|
+
self.alpha_2 = min((35 / self.fcm) ** 0.2, 1)
|
|
95
|
+
self.alpha_3 = min((35 / self.fcm) ** 0.5, 1)
|
|
96
|
+
|
|
97
|
+
# Einfluss der Luftfeuchte und wirksamer Bauteildicke
|
|
98
|
+
if self.fcm <= 35:
|
|
99
|
+
self.phi_rh = 1 + (1 - self.RH / 100) / (
|
|
100
|
+
0.1 * (self.h_0 * 1000) ** (0.3333333)
|
|
101
|
+
)
|
|
102
|
+
else:
|
|
103
|
+
self.phi_rh = (
|
|
104
|
+
1
|
|
105
|
+
+ (1 - self.RH / 100)
|
|
106
|
+
/ (0.1 * (self.h_0 * 1000) ** (0.3333333))
|
|
107
|
+
* self.alpha_1
|
|
108
|
+
) * self.alpha_2
|
|
109
|
+
|
|
110
|
+
# Einfluss der Betondruckfestigkeit
|
|
111
|
+
self.beta_fcm = 16.8 / np.sqrt(self.fcm)
|
|
112
|
+
# Einfluss des Belastungsbeginns
|
|
113
|
+
self.beta_t0 = 1 / (0.1 + self.t_0_eff**0.2)
|
|
114
|
+
|
|
115
|
+
# Einfluss der Luftfeuchte - Beta-Beiwert
|
|
116
|
+
if self.fcm <= 35:
|
|
117
|
+
self.beta_h = min(
|
|
118
|
+
1.5 * (1 + (0.012 * self.RH) ** 18) * self.h_0 * 1000 + 250, 1500
|
|
119
|
+
)
|
|
120
|
+
else:
|
|
121
|
+
self.beta_h = min(
|
|
122
|
+
1.5 * (1 + (0.012 * self.RH) ** 18) * self.h_0 * 1000
|
|
123
|
+
+ 250 * self.alpha_3,
|
|
124
|
+
1500 * self.alpha_3,
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
# Einfluss der Belastungsdauer und Belastungsbeginn
|
|
128
|
+
|
|
129
|
+
self.beta_c_t_t0 = (
|
|
130
|
+
(self.t_infty - self.t_0) / (self.beta_h + self.t_infty - self.t_0)
|
|
131
|
+
) ** 0.30
|
|
132
|
+
|
|
133
|
+
self.phi_infty = (
|
|
134
|
+
self.phi_rh * self.beta_fcm * self.beta_t0 * self.beta_c_t_t0
|
|
135
|
+
) # Kriechzahl zum Zeitpunkt t
|
|
136
|
+
|
|
137
|
+
print("Kriechzahl phi ", self.phi_infty)
|
|
138
|
+
|
|
139
|
+
def Schwindzahlen(self):
|
|
140
|
+
self.beta_rh = 1.55 * (1 - (self.RH / 100) ** 3)
|
|
141
|
+
|
|
142
|
+
if self.Zement == "I42.5N" or self.Zement == "I32.5R":
|
|
143
|
+
self.alpha_as = 700
|
|
144
|
+
self.alpha_ds1 = 4
|
|
145
|
+
self.alpha_ds2 = 0.12
|
|
146
|
+
elif (
|
|
147
|
+
self.Zement == "I42.5R"
|
|
148
|
+
or self.Zement == "I52.5N"
|
|
149
|
+
or self.Zement == "I52.5R"
|
|
150
|
+
):
|
|
151
|
+
self.alpha_as = 600
|
|
152
|
+
self.alpha_ds1 = 6
|
|
153
|
+
self.alpha_ds2 = 0.12
|
|
154
|
+
else:
|
|
155
|
+
self.alpha_as = 800
|
|
156
|
+
self.alpha_ds1 = 3
|
|
157
|
+
self.alpha_ds2 = 0.12
|
|
158
|
+
|
|
159
|
+
self.epsilon_cd_0 = (
|
|
160
|
+
0.85
|
|
161
|
+
* ((220 + 110 * self.alpha_ds1) * np.exp(-self.alpha_ds2 * self.fcm / 10))
|
|
162
|
+
* 1e-6
|
|
163
|
+
* self.beta_rh
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
ts = self.ts
|
|
167
|
+
|
|
168
|
+
t = self.t_infty
|
|
169
|
+
self.t_infty_s = t
|
|
170
|
+
|
|
171
|
+
self.beta_ds = (t - ts) / ((t - ts) + 0.04 * np.sqrt(self.h_0**3))
|
|
172
|
+
|
|
173
|
+
if self.h_0 * 1000 <= 100:
|
|
174
|
+
self.k_h = 1.00
|
|
175
|
+
elif self.h_0 * 1000 > 100 and self.h_0 * 1000 <= 200:
|
|
176
|
+
self.k_h = 1.00 - 0.15 / 100 * self.h_0 * 1000
|
|
177
|
+
elif self.h_0 * 1000 > 200 and self.h_0 * 1000 <= 300:
|
|
178
|
+
self.k_h = 0.85 - 0.10 / 100 * self.h_0 * 1000
|
|
179
|
+
elif self.h_0 * 1000 > 300 and self.h_0 * 1000 <= 500:
|
|
180
|
+
self.k_h = 0.75 - 0.05 / 100 * self.h_0 * 1000
|
|
181
|
+
elif self.h_0 * 1000 > 500:
|
|
182
|
+
self.k_h = 0.70
|
|
183
|
+
|
|
184
|
+
self.epsilon_cd = self.beta_ds * self.epsilon_cd_0 * self.k_h
|
|
185
|
+
|
|
186
|
+
# Autogenes Schwinden
|
|
187
|
+
self.epsilon_ca_infty = 2.5 * (self.fck - 10) * 1e-6
|
|
188
|
+
self.beta_as = 1 - np.exp(-0.2 * np.sqrt(t))
|
|
189
|
+
|
|
190
|
+
self.epsilon_ca = self.beta_as * self.epsilon_ca_infty
|
|
191
|
+
|
|
192
|
+
# Gesamtschwinden
|
|
193
|
+
self.epsilon_cs = self.epsilon_cd + self.epsilon_ca
|
|
194
|
+
|
|
195
|
+
print("Gesamtschwindmaß ", self.epsilon_cs)
|
|
196
|
+
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import matplotlib.pyplot as plt
|
|
3
|
+
|
|
4
|
+
class PolygonSection:
|
|
5
|
+
def __init__(self, vertices=None):
|
|
6
|
+
"""
|
|
7
|
+
Initialisiert das Polygon mit den gegebenen Eckpunkten.
|
|
8
|
+
|
|
9
|
+
Parameter:
|
|
10
|
+
vertices (Liste von Listen): Nx2-Array der Polygoneckpunkte [[y, z], [y, z], ...]
|
|
11
|
+
"""
|
|
12
|
+
if vertices is None:
|
|
13
|
+
vertices = []
|
|
14
|
+
|
|
15
|
+
self.vertices = np.array(vertices)
|
|
16
|
+
self.original_vertices = self.vertices.copy()
|
|
17
|
+
|
|
18
|
+
# Extrahieren der y- und z-Koordinaten
|
|
19
|
+
self.y_coords = self.vertices[:, 0]
|
|
20
|
+
self.z_coords = self.vertices[:, 1]
|
|
21
|
+
|
|
22
|
+
self.len = len(self.vertices)
|
|
23
|
+
|
|
24
|
+
# Initialisierung der Querschnittsgrößen
|
|
25
|
+
self.A = 0
|
|
26
|
+
self.S_y = 0
|
|
27
|
+
self.S_z = 0
|
|
28
|
+
self.I_yy = 0
|
|
29
|
+
self.I_zz = 0
|
|
30
|
+
self.I_yz = 0
|
|
31
|
+
self.ys = 0
|
|
32
|
+
self.zs = 0
|
|
33
|
+
|
|
34
|
+
if self.len > 0:
|
|
35
|
+
self.calculate_area()
|
|
36
|
+
self.calculate_first_moments()
|
|
37
|
+
self.calculate_centroid()
|
|
38
|
+
self.calculate_second_moments()
|
|
39
|
+
self.calculate_deviation_moment_yz()
|
|
40
|
+
|
|
41
|
+
# Berechnung der Querschnittsgrößen
|
|
42
|
+
|
|
43
|
+
def calculate_area(self):
|
|
44
|
+
self.A = 0
|
|
45
|
+
n = self.len
|
|
46
|
+
for i in range(n):
|
|
47
|
+
j = (i + 1) % n
|
|
48
|
+
self.A += 0.5 * (self.z_coords[j] * self.y_coords[i] - self.z_coords[i] * self.y_coords[j])
|
|
49
|
+
|
|
50
|
+
def calculate_first_moments(self):
|
|
51
|
+
self.S_y = 0
|
|
52
|
+
self.S_z = 0
|
|
53
|
+
n = self.len
|
|
54
|
+
for i in range(n):
|
|
55
|
+
j = (i + 1) % n
|
|
56
|
+
common = self.y_coords[i] * self.z_coords[j] - self.y_coords[j] * self.z_coords[i]
|
|
57
|
+
self.S_y += (self.z_coords[i] + self.z_coords[j]) * common
|
|
58
|
+
self.S_z += (self.y_coords[i] + self.y_coords[j]) * common
|
|
59
|
+
self.S_y /= 6
|
|
60
|
+
self.S_z /= 6
|
|
61
|
+
|
|
62
|
+
def calculate_centroid(self):
|
|
63
|
+
# Berechnet den Schwerpunkt des Polygons
|
|
64
|
+
self.ys = self.S_y / self.A
|
|
65
|
+
self.zs = self.S_z / self.A
|
|
66
|
+
self.centroid = np.array([self.ys, self.zs])
|
|
67
|
+
|
|
68
|
+
def calculate_second_moments(self):
|
|
69
|
+
self.I_yy = 0
|
|
70
|
+
self.I_zz = 0
|
|
71
|
+
n = self.len
|
|
72
|
+
for i in range(n):
|
|
73
|
+
j = (i + 1) % n
|
|
74
|
+
common = self.y_coords[i] * self.z_coords[j] - self.y_coords[j] * self.z_coords[i]
|
|
75
|
+
Iyy_term = (self.z_coords[i]**2 + self.z_coords[i]*self.z_coords[j] + self.z_coords[j]**2) * common
|
|
76
|
+
Izz_term = (self.y_coords[i]**2 + self.y_coords[i]*self.y_coords[j] + self.y_coords[j]**2) * common
|
|
77
|
+
self.I_yy += Iyy_term
|
|
78
|
+
self.I_zz += Izz_term
|
|
79
|
+
self.I_yy = self.I_yy / 12 - self.zs**2 * self.A # Steiner-Anteil
|
|
80
|
+
self.I_zz = self.I_zz / 12 - self.ys**2 * self.A # Steiner-Anteil
|
|
81
|
+
|
|
82
|
+
def calculate_deviation_moment_yz(self):
|
|
83
|
+
self.I_yz = 0
|
|
84
|
+
n = self.len
|
|
85
|
+
for i in range(n):
|
|
86
|
+
j = (i + 1) % n
|
|
87
|
+
common = self.y_coords[i] * self.z_coords[j] - self.y_coords[j] * self.z_coords[i]
|
|
88
|
+
term = (self.y_coords[i]*self.z_coords[j] + 2*self.y_coords[i]*self.z_coords[i] +
|
|
89
|
+
2*self.y_coords[j]*self.z_coords[j] + self.y_coords[j]*self.z_coords[i])
|
|
90
|
+
self.I_yz += term * common
|
|
91
|
+
self.I_yz = self.I_yz / 24 - self.ys * self.zs * self.A # Steiner-Anteil
|
|
92
|
+
|
|
93
|
+
# Funktionen zur Manipulation des Polygons
|
|
94
|
+
|
|
95
|
+
def rotate(self, angle_degrees):
|
|
96
|
+
"""
|
|
97
|
+
Rotiert das Polygon um seinen Schwerpunkt um den angegebenen Winkel.
|
|
98
|
+
|
|
99
|
+
Parameter:
|
|
100
|
+
angle_degrees (float): Rotationswinkel in Grad.
|
|
101
|
+
"""
|
|
102
|
+
angle_radians = np.deg2rad(angle_degrees)
|
|
103
|
+
# Translation zum Ursprung (Schwerpunkt am Ursprung)
|
|
104
|
+
translated_polygon = self.original_vertices - self.centroid
|
|
105
|
+
# Rotationsmatrix erstellen
|
|
106
|
+
rotation_matrix = np.array([
|
|
107
|
+
[np.cos(angle_radians), -np.sin(angle_radians)],
|
|
108
|
+
[np.sin(angle_radians), np.cos(angle_radians)]
|
|
109
|
+
])
|
|
110
|
+
# Polygon rotieren
|
|
111
|
+
rotated_polygon = np.dot(translated_polygon, rotation_matrix)
|
|
112
|
+
# Zurück zum ursprünglichen Ort verschieben
|
|
113
|
+
self.vertices = rotated_polygon + self.centroid
|
|
114
|
+
# Aktualisieren der Koordinaten
|
|
115
|
+
self.y_coords = self.vertices[:, 0]
|
|
116
|
+
self.z_coords = self.vertices[:, 1]
|
|
117
|
+
# Aktualisieren der ursprünglichen Vertices für weitere Rotationen
|
|
118
|
+
self.original_vertices = self.vertices.copy()
|
|
119
|
+
# Neu berechnen der Querschnittsgrößen
|
|
120
|
+
self.calculate_area()
|
|
121
|
+
self.calculate_first_moments()
|
|
122
|
+
self.calculate_centroid()
|
|
123
|
+
self.calculate_second_moments()
|
|
124
|
+
self.calculate_deviation_moment_yz()
|
|
125
|
+
|
|
126
|
+
def calculate_section_width_at_height(self, height):
|
|
127
|
+
"""
|
|
128
|
+
Berechnet die Breite des Querschnitts auf einer bestimmten Höhe (y-Wert).
|
|
129
|
+
|
|
130
|
+
Parameter:
|
|
131
|
+
height (float): Der y-Wert, bei dem die Querschnittsbreite berechnet werden soll.
|
|
132
|
+
|
|
133
|
+
Rückgabe:
|
|
134
|
+
float: Breite des Querschnitts an der angegebenen Höhe.
|
|
135
|
+
"""
|
|
136
|
+
# Kanten des Polygons erhalten
|
|
137
|
+
edges = []
|
|
138
|
+
for i in range(len(self.vertices)):
|
|
139
|
+
p1 = self.vertices[i]
|
|
140
|
+
p2 = self.vertices[(i + 1) % len(self.vertices)]
|
|
141
|
+
edges.append((p1, p2))
|
|
142
|
+
|
|
143
|
+
# Schnittpunkte mit der horizontalen Linie auf der angegebenen Höhe finden
|
|
144
|
+
intersections = []
|
|
145
|
+
for p1, p2 in edges:
|
|
146
|
+
if (p1[1] <= height <= p2[1]) or (p2[1] <= height <= p1[1]):
|
|
147
|
+
if p1[1] != p2[1]: # Division durch Null vermeiden
|
|
148
|
+
x_intersect = p1[0] + (height - p1[1]) * (p2[0] - p1[0]) / (p2[1] - p1[1])
|
|
149
|
+
intersections.append(x_intersect)
|
|
150
|
+
|
|
151
|
+
# Breite berechnen
|
|
152
|
+
if len(intersections) >= 2:
|
|
153
|
+
intersections.sort()
|
|
154
|
+
return intersections[-1] - intersections[0]
|
|
155
|
+
return 0.0
|
|
156
|
+
|
|
157
|
+
# Plot-Funktion
|
|
158
|
+
def plot(self, height=None):
|
|
159
|
+
"""
|
|
160
|
+
Zeichnet das ursprüngliche und das aktuelle Polygon und optional eine horizontale Linie auf der angegebenen Höhe.
|
|
161
|
+
|
|
162
|
+
Parameter:
|
|
163
|
+
height (float, optional): Der y-Wert, bei dem eine horizontale Linie gezeichnet werden soll.
|
|
164
|
+
"""
|
|
165
|
+
plt.figure()
|
|
166
|
+
plt.plot(*self.original_vertices.T, 'b-', label='Ursprüngliches Polygon')
|
|
167
|
+
plt.plot(*self.vertices.T, 'r-', label='Aktuelles Polygon')
|
|
168
|
+
plt.fill(*self.original_vertices.T, 'b', alpha=0.3)
|
|
169
|
+
plt.fill(*self.vertices.T, 'r', alpha=0.3)
|
|
170
|
+
if height is not None:
|
|
171
|
+
plt.axhline(y=height, color='g', linestyle='--', label=f'Höhe = {height}')
|
|
172
|
+
plt.legend()
|
|
173
|
+
plt.xlabel('y')
|
|
174
|
+
plt.ylabel('z')
|
|
175
|
+
plt.title('Polygon und Querschnittsbreite auf spezifischer Höhe')
|
|
176
|
+
plt.axis('equal')
|
|
177
|
+
plt.show()
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
# vertices = [
|
|
181
|
+
# [0, 0],
|
|
182
|
+
# [0.40, 0],
|
|
183
|
+
# [0.40, 0.40],
|
|
184
|
+
# [0, 0.40]
|
|
185
|
+
# ]
|
|
186
|
+
|
|
187
|
+
# polygon = PolygonSection(vertices)
|
|
188
|
+
|
|
189
|
+
# print("Fläche A:", polygon.A)
|
|
190
|
+
# print("Flächenträgheitsmoment I_yy:", polygon.I_yy)
|
|
191
|
+
# print("Flächenträgheitsmoment I_zz:", polygon.I_zz)
|
|
192
|
+
# print("Produktträgheitsmoment I_yz:", polygon.I_yz)
|
|
193
|
+
# print("Schwerpunkt ys:", polygon.ys)
|
|
194
|
+
# print("Schwerpunkt zs:", polygon.zs)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import matplotlib.pyplot as plt
|
|
3
|
+
|
|
4
|
+
class CircleSection:
|
|
5
|
+
def __init__(self, radius):
|
|
6
|
+
"""
|
|
7
|
+
Initializes the circle with the given radius.
|
|
8
|
+
|
|
9
|
+
Parameters:
|
|
10
|
+
radius (float): Radius of the circle.
|
|
11
|
+
"""
|
|
12
|
+
self.radius = radius
|
|
13
|
+
|
|
14
|
+
def calculate_section_width_at_height(self, height):
|
|
15
|
+
"""
|
|
16
|
+
Calculates the width of the circle section at a specific height (y-value).
|
|
17
|
+
|
|
18
|
+
Parameters:
|
|
19
|
+
height (float): The y-value at which to calculate the section width.
|
|
20
|
+
|
|
21
|
+
Returns:
|
|
22
|
+
float: Width of the circle section at the specified height.
|
|
23
|
+
"""
|
|
24
|
+
if abs(height) > self.radius:
|
|
25
|
+
return 0.0
|
|
26
|
+
return 2 * np.sqrt(self.radius**2 - height**2)
|
|
27
|
+
|
|
28
|
+
def plot(self, height=None):
|
|
29
|
+
"""
|
|
30
|
+
Plots the circle and optionally a horizontal line at the specified height.
|
|
31
|
+
|
|
32
|
+
Parameters:
|
|
33
|
+
height (float, optional): The y-value at which to plot a horizontal line.
|
|
34
|
+
"""
|
|
35
|
+
theta = np.linspace(0, 2 * np.pi, 100)
|
|
36
|
+
x = self.radius * np.cos(theta)
|
|
37
|
+
y = self.radius * np.sin(theta)
|
|
38
|
+
|
|
39
|
+
plt.figure()
|
|
40
|
+
plt.plot(x, y, 'b-', label='Circle')
|
|
41
|
+
plt.fill(x, y, 'b', alpha=0.3)
|
|
42
|
+
if height is not None:
|
|
43
|
+
plt.axhline(y=height, color='g', linestyle='--', label=f'Height = {height}')
|
|
44
|
+
section_width = self.calculate_section_width_at_height(height)
|
|
45
|
+
plt.plot([-section_width / 2, section_width / 2], [height, height], 'r-', linewidth=2, label=f'Section Width = {section_width:.2f}')
|
|
46
|
+
plt.legend()
|
|
47
|
+
plt.xlabel('x')
|
|
48
|
+
plt.ylabel('y')
|
|
49
|
+
plt.title('Circle and Section Width at Specific Height')
|
|
50
|
+
plt.axis('equal')
|
|
51
|
+
plt.show()
|
|
52
|
+
|
|
53
|
+
# Example usage
|
|
54
|
+
radius = 1.0
|
|
55
|
+
circle = CircleSection(radius)
|
|
56
|
+
|
|
57
|
+
# Define the height at which to calculate the section width
|
|
58
|
+
height = -0.5
|
|
59
|
+
section_width = circle.calculate_section_width_at_height(height)
|
|
60
|
+
print(f"Section width at height {height} is: {section_width}")
|
|
61
|
+
|
|
62
|
+
# Plot the circle and the horizontal line
|
|
63
|
+
circle.plot(height)
|