%Zeros' Addition Effect on Linear System Output with Step as Input syms s t b %modifying symbolic variables T = -20:0.1:1.3; Y=2/s/(s^2+2*s+2); pretty(Y); %pretying Y so that function type correctness checking become easier y=ilaplace(Y); %inverse Laplace yT = double(subs(y,t,T)); % substitustion of t: a common variable and T: a symbolice variabl, enabling us to use "plot" function Y=.1*2/10/s/(s+.1)/(s^2+2*s+2); y1=ilaplace(Y); y1T = double(subs(y1,t,T)); Y=.5*2/10/s/(s+.5)/(s^2+2*s+2); y2=ilaplace(Y); y2T = double(subs(y2,t,T)); Y=2/10/s/(s+1)/(s^2+2*s+2); y3=ilaplace(Y); y3T = double(subs(y3,t,T)); Y=1.5*2/s/10/(s+1.5)/(s^2+2*s+2); y4=ilaplace(Y); y4T = double(subs(y4,t,T)); Y=2*2/s/10/(s+2)/(s^2+2*s+2); y5=ilaplace(Y); y5T = double(subs(y5,t,T)); Y=5*2/s/10/(s+10)/(s^2+2*s+2); y6=ilaplace(Y); y6T = double(subs(y6,t,T)); Y=10*2/s/10/(s+10)/(s^2+2*s+2); y7=ilaplace(Y); y7T = double(subs(y7,t,T)); plot(T,yT,T,y1T,T,y2T,T,y3T,T,y4T,T,y5T,T,y6T,T,y7T,'LineWidth',1); % plotting and turing hold off for other programs title('Poles` Addition Effect on Linear System Output with Step as Input'); %title of figure legend('y','b=.1','b=.5','b=1','b=1.5','b=2','b=5','b=10',... %legend 'Location','Best') xlabel('t'); xlim([-20 1.2]) % axes' labels and limitations ylabel('y(t)'); ylim([-1000000 100000]); set(gca,'YGrid','on') %only YGrid on text(-13.5,-850000,'System Output to Unit Step Input',... %description 'HorizontalAlignment','left') text(-14,-750000,'T(s)= 2*b/(s+b)/(s^2+2*s+2) and U(s)=1/s',... %description 'HorizontalAlignment','left') T=2*b/(s+b)/(s^2+2*s+2); pretty(T)