MAT 275 CCSD Differential Equations Forced Equations and Resonance Lab Worksheet
Question Description
mat lab due on friday the 19th at 10pm san diego time
clear all; %this deletes all variables omega0 = 4; c = 2; omega = 3.4; param = [omega0,c,omega]; t0 = 0; y0 = 0; v0 = 0; Y0 = [y0;v0]; tf = 40;options = odeset(‘AbsTol’,1e-10,’relTol’,1e-10); [t,Y] = ode45(@f,[t0,tf],Y0,options,param); y = Y(:,1); v = Y(:,2); figure(1) plot(t,y,’b-‘); ylabel(‘y’); grid on; t1 = 13; i = find(t>t1);C = (max(Y(i,1))-min(Y(i,1)))/2; disp([‘computed amplitude of forced oscillation = ‘, num2str(C)]);Ctheory = 1/sqrt((omega0^2-omega^2)^2+(c*omega)^2); disp([‘theoretical amplitude = ‘, num2str(Ctheory)]);%—————————————————————-function dYdt = f(t,Y,param) y = Y(1); v = Y(2); omega0 = param(1); c = param(2); omega = param(3);dYdt = [ v ; cos(omega*t)-omega0^2*y-c*v ];end
"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you "A" results."