-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBeamForces_rev7.py
72 lines (51 loc) · 2.76 KB
/
BeamForces_rev7.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
import pandas as pd
import numpy as np
from find_nearest import find_nearest
from MaxBeamForces_rev1 import max_beam_forces
def get_beam_forces(beamforces_dataframe, unique_name, stations):
'''Prints internal forces for the nearest etabs station given by station parameter'''
'''beamforces_dataframe - etabs exported table "Beam Forces"'''
'''unique_name - beam we want to retrieve internal forces'''
'''stations - locations (x coordinate) we want to retrieve internal forces'''
# filter required beam by unique name
beamforces_dataframe = beamforces_dataframe[beamforces_dataframe["Unique Name"] == unique_name]
# initialize vectors to store data
e_stations = ['']*len(stations)
M_uls = ['']*len(stations)
V = ['']*len(stations)
M_sls = ['']*len(stations)
T = ['']*len(stations)
for i in range(len(stations)):
e_stations[i] = find_nearest(beamforces_dataframe["Station"], stations[i])
# filter by required station
beamforces_dataframe1 = beamforces_dataframe[beamforces_dataframe["Station"] == e_stations[i]]
# get internal forces
M_uls[i] = beamforces_dataframe1[beamforces_dataframe1["Load Case/Combo"] == 'ULS-grav'].sort_values('abs(M3)', ascending = False).iloc[0,:]['M3']
V[i] = beamforces_dataframe1[beamforces_dataframe1["Load Case/Combo"] == 'ULS-grav'].sort_values('abs(V2)', ascending = False).iloc[0, :]['abs(V2)']
M_sls[i] = beamforces_dataframe1[beamforces_dataframe1["Load Case/Combo"] == 'SLS'].sort_values('abs(M3)', ascending = False).iloc[0,:]['M3']
T[i] = beamforces_dataframe1[beamforces_dataframe1["Load Case/Combo"] == 'ULS-grav'].sort_values('abs(T)', ascending = False).iloc[0,:]['abs(T)']
label = beamforces_dataframe.iloc[0, :]["Beam"]
story = beamforces_dataframe.iloc[0, :]["Story"]
un_nm = str(unique_name)
h = beamforces_dataframe.iloc[0, :]["t3"]
b = beamforces_dataframe.iloc[0, :]["t2"]
e_stations = np.array(e_stations)
e_stations = np.round(e_stations, 2)
forces_dic = {'Unique Name': un_nm,
'Label': label,
'Story': story,
'h': h,
'b': b,
'Station': e_stations,
'M_uls': M_uls,
'V': V,
'M_sls': M_sls,
'T': T,
}
forces_df = pd.DataFrame(forces_dic)
max_forces_df = max_beam_forces(beamforces_dataframe, unique_name)
forces_df = pd.concat([forces_df, max_forces_df]).reset_index(drop=True)
#forces_df.to_excel("BeamForces_" + str(label) + "_" + un_nm + ".xlsx")
#print(forces_df)
print(label + '_' + un_nm + ' @ ' + story)
return forces_df