-
Notifications
You must be signed in to change notification settings - Fork 4
/
M2_Push2SDOF_steel.m
71 lines (61 loc) · 1.98 KB
/
M2_Push2SDOF_steel.m
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
% Transforms a pushover curve to a trilinear SDOF backbone
% written by Mohsen Zaker-Esteghamati
clear
clc
pushdata=csvread('4story_steel.csv');
%%
i=1;
while i<length(pushdata(:,1))
if pushdata(i,1)==pushdata(i+1,1)
pushdata(i,:)=[];
end
i=i+1;
end
xArea=min(pushdata(:,1)):0.001:max(pushdata(:,1));
yArea=interp1(pushdata(:,1),pushdata(:,2),xArea);
PushArea=trapz(xArea,yArea);
%%
%to get the linear part slope
k=(2*pi/1.32)^2;
Fy=max(pushdata(:,2));
%defining the difference between curves
fun=@(x)abs((0.5*Fy*(Fy/k)+0.5*(1+x(1))*Fy*(x(2)-(Fy/k))+0.5*(pushdata(end,1)-x(2))*Fy*x(1))-PushArea);
% fun=@(X)abs(PushArea-((X(1,1)*a*X(1,1))*0.5+(a*X(1,1)+1.05*X(1,2))*0.5*(abs(X(2,1)-X(1,1)))+0.5*(abs(ultXpush-X(2,1)))*1.05*X(1,2)));
%initial guess
X0=[0.95,0.018];
%setting upperbond and lower bond for the solution
[param,fval]=fmincon(fun,X0);
% Plotting the results
%%
x_y=(Fy/k);
Xp=[0, x_y, param(2), pushdata(end,1)];
Yp=[0,Fy, Fy*param(1), 0];
xscaled=Xp.*[0.46,0.46,0.46,0.46];
yscaled=Yp.*0.46;
%%
% Xp=[0 0.004501518 0.044973019 0.089347028]
% Yp=[0 0.277005556 0.308884318 0]
% % pushdata(:,1)=pushdata(:,1)./(15+3*13);
% % pushdata(:,2)=pushdata(:,2)./(193/0.092);
box on
set(gcf,'units','inches','position',[1 1 2 2],'PaperUnits', 'Inches', 'PaperSize', [2, 2])
plot(pushdata(:,1),pushdata(:,2),'k','lineWidth',1.2)
hold on
plot(Xp,Yp,'--r','lineWidth',1.5)
plot(xscaled,yscaled,'lineWidth',1.5,'color',[0.6 0.6 0.6])
set(gca,'FontSize',10)
set(gca,'FontName','Times')
xlabel('Roof drift')
ylabel('V/W')
ylim([0 0.24])
yticks([0:0.12:24])
xlim([0 0.1])
% lg=legend('Pushover curve','SDOF Backbone fit')
% currentLegendPosition = lg.Position;
% newLegendPosition = [0.5 0.7 currentLegendPosition([3 4])];
% % Set new position
% lg.Position = newLegendPosition;
% legend boxoff
%% scaling
Xp=[0, param(1,1), param(2,1), param(3,1)]./(15+3*13);
% Yp=[0,param(1,2), param(2,2), param(3,2)]./(193/0.092);