# How to write the feedback command here.

3 views (last 30 days)
Hardik on 22 Dec 2022
Edited: Hardik on 23 Dec 2022
hello here my question is that
Use “feedback” command in Matlab to find the closed loop transfer function of the compensated
system.
i know that in feedback command i have to compare the systemA and system B but i am not sure how can i do taht. also how can i write the (s+4) and (s+5) in command because i tried many ways to write them but i am not getting the result.
Sam Chak on 22 Dec 2022
You can show your code and let's see what can be fixed. I suspect you used the 'zpk' command.
help zpk
ZPK Constructs zero-pole-gain model or converts to zero-pole-gain format. Construction: SYS = ZPK(Z,P,K) creates a continuous-time zero-pole-gain (ZPK) model SYS with zeros Z, poles P, and gains K. SYS is an object of class @zpk. SYS = ZPK(Z,P,K,Ts) creates a discrete-time ZPK model with sampling time Ts (set Ts=-1 if the sample time is undetermined). S = ZPK('s') specifies H(s) = s (Laplace variable). Z = ZPK('z',TS) specifies H(z) = z with sample time TS. You can then specify ZPK models directly as expressions in S or Z, for example, z = zpk('z',0.1); H = (z+.1)*(z+.2)/(z^2+.6*z+.09) SYS = ZPK creates an empty zero-pole-gain model. SYS = ZPK(D) specifies a static gain matrix D. You can set additional model properties by using name/value pairs. For example, sys = zpk(1,2,3,'Variable','p','DisplayFormat','freq') also sets the variable and display format. Type "properties(zpk)" for a complete list of model properties, and type help zpk.<PropertyName> for help on a particular property. For example, "help zpk.IODelay" provides information about the "IODelay" property. Data format: For SISO models, Z and P are the vectors of zeros and poles (set Z=[] when there are no zeros) and K is the scalar gain. For MIMO systems with NY outputs and NU inputs, * Z and P are NY-by-NU cell arrays where Z{i,j} and P{i,j} specify the zeros and poles of the transfer function from input j to output i * K is the 2D matrix of gains for each I/O channel. For example, H = zpk( {[];[2 3]} , {1;[0 -1]} , [-5;1] ) specifies the two-output, one-input ZPK model [ -5 /(s-1) ] [ (s-2)(s-3)/s(s+1) ] Arrays of zero-pole-gain models: You can create arrays of ZPK models by using ND cell arrays for Z,P and a ND double array for K. For example, if Z,P,K are 3D arrays of size [NY NU 5], then SYS = ZPK(Z,P,K) creates the 5-by-1 array of ZPK models SYS(:,:,m) = ZPK(Z(:,:,m),P(:,:,m),K(:,:,m)), m=1:5. Each of these models has NY outputs and NU inputs. To pre-allocate an array of zero ZPK models with NY outputs and NU inputs, use the syntax SYS = ZPK(ZEROS([NY NU k1 k2...])) . Conversion: SYS = ZPK(SYS) converts any dynamic system SYS to the ZPK representation. The resulting SYS is of class @zpk. See also ZPK/EXP, ZPKDATA, ZPK, SS, FRD, DYNAMICSYSTEM. Documentation for zpk doc zpk Other uses of zpk control/zpk idParametric/zpk rffilter.rffilter/zpk dsp.AllpassFilter/zpk mpc/zpk signal/zpk DynamicSystem/zpk

Sam Chak on 22 Dec 2022
These are the basic commands. You can find more examples in the documentations related to commands. Search MathWorks Support or Google for better results related to the Keywords.
s = tf('s');
G1 = 20/(s + 1)
G1 = 20 ----- s + 1 Continuous-time transfer function.
G2 = (s + 20)/((s + 2)*(s + 5))
G2 = s + 20 -------------- s^2 + 7 s + 10 Continuous-time transfer function.
G12 = series(G1, G2)
G12 = 20 s + 400 ----------------------- s^3 + 8 s^2 + 17 s + 10 Continuous-time transfer function.
% closed-loop transfer function
Gcl = feedback(G12, 1)
Gcl = 20 s + 400 ------------------------ s^3 + 8 s^2 + 37 s + 410 Continuous-time transfer function.
pole(Gcl) % can check eigenvalues
ans =
-8.9705 + 0.0000i 0.4852 + 6.7432i 0.4852 - 6.7432i
step(Gcl)
% check bode plot to see why the closed-loop system is unstable
margin(G12)

### Categories

Find more on Time-Domain Analysis in Help Center and File Exchange

R2022b

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by