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.
Files changed (64) hide show
  1. Examples/Cross_Section_Thin.py +61 -0
  2. Examples/__init__.py +0 -0
  3. KIB_LAP/Betonbau/Bemessung_Polygon.py +667 -0
  4. KIB_LAP/Betonbau/Bemessung_Zust_II.py +648 -0
  5. KIB_LAP/Betonbau/Cross_Section_Kappa.py +925 -0
  6. KIB_LAP/Betonbau/Druckglied_KGV.py +179 -0
  7. KIB_LAP/Betonbau/Iterative_Design.py +723 -0
  8. KIB_LAP/Betonbau/Materialkennwerte_Beton.py +196 -0
  9. KIB_LAP/Betonbau/Querschnittsbreite.py +194 -0
  10. KIB_LAP/Betonbau/Querschnittsbreite_Kreis.py +63 -0
  11. KIB_LAP/Betonbau/__init__.py +2 -0
  12. KIB_LAP/Betonbau/beam_plate_T.py +921 -0
  13. KIB_LAP/Betonbau/beam_plate_T_reverse.py +915 -0
  14. KIB_LAP/Betonbau/beam_rectangular.py +635 -0
  15. KIB_LAP/Betonbau/beam_sub_section.py +9 -0
  16. KIB_LAP/Dynamik/Cross_Section_Properties.py +155 -0
  17. KIB_LAP/Dynamik/Deformation_Method.py +587 -0
  18. KIB_LAP/Dynamik/Duhamel_SDOF.py +221 -0
  19. KIB_LAP/Dynamik/FFT.py +87 -0
  20. KIB_LAP/Dynamik/Kontinuum_Eigenmodes.py +418 -0
  21. KIB_LAP/Dynamik/Kontinuum_Schwingung.py +757 -0
  22. KIB_LAP/Dynamik/Pendulum_Spring_Linearized.py +91 -0
  23. KIB_LAP/Dynamik/Pendulum_Spring_Problem.py +94 -0
  24. KIB_LAP/Dynamik/__init__.py +0 -0
  25. KIB_LAP/Examples/Cross_Section_Thin.py +61 -0
  26. KIB_LAP/Examples/Cross_Section_Thin_2.py +14 -0
  27. KIB_LAP/Examples/Plattentragwerke.py +39 -0
  28. KIB_LAP/Examples/Plattentragwerke_2.py +60 -0
  29. KIB_LAP/Examples/ShearDesign.py +28 -0
  30. KIB_LAP/Examples/__init__.py +0 -0
  31. KIB_LAP/Plattenbeulen/Plate_Design.py +276 -0
  32. KIB_LAP/Plattenbeulen/Ritz_Optimiert.py +658 -0
  33. KIB_LAP/Plattenbeulen/__init__.py +2 -0
  34. KIB_LAP/Plattenbeulen/dist/__init__.py +0 -0
  35. KIB_LAP/Plattenbeulen/plate_buckling.cpp +561 -0
  36. KIB_LAP/Plattenbeulen/plate_buckling_cpp.cp313-win_amd64.pyd +0 -0
  37. KIB_LAP/Plattenbeulen/plate_buckling_cpp.cpp +561 -0
  38. KIB_LAP/Plattenbeulen/setup.py +35 -0
  39. KIB_LAP/Plattentragwerke/Functions.cpp +326 -0
  40. KIB_LAP/Plattentragwerke/Functions.h +41 -0
  41. KIB_LAP/Plattentragwerke/NumInte.cpp +23 -0
  42. KIB_LAP/Plattentragwerke/NumericalIntegration.cpp +23 -0
  43. KIB_LAP/Plattentragwerke/PlateBendingKirchhoff.py +843 -0
  44. KIB_LAP/Plattentragwerke/__init__.py +1 -0
  45. KIB_LAP/Plattentragwerke/plate_bending.cpp +341 -0
  46. KIB_LAP/Plattentragwerke/plate_bending_cpp.cp313-win_amd64.pyd +0 -0
  47. KIB_LAP/Plattentragwerke/setup.py +39 -0
  48. KIB_LAP/Querschnittswerte/Querschnitt_Duenn.py +526 -0
  49. KIB_LAP/Querschnittswerte/__init__.py +1 -0
  50. KIB_LAP/STABRAUM/InputData.py +92 -0
  51. KIB_LAP/STABRAUM/Programm.py +1403 -0
  52. KIB_LAP/STABRAUM/Steifigkeitsmatrix.py +275 -0
  53. KIB_LAP/STABRAUM/__init__.py +3 -0
  54. KIB_LAP/Stahlbau/__init__.py +0 -0
  55. KIB_LAP/Verbundbau/Verbundtraeger_Bemessung.py +766 -0
  56. KIB_LAP/Verbundbau/__init__.py +0 -0
  57. KIB_LAP/__init__.py +4 -0
  58. KIB_LAP/main.py +2 -0
  59. KIB_LAP/plate_bending_cpp.cp313-win_amd64.pyd +0 -0
  60. KIB_LAP/plate_buckling_cpp.cp313-win_amd64.pyd +0 -0
  61. kib_lap-0.5.dist-info/METADATA +25 -0
  62. kib_lap-0.5.dist-info/RECORD +64 -0
  63. kib_lap-0.5.dist-info/WHEEL +5 -0
  64. kib_lap-0.5.dist-info/top_level.txt +1 -0
