Skip to Main Content Skip to Search
Product Documentation

plot::Rootlocuscurves of roots of rational expressions

plot::Rootlocus(p(z, u), u = `u_{min}` .. `u_{max}`) creates a 2D plot of the curves in the complex plane given by the roots of p(z, u) = 0 (solved for z) as the parameter u varies between `u_{min}` and `u_{max}`.

→ Examples

Call:

plot::Rootlocus(p(z, u), u = `u_{min}` .. `u_{max}`, <a = amin .. amax>, Options)

Parameters:

p(z, u)

an arithmetical expression in two unknowns z and u and, possibly, the animation parameter a. It must be a rational expression in z
p(z, u) is equivalent to the attribute RationalExpression.

z

name of the unknown: an identifier or an indexed identifier

u

name of the curve parameter: an identifier or an indexed identifier
u is equivalent to the attribute UName.

`u_{min}` .. `u_{max}`

the range of the curve parameter: `u_{min}`, `u_{max}` must be numerical real values or expressions of the animation parameter a
`u_{min}` .. `u_{max}` is equivalent to the attributes URange, UMin, UMax.

See Also:

numeric::polyroots, plot, plot::copy, plot::Curve2d

Details:

Example 1

The roots of the polynomial z^2 - 2*u*z + 1 are given by z = u + sqrt(u^2 - 1) and z = u - sqrt(u^2 - 1). We visualise these two curves via a rootlocus plot:

plot(plot::Rootlocus(z^2 - 2*u*z + 1, u = -1.5..1.5))

MuPAD graphics

For rational expressions, the roots of the numerator are considered. The following plot displays the roots of the numerator polynomial (z^2 - u)^2 + u*(z - u)^3:

plot(plot::Rootlocus(1 + u * (z - u)^3/(z^2 - u)^2, u = -1..1)):

MuPAD graphics

Here are various other examples:

plot(plot::Rootlocus((z^2 - 2*u*z + 1)^2 + u, u = -1..1))

MuPAD graphics

plot(plot::Rootlocus((z^2 - u)^6 + u^2, u = -2..2, Color = RGB::Red))

MuPAD graphics

plot(plot::Rootlocus((z^5  - 1)^3 + u, u = -1..1, PointsVisible, PointSize = 1.5))

MuPAD graphics

Example 2

The following plot is rather messy, since the default mesh size of 51 initial points on each curve is not sufficient to obtain a good resolution:

plot(plot::Rootlocus((z-u)^3 - u/z^3, u = -10^3 .. 10^3)):

MuPAD graphics

We obtain a better resolution by decreasing the range of the parameter u to a reasonable size. There are still a few points that are not properly matched up with the curves:

plot(plot::Rootlocus((z-u)^3 - u/z^3, u = -10 .. 10)):

MuPAD graphics

We increase the mesh size to cure this problem:

plot(plot::Rootlocus((z-u)^3 - u/z^3, u = -10 .. 10, Mesh = 251)):

MuPAD graphics

We plot the roots as separate points without displaying connecting line segments:

plot(plot::Rootlocus((z-u)^3 - u/z^3, u = -10 .. 10, Mesh = 501,
                     LinesVisible = FALSE, PointsVisible)):

MuPAD graphics

Example 3

We animate the expression whose roots are to plotted:

plot(plot::Rootlocus(z^2 - 2*u*z + a, u = -1..1, a = -0.2 .. 2, Mesh = 10),
     plot::Text2d(a -> "a = ".stringlib::formatf(a, 2, 5), [1.2, 1.0], a = -0.2 .. 1));

MuPAD graphicsimage

We animate the parameter range:

plot(plot::Rootlocus(z^2 - 2*u*z + 0.81, u = -1 .. a, a = -1 .. 1, Mesh = 10))

MuPAD graphicsimage

Example 4

We provide a color function: roots for small values of the parameter u are displayed in red, whereas roots for large parameter values are displayed in blue:

plot(plot::Rootlocus(z^2 - 2*u*z + 0.81, u = -1..1,
                     LineColorFunction = ((u, x, y) -> [(1 - u)/2, 0, (1 + u)/2])))

MuPAD graphics

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS