Professional Documents
Culture Documents
Nitya Nand Jha 20BCY10163 Codes With Changed Values
Nitya Nand Jha 20BCY10163 Codes With Changed Values
20BCY10163
CODES WITH
CHANGED VALUES
%under_damp.m
clear;
m=0.05; %mass
return;
end
plot(t,x,'b:',t,xe,'r-.');
xlabel('t','FontSize',14);
1
h=legend('Underdamped','Decay Envelope'); set(h,'FontSize',14);
2
%over_crit_damp.m
clear;
m=0.05; %mass
return;
end
xo=Ao*exp(-gam1*t)+Bo*exp(-gam2*t); %overdamped
xc=Ac*exp(-gam*t)+Bc*t.*exp(-gam*t);%critically damped
plot(t,xo,'b:',t,xc,'r-.');
1
ylabel('Xoverdamped, Xcritically-damped','FontSize',14);
xlabel('t','FontSize',14);
2
%drive_amp.m
clear;
m=0.5; %mass
w=[wmin:wmax/NPTS:wmax]; %w array
desc=(2*gam*w).^2+(wo^2-w.^2).^2;
line([om_res;om_res],[Amax;Amax],'Color','red','Marker','.');
str=cat(2,'\gamma=',num2str(gam,2));
1
text(om_res+0.1,Amax-0.06,str,'FontSize',10,'Color','red');
end
ylabel('A(\omega_D)','FontSize',14);
xlabel('\omega_D','FontSize',14);