@@ -0,0 +1,757 @@
1
+ import numpy as np
2
+ import pandas as pd
3
+
4
+ from scipy.interpolate import interp1d
5
+
6
+ import sqlite3
7
+ import matplotlib.pyplot as plt
8
+ try:
9
+ from Deformation_Method import DeformationMethod
10
+ from Cross_Section_Properties import cross_section_polygon
11
+ except:
12
+ from KIB_LAP.Dynamik.Deformation_Method import DeformationMethod
13
+ from KIB_LAP.Dynamik.Cross_Section_Properties import cross_section_polygon
14
+
15
+
16
+ class Balkenschwingungen:
17
+ def __init__(
18
+ self,
19
+ _l=16.40,
20
+ _A=1.00,
21
+ _rho=5063,
22
+ _xi=0.0257,
23
+ _E=2.1e11,
24
+ _I=0.0288,
25
+ _t_ber = 5,
26
+ _BC="Hinged-Hinged",
27
+ _cross_section=None,
28
+ _x0 = 16.4/2,
29
+ _v_train = 300
30
+ ):
31
+ ## Calculation Parameters
32
+
33
+ self.ndt = 20 # Anzahl der Unterteilungen der kleinsten
34
+
35
+ self.x0 = _x0 # Stelle der Ausgabe [m]
36
+
37
+ self.n = 5 # Anzahl der berücksichtigten Eigenformen
38
+
39
+ self.v_zug_kmh = _v_train # Zuggeschwindigkeit in [km/h]
40
+
41
+ ## Parameters for the pedestrian force vectors
42
+
43
+ self.v_pedestrian = 2.205 # Speed of the pedestrian walk in [m/s]
44
+
45
+ # Calculation time for harmonic and pedestrian calculation
46
+
47
+ self.t_ber = _t_ber # Dauer der Berechnung
48
+ self.dt = 1e-3 # Definition of the time step
49
+
50
+ # Integrationsparameter
51
+ self.alpha = 0.5
52
+ self.beta = 0.25
53
+
54
+ # Voreinstellung der Lagerbedingungen
55
+
56
+ self.boundary_condition = _BC
57
+
58
+ # System properties
59
+
60
+ self.l = _l # Trägerlänge [m]
61
+ if _cross_section == None:
62
+ self.A = _A
63
+ self.I = _I # Flächenträgheitsmoment [m^4]
64
+ else:
65
+ self.A = _cross_section.A
66
+ self.I = _cross_section.I_yy
67
+ self.rho = _rho
68
+ self.mue = self.A * self.rho # Masse pro Längeneinheit [kg/m]
69
+ self.xi = _xi # Dämpfungsmaß [-]
70
+
71
+ self.E = _E # Elastizitätsmodul [N/m^2]
72
+
73
+ # Loading condition
74
+
75
+ self.loading = "train"
76
+
77
+ # Harmonic-Loading
78
+
79
+ self.OMEGA = 6.38 * 2 * np.pi
80
+ self.PHI_0 = 0
81
+ self.F_0_H = 1e5
82
+
83
+ # Test function
84
+
85
+ self.test = False
86
+ # Functions
87
+
88
+ if self.test == True:
89
+ self.load_database()
90
+ self.load_definition()
91
+ self.system_properties()
92
+ self.load_conditions()
93
+ self.generalized_load_function()
94
+ self.beta_newmark()
95
+
96
+ else:
97
+ self.load_database()
98
+ self.load_definition()
99
+ self.system_properties()
100
+ self.load_conditions()
101
+ self.generalized_load_function()
102
+ self.beta_newmark()
103
+
104
+ def load_database(self):
105
+ db_name = "Database/eigenmodes.db"
106
+ # Connect to the SQLite database
107
+ self.conn = sqlite3.connect(db_name)
108
+ self.cursor = self.conn.cursor()
109
+
110
+ # Initializing numpy arrays
111
+ self.lambda_cantilever = np.zeros(20)
112
+ self.lambda_clamped_hinged = np.zeros(20)
113
+ self.lambda_hinged_hinged = np.zeros(20)
114
+ self.lambda_clamped_clamped = np.zeros(20)
115
+
116
+ self.lambda_hinged_hinged_twospan = np.zeros(20)
117
+
118
+ self.a_lambda_cantilever = np.zeros(20)
119
+ self.a_lambda_clamped_hinged = np.zeros(20)
120
+ self.a_lambda_clamped_clamped = np.zeros(20)
121
+
122
+ self.J1_cantilever = np.zeros(20)
123
+ self.J1_clamped_hinged = np.zeros(20)
124
+ self.J1_hinged_hinged = np.zeros(20)
125
+ self.J1_clamped_clamped = np.zeros(20)
126
+
127
+ self.J2_cantilever = np.zeros(20)
128
+ self.J2_clamped_hinged = np.zeros(20)
129
+ self.J2_hinged_hinged = np.zeros(20)
130
+ self.J2_clamped_clamped = np.zeros(20)
131
+
132
+ self.J3_cantilever = np.zeros(20)
133
+ self.J3_clamped_hinged = np.zeros(20)
134
+ self.J3_hinged_hinged = np.zeros(20)
135
+ self.J3_clamped_clamped = np.zeros(20)
136
+
137
+ # Saving the Data-Base into the numpy arrays
138
+
139
+ self.cursor.execute(
140
+ "SELECT lambda_cantilever, lambda_clamped_hinged, lambda_hinged_hinged, lambda_clamped_clamped FROM eigenvalues"
141
+ )
142
+ data = self.cursor.fetchall()
143
+ for i, row in enumerate(data):
144
+ (
145
+ self.lambda_cantilever[i],
146
+ self.lambda_clamped_hinged[i],
147
+ self.lambda_hinged_hinged[i],
148
+ self.lambda_clamped_clamped[i],
149
+ ) = row
150
+
151
+ self.cursor.execute(
152
+ "SELECT a_lambda_cantilever, a_lambda_clamped_hinged, a_lambda_clamped_clamped FROM a_lambda"
153
+ )
154
+ data = self.cursor.fetchall()
155
+ for i, row in enumerate(data):
156
+ (
157
+ self.a_lambda_cantilever[i],
158
+ self.a_lambda_clamped_hinged[i],
159
+ self.a_lambda_clamped_clamped[i],
160
+ ) = row
161
+
162
+ self.cursor.execute(
163
+ "SELECT J1_cantilever, J1_clamped_hinged, J1_hinged_hinged, J1_clamped_clamped FROM J1"
164
+ )
165
+ data = self.cursor.fetchall()
166
+ for i, row in enumerate(data):
167
+ (
168
+ self.J1_cantilever[i],
169
+ self.J1_clamped_hinged[i],
170
+ self.J1_hinged_hinged[i],
171
+ self.J1_clamped_clamped[i],
172
+ ) = row
173
+
174
+ self.cursor.execute(
175
+ "SELECT J2_cantilever, J2_clamped_hinged, J2_hinged_hinged, J2_clamped_clamped FROM J2"
176
+ )
177
+ data = self.cursor.fetchall()
178
+ for i, row in enumerate(data):
179
+ (
180
+ self.J2_cantilever[i],
181
+ self.J2_clamped_hinged[i],
182
+ self.J2_hinged_hinged[i],
183
+ self.J2_clamped_clamped[i],
184
+ ) = row
185
+
186
+ self.cursor.execute(
187
+ "SELECT J3_cantilever, J3_clamped_hinged, J3_hinged_hinged, J3_clamped_clamped FROM J3"
188
+ )
189
+ data = self.cursor.fetchall()
190
+ for i, row in enumerate(data):
191
+ (
192
+ self.J3_cantilever[i],
193
+ self.J3_clamped_hinged[i],
194
+ self.J3_hinged_hinged[i],
195
+ self.J3_clamped_clamped[i],
196
+ ) = row
197
+
198
+ for i in range(1,len(data)+1):
199
+ if (i%2==1):
200
+ self.lambda_hinged_hinged_twospan[i-1] = self.lambda_hinged_hinged[(i-1)//2]
201
+ else:
202
+ self.lambda_hinged_hinged_twospan[i-1] = self.lambda_clamped_hinged[(i//2)-1]
203
+
204
+ print("Lambda - Two Span")
205
+ print(self.lambda_hinged_hinged_twospan)
206
+ # Close the connection
207
+ self.conn.close()
208
+
209
+ def load_definition(self):
210
+ if self.loading == "train":
211
+ Kraftdefinition = pd.read_csv(
212
+ "Trainpassing/Inputdatei_1.txt", delim_whitespace=True
213
+ )
214
+ # # # Coordinates related to the first pair of wheels in [m]
215
+ self.x_k = Kraftdefinition.iloc[:, 0].to_list()
216
+ # # # Axial loads in [kN]
217
+ self.P_k = Kraftdefinition.iloc[:, 1].to_list()
218
+
219
+ self.P_k_array = np.zeros(len(self.P_k))
220
+
221
+ for i in range(0, len(self.P_k), 1):
222
+ self.P_k_array[i] = self.P_k[i]
223
+
224
+ elif self.loading == "harmonic_single":
225
+ self.x_k = self.l / 2
226
+ self.P_k = 1
227
+
228
+ def numeric_eigenvalues(self):
229
+ # Calculation for numeric eigenmodes
230
+ if self.boundary_condition == "Hinged-Hinged-Numeric":
231
+ self.Deformation_Num = DeformationMethod(
232
+ 30, self.E, self.I, self.A, self.rho, self.l, "SPG", [1, 1], 1000
233
+ )
234
+ self.Deformation_Num.single_span_girder()
235
+ self.Deformation_Num.compute_eigenfrequencies()
236
+ self.Deformation_Num.modal_matrices()
237
+ elif self.boundary_condition == "Two-Span-Girder":
238
+ self.Deformation_Num = DeformationMethod(
239
+ 30, self.E, self.I, self.A, self.rho, self.l, "SPG", [1, 1], 1000
240
+ )
241
+ self.Deformation_Num.single_span_girder()
242
+ self.Deformation_Num.compute_eigenfrequencies()
243
+ self.Deformation_Num.modal_matrices()
244
+
245
+ def load_conditions(self):
246
+ # Eigenformen am Ausgabepunkt
247
+ self.phi_a = np.zeros(self.n)
248
+
249
+ # Loop for defining the eigenmodes at the loading point
250
+ for i in range(self.n):
251
+ if self.boundary_condition == "Hinged-Hinged":
252
+ self.phi_a[i] = self.hinged_hinged(self.x0, i)
253
+ elif self.boundary_condition == "Hinged-Hinged-Numeric":
254
+ self.phi_a[i] = self.hinged_hinged_numeric(self.x0, i)
255
+ elif self.boundary_condition == "Clamped-Hinged":
256
+ self.phi_a[i] = self.clamped_hinged(self.x0, i)
257
+ elif self.boundary_condition == "Clamped-Clamped":
258
+ self.phi_a[i] = self.clamped_clamped(self.x0, i)
259
+ elif self.boundary_condition == "Cantilever":
260
+ self.phi_a[i] = self.cantilever(self.x0, i)
261
+ elif self.boundary_condition == "Hinged-Hinged-TwoSpan":
262
+ self.phi_a[i] = self.hingedhinged_twospan(self.x0, i)
263
+
264
+ if self.loading == "train":
265
+ # Train-Passing
266
+ self.v_zug = self.v_zug_kmh * 1000 / 3600 # Zuggeschwindigkeit in [m/s]
267
+ self.dt = 1e-3
268
+ self.l_zug = max(self.x_k) # Zuglänge
269
+ self.T_u = (self.l + self.l_zug) / (
270
+ self.v_zug
271
+ ) # Zeit zur Überquerung des Trägers
272
+
273
+ self.nt = int(np.ceil(self.t_ber / self.dt) + 1) # Anzahl der Zeitschritte
274
+
275
+ # Erstellung des Zeitvektors
276
+ self.t = np.arange(0, self.nt * self.dt, self.dt)
277
+
278
+ # Kraftdefinition für die Berechnung
279
+
280
+ # Matrix zur Berücksichtigung der sich auf der Brücke befindenden Lasten
281
+ # in jedem Zeitschritt
282
+
283
+ self.F_Mat = np.zeros(
284
+ (len(self.x_k), self.nt)
285
+ ) # rows -> Index of the train load, cols = number of time steps
286
+
287
+ print(max(self.t))
288
+
289
+ for i in range(self.nt):
290
+ for j in range(len(self.x_k)):
291
+ if (-self.x_k[j] + self.v_zug * self.t[i] > 0) and (
292
+ -self.x_k[j] + self.v_zug * self.t[i] < self.l
293
+ ): # Condition, that the train needs to be on the bridge
294
+ self.F_Mat[j][i] = self.P_k[j]
295
+ else:
296
+ self.F_Mat[j][i] = 0
297
+
298
+ elif self.loading == "harmonic_single":
299
+ self.nt = int(np.ceil(self.t_ber / self.dt) + 1) # Anzahl der Zeitschritte
300
+ self.t = np.arange(0, self.nt * self.dt, self.dt)
301
+
302
+ self.F_Mat = np.zeros(
303
+ self.nt
304
+ ) # rows = number of time steps, because there is just one single load
305
+
306
+ for i in range(self.nt):
307
+ self.F_Mat[i] = self.F_0_H * np.sin(
308
+ self.OMEGA * self.dt * i - self.PHI_0
309
+ )
310
+
311
+ elif self.loading == "pedestrian":
312
+ self.nt = int(np.ceil(self.t_ber / self.dt) + 1) # Anzahl der Zeitschritte
313
+ self.t = np.arange(0, self.nt * self.dt, self.dt)
314
+
315
+ self.F_Mat = np.zeros(
316
+ self.nt
317
+ ) # rows = number of time steps, because there is just one single load
318
+
319
+ g_pedestrian = 700 # 800 N for normal case
320
+ coeff_1 = 0.50
321
+ coeff_2 = 0.10
322
+ coeff_3 = 0.10
323
+
324
+ step = 0.90
325
+
326
+ for i in range(self.nt):
327
+ if (self.v_pedestrian * self.t[i] > 0) and (
328
+ self.v_pedestrian * self.t[i] < self.l
329
+ ):
330
+ self.F_Mat[i] = (
331
+ 1
332
+ + coeff_1 * np.sin(2 * np.pi * 2.45 * self.t[i])
333
+ + coeff_2 * np.sin(4 * np.pi * 2.45 * self.t[i] - np.pi / 2)
334
+ + coeff_3 * np.sin(6 * np.pi * 2.45 * self.t[i] - np.pi / 2)
335
+ ) * g_pedestrian
336
+ else:
337
+ self.F_Mat[i] = 0
338
+
339
+ def system_properties(self):
340
+ # Berechnung weiterer System- und Berechnungsparameter
341
+ self.Freq = np.zeros(self.n) # Eigenfrequenzen
342
+ self.Omega = np.zeros(self.n) # Eigenkreisfrequenzen
343
+ self.T = np.zeros(self.n) # Eigenschwingzeiten
344
+
345
+ if self.boundary_condition == "Hinged-Hinged":
346
+ for i in range(0, self.n, 1):
347
+ if i == 0:
348
+ self.Freq[i] = i # Static movement due to the
349
+ else:
350
+ self.Freq[i] = (
351
+ (self.lambda_hinged_hinged[i - 1]) ** 2
352
+ / (2 * np.pi * self.l**2)
353
+ ) * np.sqrt(self.E * self.I / self.mue)
354
+ print(self.Freq[i])
355
+
356
+ self.Omega[i] = 2 * np.pi * self.Freq[i]
357
+ if i == 0:
358
+ self.T[i] = 1e9
359
+ else:
360
+ self.T[i] = 1 / self.Freq[i]
361
+
362
+ self.m = np.zeros(self.n) # Vektor der modalen Massen
363
+ self.k = np.zeros(self.n) # Vektor der modalen Steifigkeiten
364
+ self.d = np.zeros(self.n) # Vektor der modalen Dämpferkonstanten
365
+
366
+ for i in range(self.n):
367
+ self.m[i] = self.J1_hinged_hinged[i] * self.mue * self.l
368
+ self.k[i] = self.Omega[i] ** 2 * self.m[i]
369
+ self.d[i] = 2 * self.xi * np.sqrt(self.k[i] * self.m[i])
370
+
371
+ print(self.m)
372
+
373
+ elif self.boundary_condition == "Hinged-Hinged-Numeric":
374
+ print("System Properties")
375
+
376
+ for i in range(0, self.n, 1):
377
+ self.Freq[i] = self.Deformation_Num.eigenfrequencies[i] / (np.pi * 2)
378
+ self.Omega[i] = self.Deformation_Num.eigenfrequencies[i]
379
+ self.T[i] = 1 / self.Freq[i]
380
+
381
+ print(self.Deformation_Num.M_trans)
382
+ print(self.Deformation_Num.K_trans)
383
+
384
+ self.m = np.zeros(self.n) # Vektor der modalen Massen
385
+ self.k = np.zeros(self.n) # Vektor der modalen Steifigkeiten
386
+ self.d = np.zeros(self.n) # Vektor der modalen Dämpferkonstanten
387
+
388
+ for i in range(self.n):
389
+ self.m[i] = self.Deformation_Num.M_trans[i][i]
390
+ self.k[i] = self.Deformation_Num.K_trans[i][i]
391
+ self.d[i] = 2 * self.xi * np.sqrt(self.k[i] * self.m[i])
392
+
393
+ elif self.boundary_condition == "Clamped-Hinged":
394
+ for i in range(0, self.n, 1):
395
+ if i == 0:
396
+ self.Freq[i] = i # Static movement ? Check, if necessary
397
+ else:
398
+ self.Freq[i] = (
399
+ (self.lambda_clamped_hinged[i - 1]) ** 2
400
+ / (2 * np.pi * self.l**2)
401
+ ) * np.sqrt(self.E * self.I / self.mue)
402
+ print(self.Freq[i])
403
+
404
+ self.Omega[i] = 2 * np.pi * self.Freq[i]
405
+ if i == 0:
406
+ self.T[i] = 1e9
407
+ else:
408
+ self.T[i] = 1 / self.Freq[i]
409
+
410
+ self.m = np.zeros(self.n) # Vektor der modalen Massen
411
+ self.k = np.zeros(self.n) # Vektor der modalen Steifigkeiten
412
+ self.d = np.zeros(self.n) # Vektor der modalen Dämpferkonstanten
413
+
414
+ for i in range(self.n):
415
+ self.m[i] = self.J1_clamped_hinged[i] * self.mue * self.l
416
+ self.k[i] = self.Omega[i] ** 2 * self.m[i]
417
+ self.d[i] = 2 * self.xi * np.sqrt(self.k[i] * self.m[i])
418
+
419
+ print(self.m)
420
+
421
+ elif self.boundary_condition == "Clamped-Clamped":
422
+ for i in range(0, self.n, 1):
423
+ if i == 0:
424
+ self.Freq[i] = i # Static movement due to the
425
+ else:
426
+ self.Freq[i] = (
427
+ (self.lambda_clamped_clamped[i - 1]) ** 2
428
+ / (2 * np.pi * self.l**2)
429
+ ) * np.sqrt(self.E * self.I / self.mue)
430
+ print(self.Freq[i])
431
+
432
+ self.Omega[i] = 2 * np.pi * self.Freq[i]
433
+ if i == 0:
434
+ self.T[i] = 1e9
435
+ else:
436
+ self.T[i] = 1 / self.Freq[i]
437
+
438
+ self.m = np.zeros(self.n) # Vektor der modalen Massen
439
+ self.k = np.zeros(self.n) # Vektor der modalen Steifigkeiten
440
+ self.d = np.zeros(self.n) # Vektor der modalen Dämpferkonstanten
441
+
442
+ for i in range(self.n):
443
+ self.m[i] = self.J1_clamped_clamped[i] * self.mue * self.l
444
+ self.k[i] = self.Omega[i] ** 2 * self.m[i]
445
+ self.d[i] = 2 * self.xi * np.sqrt(self.k[i] * self.m[i])
446
+
447
+ print(self.m)
448
+
449
+ elif self.boundary_condition == "Cantilever":
450
+ for i in range(0, self.n, 1):
451
+ if i == 0:
452
+ self.Freq[i] = i # Static movement due to the
453
+ else:
454
+ self.Freq[i] = (
455
+ (self.lambda_cantilever[i - 1]) ** 2 / (2 * np.pi * self.l**2)
456
+ ) * np.sqrt(self.E * self.I / self.mue)
457
+ print(self.Freq[i])
458
+
459
+ self.Omega[i] = 2 * np.pi * self.Freq[i]
460
+ if i == 0:
461
+ self.T[i] = 1e9
462
+ else:
463
+ self.T[i] = 1 / self.Freq[i]
464
+
465
+ self.m = np.zeros(self.n) # Vektor der modalen Massen
466
+ self.k = np.zeros(self.n) # Vektor der modalen Steifigkeiten
467
+ self.d = np.zeros(self.n) # Vektor der modalen Dämpferkonstanten
468
+
469
+ for i in range(self.n):
470
+ self.m[i] = self.J1_cantilever[i] * self.mue * self.l
471
+ self.k[i] = self.Omega[i] ** 2 * self.m[i]
472
+ self.d[i] = 2 * self.xi * np.sqrt(self.k[i] * self.m[i])
473
+
474
+ print(self.m)
475
+
476
+ def hinged_hinged(self, x_load, n_eigen):
477
+ if n_eigen == 0:
478
+ return np.sin(x_load * 0 / self.l)
479
+ else:
480
+ return np.sin(x_load * self.lambda_hinged_hinged[n_eigen - 1] / self.l)
481
+
482
+ def hinged_hinged_numeric(self, x_load, n_eigen):
483
+ interpolator = interp1d(
484
+ self.Deformation_Num.len_plotting,
485
+ self.Deformation_Num.eigenmodes_matrix[:, n_eigen],
486
+ kind="linear",
487
+ fill_value=0,
488
+ )
489
+ interpolated_value = interpolator(x_load)
490
+ return interpolated_value
491
+
492
+ def clamped_hinged(self, x_load, n_eigen):
493
+ if n_eigen == 0:
494
+ value = 0
495
+ else:
496
+ value = (
497
+ np.sin(self.lambda_clamped_hinged[n_eigen - 1] * x_load / self.l)
498
+ - np.sinh(self.lambda_clamped_hinged[n_eigen - 1] * x_load / self.l)
499
+ + self.a_lambda_clamped_hinged[n_eigen - 1]
500
+ * (
501
+ np.cosh(self.lambda_clamped_hinged[n_eigen - 1] * x_load / self.l)
502
+ - np.cos(self.lambda_clamped_hinged[n_eigen - 1] * x_load / self.l)
503
+ )
504
+ )
505
+ return value
506
+
507
+ def clamped_clamped(self, x_load, n_eigen):
508
+ if n_eigen == 0:
509
+ value = 0
510
+ else:
511
+ value = (
512
+ np.sin(self.lambda_clamped_clamped[n_eigen - 1] * x_load / self.l)
513
+ - np.sinh(self.lambda_clamped_clamped[n_eigen - 1] * x_load / self.l)
514
+ + self.a_lambda_clamped_clamped[n_eigen - 1]
515
+ * (
516
+ np.cosh(self.lambda_clamped_clamped[n_eigen - 1] * x_load / self.l)
517
+ - np.cos(self.lambda_clamped_clamped[n_eigen - 1] * x_load / self.l)
518
+ )
519
+ )
520
+ return value
521
+
522
+ def cantilever(self, x_load, n_eigen):
523
+ if n_eigen == 0:
524
+ value = 0
525
+ else:
526
+ value = (
527
+ np.sin(self.lambda_cantilever[n_eigen - 1] * x_load / self.l)
528
+ - np.sinh(self.lambda_cantilever[n_eigen - 1] * x_load / self.l)
529
+ + self.a_lambda_cantilever[n_eigen - 1]
530
+ * (
531
+ np.cosh(self.lambda_cantilever[n_eigen - 1] * x_load / self.l)
532
+ - np.cos(self.lambda_cantilever[n_eigen - 1] * x_load / self.l)
533
+ )
534
+ )
535
+ return value
536
+
537
+ def hingedhinged_twospan(self,x_load,n_eigen):
538
+ if n_eigen == 0:
539
+ return 0
540
+ else:
541
+ if (n_eigen %2 == 1):
542
+ lambda_n = self.lambda_hinged_hinged[n_eigen-1]
543
+ return np.sin(x_load * lambda_n / self.l)
544
+ else:
545
+ lambda_n = self.lambda_clamped_hinged[n_eigen-1]
546
+ return np.sin(x_load * lambda_n / self.l)
547
+
548
+ def generalized_load_function(self):
549
+ self.Gen_K = np.zeros(
550
+ (self.n, self.nt)
551
+ ) # rows -> Eigenmode 0,...,n , nt = number of the time steps
552
+ if self.loading == "train":
553
+ for u in range(self.n): # Number of eigenmode
554
+ for i in range(self.nt): # Number of timesteps
555
+ for j in range(len(self.x_k)):
556
+ if self.boundary_condition == "Hinged-Hinged":
557
+ self.Gen_K[u][i] += self.F_Mat[j][i] * self.hinged_hinged(
558
+ -self.x_k[j] + self.v_zug * self.t[i], u
559
+ )
560
+ elif self.boundary_condition == "Hinged-Hinged-Numeric":
561
+ try:
562
+ self.Gen_K[u][i] += self.F_Mat[j][
563
+ i
564
+ ] * self.hinged_hinged_numeric(
565
+ -self.x_k[j] + self.v_zug * self.t[i], u
566
+ )
567
+ except:
568
+ self.Gen_K[u][i] += 0
569
+ elif self.boundary_condition == "Clamped-Hinged":
570
+ self.Gen_K[u][i] += self.F_Mat[j][i] * self.clamped_hinged(
571
+ -self.x_k[j] + self.v_zug * self.t[i], u
572
+ )
573
+ elif self.boundary_condition == "Clamped-Hinged-Numeric":
574
+ self.Gen_K[u][i] += self.F_Mat[j][i] * self.clamped_hinged(
575
+ -self.x_k[j] + self.v_zug * self.t[i], u
576
+ )
577
+ elif self.boundary_condition == "Clamped-Clamped":
578
+ self.Gen_K[u][i] += self.F_Mat[j][i] * self.clamped_clamped(
579
+ -self.x_k[j] + self.v_zug * self.t[i], u
580
+ )
581
+ elif self.boundary_condition == "Cantilever":
582
+ self.Gen_K[u][i] += self.F_Mat[j][i] * self.cantilever(
583
+ -self.x_k[j] + self.v_zug * self.t[i], u
584
+ )
585
+
586
+ elif self.loading == "harmonic_single":
587
+ for u in range(self.n):
588
+ for i in range(self.nt):
589
+ if self.boundary_condition == "Hinged-Hinged":
590
+ self.Gen_K[u][i] = self.F_Mat[i] * self.hinged_hinged(
591
+ self.x0, u
592
+ )
593
+ elif self.boundary_condition == "Hinged-Hinged-Numeric":
594
+ self.Gen_K[u][i] = self.F_Mat[i] * self.hinged_hinged_numeric(
595
+ self.x0, u
596
+ )
597
+ elif self.boundary_condition == "Clamped-Hinged":
598
+ self.Gen_K[u][i] = self.F_Mat[i] * self.clamped_hinged(
599
+ self.x0, u
600
+ )
601
+ elif self.boundary_condition == "Clamped-Clamped":
602
+ self.Gen_K[u][i] = self.F_Mat[i] * self.clamped_clamped(
603
+ self.x0, u
604
+ )
605
+ elif self.boundary_condition == "Cantilever":
606
+ self.Gen_K[u][i] = self.F_Mat[i] * self.cantilever(self.x0, u)
607
+
608
+ elif self.loading == "pedestrian":
609
+ for u in range(self.n):
610
+ for i in range(self.nt):
611
+ if self.boundary_condition == "Hinged-Hinged":
612
+ self.Gen_K[u][i] = self.F_Mat[i] * self.hinged_hinged(
613
+ self.v_pedestrian * self.t[i], u
614
+ )
615
+ elif self.boundary_condition == "Hinged-Hinged-Numeric":
616
+ try:
617
+ self.Gen_K[u][i] = self.F_Mat[
618
+ i
619
+ ] * self.hinged_hinged_numeric(
620
+ self.v_pedestrian * self.t[i], u
621
+ )
622
+ except:
623
+ self.Gen_K[u][i] = 0
624
+ elif self.boundary_condition == "Clamped-Hinged":
625
+ self.Gen_K[u][i] = self.F_Mat[i] * self.clamped_hinged(
626
+ self.v_pedestrian * self.t[i], u
627
+ )
628
+ elif self.boundary_condition == "Clamped-Clamped":
629
+ self.Gen_K[u][i] = self.F_Mat[i] * self.clamped_clamped(
630
+ self.v_pedestrian * self.t[i], u
631
+ )
632
+ elif self.boundary_condition == "Cantilever":
633
+ self.Gen_K[u][i] = self.F_Mat[i] * self.cantilever(
634
+ self.v_pedestrian * self.t[i], u
635
+ )
636
+
637
+ def beta_newmark(self):
638
+ # Berechnung der Schwingungsantwort mittels Newmark-Verfahren
639
+
640
+ # Berechnungsvorschrift
641
+ self.ita_y = np.zeros((self.n, len(self.t)))
642
+ self.ita_v = np.zeros((self.n, len(self.t)))
643
+ self.ita_a = np.zeros((self.n, len(self.t)))
644
+
645
+ for j in range(self.n):
646
+ for i in range(1, len(self.t)):
647
+ self.a_h = (
648
+ ((1 / self.beta) * self.m[j])
649
+ + (self.alpha / self.beta) * self.d[j] * self.dt
650
+ + self.k[j] * self.dt**2
651
+ )
652
+ self.b_h = (
653
+ (
654
+ (1 / self.beta) * self.m[j]
655
+ + (self.alpha / self.beta) * self.d[j] * self.dt
656
+ )
657
+ * self.ita_y[j][i - 1]
658
+ + (
659
+ (1 / self.beta) * self.m[j]
660
+ + (self.alpha / self.beta - 1) * self.d[j] * self.dt
661
+ )
662
+ * self.dt
663
+ * self.ita_v[j][i - 1]
664
+ + (
665
+ (1 / (2 * self.beta) - 1) * self.m[j]
666
+ + (self.alpha / (2 * self.beta) - 1) * self.d[j] * self.dt
667
+ )
668
+ * self.dt**2
669
+ * self.ita_a[j][i - 1]
670
+ + self.Gen_K[j][i] * self.dt**2
671
+ )
672
+ self.ita_y[j][i] = self.a_h ** (-1) * self.b_h
673
+ self.ita_v[j][i] = (
674
+ (self.alpha / (self.beta * self.dt))
675
+ * (self.ita_y[j][i] - self.ita_y[j][i - 1])
676
+ - ((self.alpha / self.beta) - 1) * self.ita_v[j][i - 1]
677
+ - (self.alpha / (2 * self.beta) - 1)
678
+ * self.dt
679
+ * self.ita_a[j][i - 1]
680
+ )
681
+ self.ita_a[j][i] = (
682
+ (1 / (self.beta * self.dt**2))
683
+ * (self.ita_y[j][i] - self.ita_y[j][i - 1])
684
+ - 1 / (self.beta * self.dt) * self.ita_v[j][i - 1]
685
+ - (1 / (2 * self.beta) - 1) * self.ita_a[j][i - 1]
686
+ )
687
+
688
+ # Überlagerung aller Eigenformen
689
+ self.y = np.zeros(len(self.t)) # Vektor der Gesamtverschiebung
690
+ self.v = np.zeros(len(self.t)) # Vektor der Gesamtgeschwindigkeit
691
+ self.a = np.zeros(len(self.t)) # Vektor der Gesamtbeschleunigung
692
+
693
+ for j in range(self.n):
694
+ for i in range(len(self.t)):
695
+ self.y_tot_h = self.phi_a[j] * self.ita_y[j][i]
696
+ self.y[i] += self.y_tot_h
697
+ self.v_tot_h = self.phi_a[j] * self.ita_v[j][i]
698
+ self.v[i] += self.v_tot_h
699
+ self.a_tot_h = self.phi_a[j] * self.ita_a[j][i]
700
+ self.a[i] += self.a_tot_h
701
+
702
+ def extrema(self):
703
+ # Extremwerte
704
+ self.ymax = max(self.y)
705
+ self.ymin = min(self.y)
706
+ self.vmax = max(self.v)
707
+ self.vmin = min(self.v)
708
+ self.amax = max(self.a)
709
+ self.amin = min(self.a)
710
+
711
+ def fourier_transformation(self):
712
+ print("Fourier-Transform")
713
+
714
+ self.delta_t = self.t[2] - self.t[1] # Voraussetzung: Äquidistante Zeitschritte
715
+ self.Tges = (
716
+ len(self.t) * self.delta_t
717
+ ) # Gesamtzeit: Letztes Element des Arrays - Erstes Element des Arrays
718
+
719
+ self.srate = self.delta_t ** (-1)
720
+ time = self.t
721
+ npnts = len(time)
722
+
723
+ # prepare the Fourier transform
724
+ fourTime = np.array(range(npnts)) / npnts
725
+ fCoefs = np.zeros((len(self.y)), dtype=complex)
726
+
727
+ for fi in range(npnts):
728
+ # create complex sine wave
729
+ csw = np.exp(-1j * 2 * np.pi * fi * fourTime)
730
+ # compute dot product between sine wave and signal
731
+ # these are called the Fourier coefficients
732
+ fCoefs[fi] = np.sum(np.multiply(self.y, csw)) / npnts
733
+
734
+ # Fourier spectrum
735
+ signalX = fCoefs
736
+
737
+ self.hz = np.linspace(0, self.srate, npnts)
738
+
739
+ print(len(self.hz))
740
+
741
+ # amplitude
742
+ self.ampl = np.abs(signalX[0 : len(self.hz)])
743
+
744
+ for i in range(0, len(self.hz)):
745
+ if i == 0:
746
+ self.ampl[i] = self.ampl[i]
747
+ else:
748
+ self.ampl[i] = 2 * self.ampl[i]
749
+
750
+ plt.stem(self.hz, self.ampl)
751
+ plt.xlim(0, 30)
752
+ plt.xlabel("Frequency (Hz)")
753
+ plt.ylabel("Amplitude (a.u.)")
754
+ plt.show()
755
+
756
+
757
+