2

If I have a Plant let's say

Gp(s) = 1/(s+1)

I can find the Phase Margin

Using MATLAB commands

Gp = tf([1],[1 1]);
[G P] = margin(Gp);

My question is what if I want to know the phase over frequency in a specific Gain Over Frequency. How do I find it without looking to bode plot?

Usually I find it by the command bode(Gp) and move the mouse over the specific gain that I want to know the phase margin on it.

For my previous example The Gain Over Frequency is 0.363 at -20 Phase Over Frequency.

How do I write it as a command not looking in the bode diagram?

Thanks in advance

7
  • this is basically a math question. You can find a similar question and answer here Commented Mar 23, 2014 at 10:32
  • physics.stackexchange.com Commented Mar 23, 2014 at 10:42
  • @user2485710: no. Rather Electrical Engineering SE - but actually the OP should do some research about control systems and what is to do mathematically, which is quite easy. Then it's a programming problem again, solvable with fzero as described in the answer linked above. For a complete answer the question is way too broad. Commented Mar 23, 2014 at 11:01
  • @thewaywewalk I think that the main focus is on the physics, an engineer will use his own know-how in physics to explain this, it's basically the same thing. Commented Mar 23, 2014 at 11:03
  • @thewaywewalk Thanks for the editing and answering. Commented Mar 23, 2014 at 11:52

1 Answer 1

7

It seems you misunderstood what Gain Over Frequency and phase margin actually means, and it is not the place to explain it. What I assume you actually want, is a way to evaluate a bode-plot without clicking at it. E.g. you want to know magnitude and frequency at the point of -20 phase.

Let's have a look at these three cases:


Case 1: you know the frequency and you're searching for magnitude and phase

The easiest case:

w = 0.363;                 % specify given frequency
[mag,phase] = bode(Gp,w)   % output of according magnitude and phase

returns:

mag =

    0.9400


phase =

  -19.9509

Case 2: you want to know magnitude and frequency for a certain phase

p = -20;
[mag,phase,wout] = bode(Gp);

mag_p = interp1( squeeze(phase), squeeze(mag), p)
w_p   = interp1( squeeze(phase), wout, p)

returns:

mag_p =

    0.9394

w_p =

    0.3642

Case 3: you want to know phase and frequency for a certain magnitude

m = 0.9394;
[mag,phase,wout] = bode(Gp);

phase_m = interp1( squeeze(mag), squeeze(phase), m)
w_m     = interp1( squeeze(mag), wout, m)

returns:

phase_m =

  -19.9998


w_m =

    0.3642

The squeeze command is necessary, because bode output a 1x1x... matrix for phase and magnitude, however. You also may use different interpolation methods of interp1.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.