-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGeneratePeaks.py
32 lines (26 loc) · 960 Bytes
/
GeneratePeaks.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
#### Adapted from the original 'GeneratePeaks.tcl' code by Silvia Mazzoni, 2006.
## However, instead of writing the displacement load history into a output file. It will return a list.
def GeneratePeaks(Dmax, DincrStatic=0.1, CycleType="Full",Factor=1):
Disp_List = []
Dmax = Dmax*Factor;
Disp = 0;
if (Dmax <0):
dx = -1*abs(DincrStatic);
else:
dx = abs(DincrStatic);
NstepsPeak = int(abs(Dmax)/DincrStatic)
for i in range(1,NstepsPeak+1):
Disp = Disp + dx
Disp_List.extend([Disp])
if (CycleType != "Push"):
for i in range(1,NstepsPeak+1):
Disp = Disp - dx
Disp_List.extend([Disp])
if (CycleType != "Half"):
for i in range(1,NstepsPeak+1):
Disp = Disp - dx
Disp_List.extend([Disp])
for i in range(1,NstepsPeak+1):
Disp = Disp + dx
Disp_List.extend([Disp])
return Disp_List