0

I want to plot a rootlocus plot. I have added addpath(pwd) and pkg load control commands but no help. I keep getting the error: error: 'rlocfind' undefined near line 1 column 7.

Please tell me what my mistake is.

addpath(pwd)
pkg load control
%script to demostrate RL
%Model of plat
ng=[1];% no of zeros
dg= [1 0.5]; %s+0.5

%controller structure
ngc= [1];
dgc= [1 0 ];%I only

%H tf
nh=[1];
dh=[1];

%loop tf. Gc*Gp*H
nl= conv(conv(ng,ngc),nh);
dl= conv(conv(dg,dgc),dh);

[k,p]=rlocfind(nl,dl)
ChristianYami
  • 586
  • 1
  • 9
  • 17
Apurb
  • 1
  • 1
  • 1
    Are you trying to run MATLAB code in Octave? The [function reference](https://octave.sourceforge.io/control/overview.html) of Octave's `control` package doesn't list any `rlocfind` function. Have you verified, that the function is available in any Octave package? – HansHirse Sep 29 '20 at 06:57
  • @HansHirse, yes rlocfind is available in octave, as per my information. is there any other way to interact and find the gain for selected roots? – Apurb Sep 29 '20 at 08:03
  • @HansHirse you can try running the above in your octave system? – Apurb Sep 29 '20 at 08:04
  • 1
    "As per my information" isn't very convincing. Can you provide any source (documentation, ...) to support your statement? And, no, the code doesn't work on my Octave system either, most likely, because there seems to be no `rlocfind` function in Octave at all. Regarding the problem to find a potential substitute for the `rlocfind` function in Octave, I can't help you. – HansHirse Sep 29 '20 at 08:15
  • I have loaded the control package and there's no such function. There is an [rlocus](https://octave.sourceforge.io/control/function/rlocus.html) function though: "Display root locus plot of the specified SISO system.". Also the [wiki page](https://wiki.octave.org/Control_package) and [this forum post](https://octave.1599824.n4.nabble.com/Root-Locus-plots-td1638094.html) might help. – Tasos Papastylianou Sep 30 '20 at 08:39

1 Answers1

0

Try rlocusx instead.

https://octave.sourceforge.io/control/function/rlocusx.html

rlocusx is an interactive root locus plot of the specified SISO system SYS.

This functions directly calls rlocus() from the control package which must be installed and loaded. In contrast to rlocus(), mouse clicks on the root locus display the related gain and all other poles resulting from this gain together with damping and frequency of conjugate complex pole pairs.

M.I.
  • 1
  • 1
    It would be useful to update your answer and state why `rlocfind` is not a good choice (e.g. it doesn't exist!), and why `rlocusx` is a better alternative (perhaps wrt `rlocus`?). – Justin Dec 01 '22 at 13:16