Converting Zero-Pole-Gain Model to State-Space Model Using MATLAB

First, write out the system’s gain, zero vector, and pole vector, then call zp2ss() to obtain the four matrices of the state-space model. Next, use lsim() to generate the system’s response curve and observe the system’s performance. % Convert zero-pole-gain model to state-space model %[A,B,C,D]=tf2ss(Z,P,K)% state-space model matrices: A,B,C,D % zeros: Z % poles: P … Read more

Plotting System Responses to Specified Inputs Using MATLAB

Plotting System Responses to Specified Inputs Using MATLAB

Typically, the test signals for input systems include step functions, ramp functions, acceleration functions, and sine functions, but a custom function can also be specified. num1=[1 2];den1=[2 3 4];t1=0:0.01:10;% step response y1=step(num1,den1,t1);figure(1),plot(t1,y1);% ramp response x2=t1;y2=lsim(num1,den1,x2,t1);figure(2),plot(t1,y2);% acceleration response x3=0.5*t1.*t1;y3=lsim(num1,den1,x3,t1);figure(3),plot(t1,y3);% sine response x4=sin(2*pi*5.*t1);y4=lsim(num1,den1,x4,t1);figure(4),plot(t1,y4);% exponential response x5=exp(0.5*t1);y5=lsim(num1,den1,x5,t1);figure(5),plot(t1,y5);