Rlocusplot provide gain K


i have a problem that i want to provide K for rlocusplot, but it does no work.
thanks in advance

using ControlSystems

sys = Kiw0^2/(s^3+2Dw0s^2+w0^2s+Kiw0^2)

rlocusplot(sys, k, xlims=(-4,4), ylims=(-10, 10))

Could you provide some details of what is not working, e.g. which error message you get?

Guessing from the code you gave, it seems there are many multiplication signs missing and also the definition of s, i.e. it should look more like

s = LinRange(-4,4, 20000) # or whatever range s has...
sys = @. Ki * w0^2 / (s^3 + 2D*w0*s^2 + s*w0^2 + Ki * w0^2)

At this point we can only guess what s is, but if it is a vector, then you need to add @. in front to make sure all operations are applied component-wise. (See also Mathematical Operations and Elementary Functions · The Julia Language)

rlocusplot has the following docstring

Computes and plots the root locus of the SISO LTISystem P with a negative feedback loop and feedback gains between 0 and K. rlocusplot will use an adaptive step-size algorithm to determine the values of the feedback gains used to generate the plot.

The OP does not contain this information, but s is the Laplace-transform s, created using

s = tf('s')

There are still some multiplications missing in the expression in the OP.

1 Like

yes. There are some Probleme, when i copy the code.

My confusion lies in the use of K in the function. I tried providing a value for K to increase the range of the root, but none of it changed the original Plot.

You might have to change the xlims, ylims of the plot manually