Converting Zero-Pole Model to Transfer Function Model Using MATLAB

First, write out the system’s zero vector, pole vector, and system gain, then call zp2tf() to obtain the system’s transfer function model, and call zp2ss() to obtain the system’s state-space model. % Convert zero-pole model to transfer function model %zp2ss();zp2tf()%X’ = A*X + B*U;%Y = C*X + D*U%%%%%%%%%%%clear all;clc;close all;%%%%%%%%%%%%%%example 1%%gainK = 2.7;%%zeroZ = [-3.6 … Read more

Converting Transfer Function Models to State-Space Models Using MATLAB

First, write out the numerator and denominator expressions of the system’s transfer function model, then call tf2ss() to obtain the four matrices of the state-space model, and finally plot the system’s response curve to the input signal. % Transfer function conversion to state-space %G(s)=num(s)/den(s); %X’=A*X+B*U; %Y=C*X+D*U; %[A,B,C,D]=tf2ss(num,den); %%%%%%%%%%%%%%%%%%%% clear all; clc; close all; %%%%%%%%%%%%%%%%%% num1=[1 … Read more

Obtaining System Transfer Function from MDL Block Diagram Using MATLAB

Obtaining System Transfer Function from MDL Block Diagram Using MATLAB

First, use MATLAB to draw the system signal transfer block diagram, then extract the transfer function from the block diagram, and finally plot the system’s step response curve. clear ;[a1, b1, c1, d1]=linmod(‘ex202501’);ss1=ss(a1, b1, c1, d1);tf1=tf(ss1);figure(1);step(tf1);grid on;hold on;num1=tf1.num{1};den1=tf1.den{1};t1=0:0.01:25;x2=20.0*sin(2.0*pi*3*t1);y2=lsim(num1,den1,x2,t1);plot(t1,y2);