>> m = 1; >> k = 3600; >> k = 400; >> c = .05*sqrt(m*k) c = 1 >> w0 = sqrt(m/k) w0 = 0.0500 >> zeta = c/(2*sqrt(m*k)) zeta = 0.0250 >> wprime = w0*sqrt(1-zeta^2) wprime = 0.0500 >> format long >> wprime = w0*sqrt(1-zeta^2) wprime = 0.049984372557831 >> format >> t = 0:.01:10; >> mux = (1-exp(-zeta*w0*t)*(zeta/sqrt(1-zeta^2) * sin(wprime*t) + cos(wprime*t)))/(m*w0^2)l ??? mux = (1-exp(-zeta*w0*t)*(zeta/sqrt(1-zeta^2) * sin(wprime*t) + cos(wprime*t)))/(m*w0^2)l | Error: Unexpected MATLAB expression. >> mux = (1-exp(-zeta*w0*t)*(zeta/sqrt(1-zeta^2) * sin(wprime*t) + cos(wprime*t)))/(m*w0^2); ??? Error using ==> mtimes Inner matrix dimensions must agree. >> mux = (1-exp(-zeta*w0*t).*(zeta/sqrt(1-zeta^2) * sin(wprime*t) + cos(wprime*t)))/(m*w0^2); >> plot(t,mux) >> mux = (1-exp(-zeta*w0*t))/(m*w0^2); >> plot(t,mux) >> mux = (1-exp(-zeta*w0*t)); >> plot(t,mux) >> t = 0:.01:100; >> plot(t,mux) ??? Error using ==> plot Vectors must be the same lengths. >> mux = (1-exp(-zeta*w0*t)); >> plot(t,mux) >> plot(t,mux) >> t = 0:.1:1000; >> mux = (1-exp(-zeta*w0*t)); >> plot(t,mux) >> t = 0:.1:5000; >> mux = (1-exp(-zeta*w0*t).*(zeta/sqrt(1-zeta^2) * sin(wprime*t) + cos(wprime*t)))/(m*w0^2); >> pl ??? Undefined function or variable 'pl'. >> plot(t,mux) >> m = 2; >> mux = (1-exp(-zeta*w0*t).*(zeta/sqrt(1-zeta^2) * sin(wprime*t) + cos(wprime*t)))/(m*w0^2); >> hold Current plot held >> w0 = sqrt(m/k) w0 = 0.0707 >> zeta = c/(2*sqrt(m*k)) zeta = 0.0177 >> wprime wprime = 0.0500 >> wprime = w0*sqrt(1-zeta^2) wprime = 0.0707 >> mux = (1-exp(-zeta*w0*t).*(zeta/sqrt(1-zeta^2) * sin(wprime*t) + cos(wprime*t)))/(m*w0^2); >> hold on >> plot(t,mux,'r') >> c = .25*sqrt(m*k) c = 7.0711 >> zeta = c/(2*sqrt(m*k)) zeta = 0.1250 >> wprime = w0*sqrt(1-zeta^2) wprime = 0.0702 >> mux = (1-exp(-zeta*w0*t).*(zeta/sqrt(1-zeta^2) * sin(wprime*t) + cos(wprime*t)))/(m*w0^2); >> plot(t,mux,'g') >> m = 2; >> m =1; >> c = .05*sqrt(m*k) c = 1 >> zeta = c/(2*sqrt(m*k)) zeta = 0.0250 >> w0 = sqrt(m/k) w0 = 0.0500 >> wprime = w0*sqrt(1-zeta^2) wprime = 0.0500 >> edit sd >> omega = 0:.1:10; >> sff = sd(omega); >> plot(omega,sff) >> plot(omega,sff) >> sxx1 = sff*(k^2 + (c^2-2*k*m)*omega.^2 + m^2*omega.^4)^(-1); ??? Error using ==> mpower Matrix must be square. >> sxx1 = sff*(k^2 + (c^2-2*k*m)*omega.^2 + m^2*omega.^4).^(-1); ??? Error using ==> mtimes Inner matrix dimensions must agree. >> sxx1 = sff.*(k^2 + (c^2-2*k*m)*omega.^2 + m^2*omega.^4).^(-1); >> hold Current plot held >> plot(omega,sxx,'r') ??? Undefined function or variable 'sxx'. >> plot(omega,sxx1,'r') >> figure >> plot(omega,sxx1,'r') >> c = .25*sqrt(m*k) c = 5 >> sxx2 = sff.*(k^2 + (c^2-2*k*m)*omega.^2 + m^2*omega.^4).^(-1); >> hold Current plot held >> plot(omega,sxx2,'b') >> c = 1*sqrt(m*k) c = 20 >> zeta = c/(2*sqrt(m*k)) zeta = 0.5000 >> sxx2 = sff.*(k^2 + (c^2-2*k*m)*omega.^2 + m^2*omega.^4).^(-1); >> plot(omega,sxx2,'b') >> m =2; >> sxx3 = sff.*(k^2 + (c^2-2*k*m)*omega.^2 + m^2*omega.^4).^(-1); >> plot(omega,sxx2,'g') >> w0 = sqrt(m/k) w0 = 0.0707 >> m =20; >> c = .025*sqrt(m*k) c = 2.2361 >> zeta = c/(2*sqrt(m*k)) zeta = 0.0125 >> w0 = sqrt(m/k) w0 = 0.2236 >> m =200; >> w0 = sqrt(m/k) w0 = 0.7071 >> k = 100; >> w0 = sqrt(m/k) w0 = 1.4142 >> k = 10; >> w0 = sqrt(m/k) w0 = 4.4721 >> zeta = c/(2*sqrt(m*k)) zeta = 0.0250 >> c = .025*sqrt(m*k) c = 1.1180 >> zeta = c/(2*sqrt(m*k)) zeta = 0.0125 >> w0 = sqrt(k/m) w0 = 0.2236 >> m=1; >> k=400; >> c = .025*sqrt(m*k) c = 0.5000 >> zeta = c/(2*sqrt(m*k)) zeta = 0.0125 >> w0 = sqrt(k/m) w0 = 20 >> wprime = w0*sqrt(1-zeta^2) wprime = 19.9984 >> sxx1 = sff.*(k^2 + (c^2-2*k*m)*omega.^2 + m^2*omega.^4).^(-1); >> figure >> plot(omega,sxx1,'b') >> c = .5*sqrt(m*k) c = 10 >> zeta = c/(2*sqrt(m*k)) zeta = 0.2500 >> sxx2 = sff.*(k^2 + (c^2-2*k*m)*omega.^2 + m^2*omega.^4).^(-1); >> hold on >> plot(omega,sxx2,'g') >> m=6; >> w0 = sqrt(k/m) w0 = 8.1650 >> m=10; >> w0 = sqrt(k/m) w0 = 6.3246 >> sxx2 = sff.*(k^2 + (c^2-2*k*m)*omega.^2 + m^2*omega.^4).^(-1); >> plot(omega,sxx2,'g') >> figure >> plot(omega,sxx2,'g') >> c = .05*sqrt(m*k) c = 3.1623 >> sxx1 = sff.*(k^2 + (c^2-2*k*m)*omega.^2 + m^2*omega.^4).^(-1); >> hold Current plot held >> plot(omega,sxx1,'r') >> m=15; >> sxx3 = sff.*(k^2 + (c^2-2*k*m)*omega.^2 + m^2*omega.^4).^(-1); >> plot(omega,sxx3,'b') >> c = .05*sqrt(m*k) c = 3.8730 >> sxx3 = sff.*(k^2 + (c^2-2*k*m)*omega.^2 + m^2*omega.^4).^(-1); >> plot(omega,sxx3,'b') >> plot(omega,sxx3,'k') >> clear all >> pwd ans = /Users/arwade >> cd courses/_prob_methods_sem_12/matlab/ >> ls Archive inclass_12_02_09.m dynamics inclass_12_02_14.m functions inclass_12_02_16.m functions01.zip inclass_12_02_21.m inclass_12_01_24.m inclass_12_02_23.m inclass_12_01_26.m inclass_12_03_01.m inclass_12_01_31.m inclass_12_03_06.m inclass_12_02_02.m inclass_12_04_03.m inclass_12_02_07.m wind_data.mat >> cd dynamics >> ls sd_sdof.m sd_sdof.m~ sdof.m sdof.m~ >> edit sd_sdof >> omega = 0:.1:10; >> sff = sd_sdof(omega) >> plot(omega,sff) >> omega = 0:.1:100; >> sff = sd_sdof(omega); >> plot(omega,sff) >> edit specth >> [t,x]=specth('sd_sdof',0,100,1000,1000,10000,1,10,123); >> plot(t,x(1,:)) >> plot(t,x(1,:)) >> [t,x]=specth('sd_sdof',0,100,1000,100,1000,1,10,123); >> plot(t,x(1,:)) >> lsd ??? Undefined function or variable 'lsd'. >> ls sd_sdof.m sd_sdof.m~ sdof.m sdof.m~ >> edit sdof >> m = 1; >> k=400; >> c = .05*sqrt(m*k) c = 1 >> f = x; >> [tx,x] = sdof(f(1,:),t,k,m,c); >> figure >> plot(tx,x) >> plot(tx,x(1,:)); ??? Error using ==> plot Vectors must be the same lengths. >> whos Name Size Bytes Class Attributes ans 1x13 26 char c 1x1 8 double f 10x1001 80080 double k 1x1 8 double m 1x1 8 double omega 1x1001 8008 double sff 1x1001 8008 double t 1x1001 8008 double tx 1001x1 8008 double x 1001x2 16016 double >> x = x'; >> plot(tx,x(1,:)); >> plot(t,f(1,:)) >> figure >> plot(t,x(1,:)) >> plotyy(t,f(1,:),t,x(1,:)); >> c = .5*sqrt(m*k) c = 10 >> [tx,x2] = sdof(f(1,:),t,k,m,c); >> figure >> plot(t,x(1,:)) >> hold Current plot held >> plot(t,x2(1,:),'r') ??? Error using ==> plot Vectors must be the same lengths. >> plot(t,x2(:,1),'r') >>