nyqlog.m

Nyquist plot with logaritmic amplitudes for GNU Octave.
Index Commits Files Refs README
README.md (1652B)
   1 # Nyquist plot with logarithmic amplitudes
   2 
   3 This is a port of [Trond Andresen's MATLAB
   4 version](https://www.mathworks.com/matlabcentral/fileexchange/7444-nyquist-plot-with-logarithmic-amplitudes)
   5 for GNU Octave. To use it the
   6 [control](https://gnu-octave.github.io/packages/control/) package needs to be
   7 installed.
   8 
   9 <div style="text-align: center;">
  10     <img src="nyqlog_octave_light.png" width="100%">
  11     <p align="center"><em>Nyquist plot with logarithmic amplitudes</em></p>
  12 </div>
  13 
  14 ## Quick start
  15 
  16 Place the file `nyqlog.m` in Octave's path (see [Manipulating the Load
  17 Path](https://docs.octave.org/v11.1.0/Manipulating-the-Load-Path.html)). Then
  18 load the control package and define a transfer function. Finally call the
  19 `nyqlog` function passing as argument the transfer function.
  20 
  21 ```text
  22 octave:1> pkg load control
  23 octave:2> sys = zpk([-1/3 -1/2], [0 -0.02 -0.1 -2 -10], 48)
  24 
  25 Transfer function 'sys' from input 'u1' to output ...
  26 
  27                      48 s^2 + 40 s + 8
  28  y1:  ------------------------------------------------
  29       s^5 + 12.12 s^4 + 21.44 s^3 + 2.424 s^2 + 0.04 s
  30 
  31 Continuous-time model.
  32 octave:3> nyqlog(sys)
  33 ```
  34 
  35 ## Bonus: dark theme
  36 
  37 This ported version of the function takes the colors from the variables defined
  38 and used by Octave to render the figures: `defaultFigureColor` and
  39 `defaultAxesXColor`. If you have customized these variables in Octave's
  40 configuration file, the function will automatically use those colors as well.
  41 
  42 <div style="text-align: center;">
  43     <img src="nyqlog_octave_dark.png" width="100%">
  44     <p align="center"><em>Nyquist plot with logarithmic amplitudes. Custom figure colors.</em></p>
  45 </div>
  46