3-D plot with 3 variables resulting in 3 responses
Mostrar comentarios más antiguos
Hello Everyone,
I am trying to create a 3-d plot with 3 independent variables that result in 3 responses in the three orthogonal directions of the structure. EF= scaling factor that I used amplifies the earthquake effect in the dynamic analysis. I want to see a 3-d plot concerning the change of EF in three orthogonal directions. Any help will be appreciated. Here is the code that I simplified and attached below.
Best,
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
load('Earthquake_Elcenctro_data.mat') % loading Elcentro data in g
load('repsonses.mat')
Qx=Elctorsion(2,:) % rotation in radyan about x-direction
Qy=Qx; % rotation in radyan about y-direction
Qz=Qx; % rotation in radyan about z-direction
T=zeros(4,4,5);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Ux=max(abs(yout(:,9)));
Uy=max(abs(yout(:,18)));
Uz=0;
%%%% building geometric and earthquake data inputs
Tx=max(abs(Elcxyonu(2,:))); % earthquake data x-translational component in g
Ty=max(abs(Elcyyonu(2,:))); % earthquake data y-translational component in g
Tz=max(abs(Elczyonu(2,:))); % earthquake data z-translational component in g
dx=max(abs(Elctorsion(2,:))); % earthquake data x-rotational component in radyan
dy=dx; % earthquake data y-rotational component in radyan
dz=dx; % earthquake data z-rotational component in radyan
Umax=[Ux Uy Uz]'; % top floor displacement vector over time without rotaional components of earthquake.
for i=1:5
%%%% rotation matrix with Eular angles
R=[cos(Qy(i))*cos(Qz(i)), -cos(Qy(i))*sin(Qz(i)), sin(Qy(i));
(sin(Qx(i))*sin(Qy(i))*cos(Qz(i))+cos(Qx(i)*sin(Qz(i)))), sin(Qx(i))*sin(Qy(i))*sin(Qz(i))+cos(Qx(i))*cos(Qz(i)), sin(Qx(i))*sin(Qy(i));
sin(Qx(i))*sin(Qz(i))-cos(Qx(i))*sin(Qy(i))*cos(Qz(i)), sin(Qx(i))*cos(Qz(i))-cos(Qx(i))*sin(Qy(i))*sin(Qz(i)) , cos(Qx(i))*cos(Qy(i))];
%%%% Transformation matrix
T(:,:,i)=[R Umax;
zeros(1,3) ones(1,1)];
end
Ef=zeros(1,4);
t=1;
xyz=zeros(90405:4);
UT_max=zeros(4,1,5);
%%%% Final total translation response including rotational components
for i=0:0.5:10
for j=0:0.5:10
for k=0:0.5:20
for z=1:5
Ef=[i,j,k ones(1,1)]';
UT_max(:,:,t)=T(:,:,z)*Ef;
xyz(t,:)=Ef;
t=t+1;
end
end
end
end
N=length(UT_max)
result=zeros(N,1);
for i=1:N
resultx(i)=UT_max(1,1,i);
resulty(i)=UT_max(2,1,i);
resultz(i)=UT_max(3,1,i);
end
result=[resultx; resulty;resultz]';
figure(1)
scatter3(xyz(:,1),xyz(:,2),xyz(:,3),result);
xlabel('Amplification factor (Ef_x)');
ylabel('Amplification factor (Ef_y)')
zlabel('Amplification factor (Ef_z)')
figure(2)
pdeplot3D(xyz(:,1),xyz(:,2),xyz(:,3),"ColorMapData",result);
xlabel('Amplification factor (Ef_x)');
ylabel('Amplification factor (Ef_y)')
zlabel('Amplification factor (Ef_z)')
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Seismology en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

