I’m trying to plot the phase of a complex transfer function (as in control engineering) using the angle function.
So essentially, if I have a transfer function g(s), I compute the angle (with rad2deg conversion) of g(j\omega) for a number of different frequencies \omega (j=\sqrt{-1}). Here is what I get:
This looks ugly, and I want to avoid the jumps in the phase (angle) when the phase passes through -180^\circ. I.e., instead of jumping to +180^\circ, I want it to continue to a negative value past -180^\circ.
Question: Is there a simple/efficient/smart way to do this?
Note: This is a somewhat complex transfer function from a system of PDEs, and does not fit into the ControlSystems framework. [Unless ControlSystems allows me to pass on frequency and magnitude and phase instead of the system, and then does it form me.]
I am afraid you need to write the code that does this yourself… I did that in the past, should only be 5 or 10 lines of code, but I don’t have the code available right now…
Nice plots for transfer functions from tube-side, shell-side inlets to tube-side, shell-side outlets in a co-current heat exchanger (with fictitious numbers).
In reality, there may not be these “comb filter” effects if I include heat diffusion and heat capacity of heat exchanger walls…
Not quite clear to me what you mean. I compute some complex numbers as a function of omega. Then I compute the magnitude and phase angle of the complex numbers, and plot these as a function of omega (Bode plot).
Another common plot is the Nichols plot, where one plots magnitude as a function of phase angle with omega as parameter.
A third common plot is a Nyquist plot, where the imaginary value is plotted as a function of the real part, again with omega as parameter.
Do you prefer to a Nichols plot, a Nyquist plot, or something else?
No magnitude involved (which is probably what most are interested in, but appears in the other plot).
Don’t think this plot has a name yet (probably for good reason)