Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What is the script for this in Matlab? 0.6 T 0.4 0.2 -0.22 -0,4 1000 1500 2500 A

ID: 2083486 • Letter: W

Question

What is the script for this in Matlab?

0.6 T 0.4 0.2 -0.22 -0,4 1000 1500 2500 An earthquake data (GM01) is provided as shown. The y axis is its acceleration with unit g. a) Use matlab if/while/for function (do not use cumtrapz or cumsum, etc). Provide a graph of its acceleration, velocity and displacement in a same figure. (Hints: the sum of the AREA of an acceleration graph is its velocity.) b) Find this earthquake's maximum acceleration (m/s2), velocity (m/s) and displacement (cm) c) If the recorder is broken and it can only record the earthquake from 0.2g to -0.2g. Plot the new acceleration vs time graph. d) This ground motion has 2995 data. Expand the number of acceleration data and time data to about 6000 (or more). Plot the new acceleration vs time graph.

Explanation / Answer

function [reponseSpectrum] ... = responseSpectrum(Sa, Sv, T_n) %responseSpectrum(Sa, Sv, T_n) % Function takes the input parameters and produces a simplified response % spectrum. % % The response spectrums produced include Acceleration Spectrum, Velocity % Spectrum, Dispacment Spectrum and the AD response Spectrum. % % Sa =1.2; Sv = 1.5; T_n =1; TIMESTEPS =100; MAXPERIOD = 2.5; GRAVITY = 9.81; PI = 3.1415; PGV = 0.075; %m/s alpha = 2; T_1 = 0.3; % T_1 represents the corner period. On rock sites 0.3 is the accepted value. The maximum acceleration is related to rocks materuial properties and ability to propogate accelerations. T_2 =1.5; % T_1 is 1.5 for rock sites. T = 0:(MAXPERIOD/TIMESTEPS):MAXPERIOD; RSA_base_vector = zeros(1,TIMESTEPS+1);%Rock Site RSD_base_vector = zeros(1,TIMESTEPS+1);%Rock Site RSV_base_vector = zeros(1,TIMESTEPS+1);%Rock Site RSA_base_max_g = (1.8*PGV*2*PI)/(T_1*GRAVITY) %Rock Site RSV_base_max_mps=(1.8*PGV) RSD_base_max_m = RSV_base_max_mps*T_2/(2*PI) RSA_base_max_g = 0.2882 RSV_base_max_mps = 0.1350 RSD_base_max_m = 0.0322 for i=1 : length(RSA_base_vector) % Parabolic component (Velocity Control) RSA_base_vector(i) = (1.8*2*PI*PGV)/(T(i)*GRAVITY); %Plot max RSA if(RSA_base_vector(i)>(RSA_base_max_g)) RSA_base_vector(i)=RSA_base_max_g ; end % Hyberbolic component (Displacement Control) if(T(i)>T_2) RSA_base_vector(i)= (1.8*T_2*2*PI*PGV)/((T(i)^2)*GRAVITY); end RSV_base_vector(i) = (RSA_base_vector(i)*T(i))/(2*PI); RSD_base_vector(i) = (RSV_base_max_mps^2)/(1.8*2*PI*PGV/T(i)); end % Cap the Max displacement RSD_base_vector(RSD_base_vector>=RSD_base_max_m)=RSD_base_max_m; BaseCombined = [RSA_base_vector' RSV_base_vector' RSD_base_vector']; RSA_amplified_max_g = Sa*RSA_base_max_g %soil RSV_amplified_max_mps=(1.8*PGV*Sv) RSD_amplified_max_m = RSV_amplified_max_mps*T_2/(2*PI) for i=1 : length(RSA_base_vector) % Parabolic component (Velocity Control) RSA_amplified_vector(i) = (Sv*1.8*2*PI*PGV)/(T(i)*GRAVITY); %Plot max RSA if(RSA_amplified_vector(i)>(RSA_amplified_max_g)) RSA_amplified_vector(i)=RSA_amplified_max_g ; end % Hyberbolic component (Displacement Control) if(T(i)>T_2) RSA_amplified_vector(i)= RSA_base_vector(i)*Sv; end RSV_amplified_vector(i) = (RSA_amplified_vector(i)*T(i))/(2*PI); RSD_amplified_vector(i) = (RSV_amplified_max_mps^2)/(1.8*2*PI*PGV*Sv/T(i)); end % Cap the Max displacement RSD_amplified_vector(RSD_amplified_vector>=RSD_amplified_max_m)=RSD_amplified_max_m RSA_amplified_max_g = 0.3459 RSV_amplified_max_mps = 0.2025 RSD_amplified_max_m = 0.0483 A_structure = interp1(T,RSA_amplified_vector,T_n); D_structure = interp1(T,RSD_amplified_vector,T_n); reponseSpectrum = figure(); % Acceleration Response Spectrum subplot(2,2,1); hold on; plot(T,RSA_base_vector); plot(T,RSA_amplified_vector); scatter(T_n,A_structure); plot( [0 T_n], [0 A_structure] ); ARS_string =strcat('leftarrow',' T_n = ', num2str(T_n), ' Accel = ',num2str(A_structure),'g'); text(T_n,A_structure,ARS_string); title('RSA'); xlabel('Period (s)'); ylabel('Acceleration RSA (m/s^2)'); % Velocity Response Spectrum subplot(2,2,2); hold on; plot(T,RSV_base_vector); plot(T,RSV_amplified_vector); %scatter(T_n,RSV_structure_max); title('RSV'); xlabel('Period (s)'); ylabel('velocity RSV ()'); % Displacement Response Spectrum subplot(2,2,3); hold on; plot(T,RSD_base_vector); plot(T,RSD_amplified_vector); %scatter(T_n,RSD_structure_max); title('RSD'); xlabel('Period (s)'); ylabel('displacement RSD ()'); % ARDS Response Spectrum subplot(2,2,4); hold on; plot(RSD_base_vector,RSA_base_vector); plot(RSD_amplified_vector,RSA_amplified_vector); scatter(D_structure,A_structure); plot( [0 D_structure], [0 A_structure] ); ADRS_string =strcat('leftarrow ',' Delta = ', num2str(D_structure), ' Accel = ',num2str(A_structure),'g'); text(D_structure,A_structure, ADRS_string); %scatter(RSD_structure_max,RSA_structure_max); title('ADRS'); xlabel('displacement'); ylabel('acceleration'); hold off;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote