Effacer les filtres
Effacer les filtres

Plot story drift?

3 vues (au cours des 30 derniers jours)
azaandria
azaandria le 6 Oct 2023
Commenté : dpb le 15 Oct 2023
Hello, I have the below code. Can someone please show me how to plot the story drift similar to that in the picture?
A little background on this code- this is analyzing structural reliability of a 10 story bldg under ground motion excitation. The base shear, acceleration, & probability density functions are plotted. I am looking to also plot the story drift, if anyone has any experience in this. Thank you
close all
load Vb.txt
load Pq.txt
load Time_dynamical_equation_DPIM.txt
dt=0.005; tend=39.99;
t=0:dt:tend;
transpose(t);
V0=1.6*1e6; threshold=V0;
Vb=abs(Vb);
% Number of points in ground motion;
Nx=7999;
xbegin=floor(min(Vb(:))); xend=ceil(max(Vb(:))); dx=(xend-xbegin)/(Nx-1); x=xbegin:dx:xend;
ZDPIM = zeros(length(t),length(x));
GX0=abs(x-V0);
NG0=find(GX0==min(min(GX0 ...
)));
%% PDF
tic
for j=1:length(t)
Vb_max(j,:)=max(Vb(1:j,:),[],1);
end
N=length(Pq);
sigma=0.5*min(std(Vb_max,[],2),iqr(Vb_max,2)/1.34)*(N)^(-1/5);
sigma(sigma==0)=1e-6;
for i=1:length(Pq)
pp1 = Pq(i)*normpdf(x,Vb_max(:,i),sigma);
ZDPIM= ZDPIM+pp1;
end
for j=1:length(t)
Pf_DPIM(j)=sum(ZDPIM(j,NG0+1:end)*dx);
R_DPIM(j)=1-Pf_DPIM(j);
end
Time_Pf_DPIM=toc
Time_DPIM=Time_dynamical_equation_DPIM+Time_Pf_DPIM
%% CDF
X_threshold=x;
for ii=1:length(x)
idx=find(x==X_threshold(ii));
CDF_DPIM(ii,1)=1-sum(ZDPIM(end,idx+1:end)*dx);
end
dlmwrite('CDF_DPIM_tend.txt',[x', CDF_DPIM]);
%base shear plots
plot(Vb(:,1));
plot(Vb(:,6));
plot(Vb(:,9));
plot(t,Base_shear(1,:));
xticks([0 10 20 30 40]);
xlabel('Period [s]');
ylabel('Base Shear [kN]');
%CDF_DPIM plots
plot(CDF_DPIM);
xlabel('Maximum abs value of base shear [kN]');
ylabel('CDF');
%R_DPIM plots
plot(t,R_DPIM)
xticks([0 10 20 30 40]);
xlabel('Period [s]');
ylabel('Reliability');
%PDF_DPIM plots
plot(Pf_DPIM);
xlabel('Maximum abs value of the base shear [kN]')
ylabel('PDF');
  5 commentaires
azaandria
azaandria le 15 Oct 2023
dpb
dpb le 15 Oct 2023
There are no data files attached; what's wrong with the code plots in the m-files, specifically? Show us the plots you have made; but most of all if you expect somebody to do something here, will have to have the data to actually run whatever code it is that produced the results to plot or provide those results as other .mat files to load without having to regenerate the results. "Help us help you!"

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Contour Plots dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by