1

I hope I can explain my problem well enough,

Let's say I have a closed loop control system, and I know the given physical plant Gp (the compensator and the feedback transfer func is 1). The question is to check whether the system can track a frequency of 2 rad/sec perfectly. Looking at 'Gp'(s=jw)|w=2 and substituting in T(s)=1/(s^2+5) we see that it's 1 and tracks it perfectly, but T(s) itself is not stable. Supposedly I can check it in Matlab and see that the output graph(of T(s)) does not track the input of w=2(output and input graphs are on the same figure).

How can I write a code to recreate that situation?(someone advised to use lsim, but I couldn't really understand it fully) Thanks!

dron22
  • 1,235
  • 10
  • 20

1 Answers1

0

It's not too clear from your question what T(s) is, but I'll assume from context that it is the closed-loop transfer function, i.e.T = Gp / (1 + Gp).

The poles of T are purely imaginary (+-j*sqrt(5)) and so T is "marginally stable" or more intuitively you can think of it as a mass on a spring- an oscillator.

To answer the question of if this closed-loop system can perfectly track a given input sinusoid, well, it depends on what your criteria is for "perfect".

You mentioned that the steady-state gain (magnitude of T(jw)) is 1 at w = 2, but what is its phase? In MatLab, try:

T = tf([1], [1, 0, 5]); % numerator = 1, denominator = 1s^2+0s+5 bode(T);

to view a plot of magnitude and phase over a range of w. https://www.wolframalpha.com/input/?i=bode+1%2F(s%5E2%2B5)

The phase delay is nonzero for every frequency except zero (i.e. a constant input). This is always the case with a "mass on a spring"; inertia causes it to always lag behind the forcing function.

Having a nonzero phase delay means your output will not "perfectly" track your input. To see what this looks like, try:

t = [0:0.001:10]; % array of times to compute simulation r = sin(2*t); % input to the closed loop system lsim(T, r, t); % simulate system T with input r for t seconds

jnez71
  • 138
  • 6