**Written by: Sas Harrison – Systems Engineer**

## Introduction

This article will explain the nature of a root-locus diagram and explain how to create one using the DYMOLA software. For students & researchers, we hope the article will open up possibilities to use DYMOLA as the ** modular, acausal **&

**, explicit-analysis software of choice, for control(ler) design & stability analysis.**

*smart*## Why use Dymola for Stability Analysis?

Dymola can:

- Plot root loci quickly, without restricting itself in terms of the form the model equations take, or what parameter it’s possible to vary as “K”.

- Flex between causal & acausal modelling, or combine the two, to:
- Create the best possible environment for controller design
- Within DYMOLA alone, or via interface with other software
- Possibly using items of controller-in-the-loop hardware

- Avoid using controller-development “block diagram” tools for modelling physical systems.
- DYMOLA using controller-development “block diagram” tools for modelling physical systems.
- Modelling a physical system using causal controller blocks is far from ideal!

- Create the best possible environment for controller design

## Features & Role of Root Locus Analysis

Root locus just means “the location of the roots”. Historically, a particular approach to thinking about, and constructing knowledge about these loci of the (characteristic equations’) roots was developed.

Primarily, this was a way to predict the behaviour of systems with feedback, using only the knowledge of the plant transfer function, often labelled G(s) and the feedback transfer function, often labelled H(s).

In part I, the article concluded by illustrating how to reduce a block diagram with a feedback loop to a single block. It became clear that a plant with transfer function G(s), with a feedback loop containing a transfer function H(s)^{i} results in an overall transfer function:

*Equation 1: The closed loop transfer function*

The expression is ** a form of the system’s governing equations**. That expression can in many cases be factorised (part of the benefit of using the Laplace domain in the first place).

##### Plotting Root Loci in DYMOLA

You can use DYMOLA to plot the position of the roots of the characteristic equation, to form a series of lines called the “root locus”.

That is the core point of the concept of a root locus diagram. It is simply the locus of the roots, as they travel through the complex plane, as a result of a single parameter being varied.

##### Instructions for Obtaining A Root Locus Plot:

For the first example we will use the RC circuit. In this simple circuit, ** with no feedback** and only a trivial plant model, we vary the RESISTANCE.

*Figure 1: The simple RC circuit used *

Common sense should tell us about what kinds of things we might see, but it will prove that we’re doing things right in DYMOLA.

1. Load your model

In this example, the resistance is initially set to 2.2Ω. However, we’ve already stated that we will try a whole series of values of resistance to create the plot, so consider the following notes:

- Entering a(ny) value for a variable is no problem for DYMOLA in this context. The
in model building environment.*root-locus function will supersede any value you enter* - Though this model is linear, and very simple, in the general case, a system will be nonlinear. DYMOLA will require a “set point” around which to linearise the model. The mechanics of this are beyond the current scope. For the time-being,
. So, the*note that the set-point will be specifically entered in the root-locus dialogue*.*parameter value for resistance we enter while building the model won’t be used*

The capacitance is 0.01F.

2. Go to the taskbar, click linear analysis, then root-locus analysis in the menu

*Figure 2: Selecting Root Locus from the Linear Analysis menu*

3. In the dialogue, select the “tree data” tab

*Figure 3: Find the right place to enter your parameter to vary*

4. In the dialogue, click on the edit button to the right of the top dialog box–

*Figure 4: Reaching the parameter variation screen. The figure shows from top to bottom, the field in question **(use the button to access it), a close-up of the field, and the view once the button is clicked.*

5. Click the ** “select”** button bottom right

6. Choose the parameter that you want to vary from the list displayed

7. Click OK

8. Now enter a reference value, a minimum value, a maximum value & number of values to plot. The ** reference value represents the expected “usual” operating point around which a system will be linearised** (an already linear system will remain unchanged regardless of this value).

9. Only THEN, enter a choice for the kind of grid to be used!

*Figure 5: The values must be filled in using the right procedure & in order!*

10. Click OK

11. Click execute

The resulting plot will look something like this, for the given example. It might not look like much, but you have made your first root locus plot.

*Figure 6: The simplest possible root-locus plot*

The labelling of the axes by the software is deliberately left beyond the scope for the time-being but serves as a clue to the significance of the “poles” or “roots” being mapped.

##### Varying Inductance:

We now adopt a system (see appendices) where the resistance is set to 0.22Ω and the capacitance to 0.01*F*. The input voltage is a unit step.

Besides that, we also add in an inductance, which creates a voltage drop that is dependent on the rate of change of current, and therefore makes the governing equation become a second order equation.

We’ll see the root locus of a second order system is one step more complicated, because there will be two roots to track through the complex plane.

1. Run and model.

2. Select Linear Analysis in the menu bar at the top of the screen, then root locus.

3. Select the variable L, in the inductor, & values shown below.

*Figure 7: The “value” field is the set-point for linearisation where applicable*

If you see empty space, try zooming in on the origin^{ii}!

*Figure 8: The position of the roots as inductance is varied*

Now that it’s clear how to make the software create the diagram, the next step is to examine why this method is so useful, both originally, and today, with access to tools that can do the computations quickly.

To do that, we start from the beginning, where the root-locus approach was created.

## Root Locus & Feedback Control

##### Computation of Roots

For the time-being, we deliberately avoid commenting on ways to find the roots of the characteristic equation. There are indeed several ways to go. In this article, one method is mentioned by name, and one is obvious from part I. A third has been mentioned in other articles, and will not be addressed here. Those are:

- Evans’ method (useful for use by hand but may of course be automated).
of 1+GH*Finding the roots*using a range of values for the chosen parameter (might typically use root-finding algorithms written in C++ or similar(Press & A., 2002)).*repeatedly*- Modelling using state-space ideas (uses linear algebra).

##### Evans’ Method

The American engineer W. R. Evans^{iii} devised an approach for plotting the root locus that is used to get closed loop behaviour ** directly from open-loop functions G(s) (plant) & H(s) (controller)**. We only explain the advantages & limitations here,

**to use it.**

*not how*##### The Purpose of Evans’ Method

Evans’ method does not require the reduction of the block diagram. It is carried out using knowledge of G(s) and H(s) only. This adds insight & simplicity.

The DYMOLA user can see, by way of the diagram, what form modifications to a controller should take. However. learning to draw the diagrams by hand is very helpful in learning to interpret the result, and how to draw them, depends on Evans’ Method.

Though originally, Evan’s Method was developed to ease computation by hand, it can assist digital computation too^{iv}. Evans focuses on the way the roots of G(s)H(s) “contribute” to the phase lag of the feedback signal.

*As a complex valued function G(s)H(s) must have phase angle 180(2k+1) and a magnitude of 1, to constitute a pole.*

That is just a way to obtain roots of the characteristic equation. For control engineers or enthusiastic learners, it illustrates the sensitivity of/to a controller. *Factorising the denominator of **Equation 1*** by algebra is avoided while automated execution avoids large numbers of function evaluations**.

However:

*Evans’ method (for manually drawing root loci) will not generally be useful if the characteristic equation cannot be stated in the form 1+KF(s) **where F is a ratio of polynomials and K is the quantity to be varied.*

*To get around this limitation, one usually has to define other gains in terms of the one to be varied. *

##### Applications

One critical and valuable area where insight is provided is when a plant exists, and a controller exists, and one hopes to modify the response, or wants to understand the effect of adding extra features to the controller.

*Because the method focuses on the contributions of the terms of G(s)H(s), one can more easily guess what is going to happen.*

##### Root Locus Analysis on a Closed Loop (“With Feedback”) System

##### DYMOLA – Finely Targeted Analysis vs Typical Math Software

It is important to consider that although many analysis systems allow root locus analysis, some of the most common are restricted in their utility. The most common software will carry out analysis only by varying the parameter K as shown by the form of the following diagram.

*Figure 9: A prototypical “unit feedback” form of system*

Bear in mind, ** that the root-locus will be the same for any transfer function with the same denominator**. That denominator embodies the governing equations. Therefore the above diagram still results in

**of the transfer function becoming:**

*the denominator*To initiate the analysis, the system has to be defined as stated above, by providing the system with the numerator and the denominator of F(s).

You then get the plot, and use it by keeping in mind that it applies to any closed loop whose transfer function has 1 + KF(s) as its denominator. Only K is varied. You cannot vary another parameter without casting it as the gain K in the above form!!

Remember, the root locus still ** exists for any** varied parameter, and you can get that diagram from DYMOLA.

By knowing Evans’ Method though, you can reason what generalisations will and won’t apply to your system and it’s diagram.

How to implement this method – investigating and making conclusions from the behaviour of the transfer function by seeing the G(s)H(s) term a magnitude & argument is discussed in later articles.

##### Stability Properties of Feedback Using DYMOLA

In part II, we used the system illustrated below to explore practically what the response of a system that has proportional & integral feedback could look like. We used a simple step input (basically the simplest input that takes a nonzero value over time) and we did not look at derivative feedback.

*Figure 10: The feedback setup used in part II*

##### Root Locus Plot of the Closed Loop System

We now examine the DYMOLA root locus plot. We use unit proportional gain and allow integral gain to vary^{v}. (See section: Plotting Root Loci in DYMOLA)

*Figure 11: The diagram summarises as fast as possible which buttons you need!*

*Figure 12: Using the DYMOLA GUI to spot important points on the diagram*

We can see from Figure 12 where the root locus crosses the **Im** axis. This is also a good moment to observe that due to the nature of the controller, the closed loop system has three roots. As it is a complex conjugate pair that cross the axes, we know at a glance that there will be a growing oscillatory response (Boyce & DiPrima, 2001) if we increase the integral gain too far, corresponding to our time traces.

However, the root locus plot would show this just as clearly no matter what the reference input was, or how complicated the system. That makes it very useful, even more so now that we can construct one automatically.

Without examining how these diagrams are constructed by hand, however, it is harder to extract the full information (Ogata, 2002) from examining one. The combination of knowing in detail why various features of the diagram arise, but not needing to manually draw them is therefore ideal. Indeed, it illustrates that the knowledge of Evans’ Method is today, more relevant for interpreting these diagrams, than it is for creating them.

##### Final Note

Although it is useful not to be restricted in the form of model for which a root-locus diagram can be drawn, special care must be taken when interpreting diagrams for models which could not have been made by Evans’ procedure.

Such an interpretation may be useful, or even correct, but cannot be assumed to be.

**Please get in touch if you have any questions or have got a topic in mind that you would like us to write about. You can submit your questions / topics via: Tech Blog Questions / Topic Suggestion.**

## References

Boyce, W. E. & DiPrima, R. C., 2001. *Elementary Differential Equations & Boundary Value Problems. *7th ed. Troy, NY: John Wiley & Sons Inc..

Ogata, K., 2002. *Modern Control Engineering. *4th ed. Upper Saddle River: Prentice-Hall.

Press, W. H. & A., T. S., 2002. *Numerical Recipes in C – The Art of Scientific Computing. *C++ ed. Cambridge : Cambridge University Press.

^{i} Which operates on the output of G(s), then feeds it back to the input, see previous articles.

^{ii }When the plots emerge, unless an astute choice for the spread of values was made, the diagram that emerges might have an unhelpful scale, with DYMOLA trying to include every point, but in so doing, letting the diagram be dominated by the large space between two initial, widely spaced points!

^{iii} Walter R. Evans 1920 – 1999

^{iv} Digital computers can work faster than us, and with less vulnerability to error, but they are capable of only a limited range of basic operations, so the procedure, or algorithm by which they reach their answer can change the computation times by orders of magnitude. When computers are used to carry out large, complex, or otherwise more intractable analyses, this can mean the difference between an answer ready in one day, or an answer ready in one year.

^{v} In the diagram shown, typical math software would only usually vary the “MASTERGAIN” parameter asit multiplies the entire feedback signal, not just a part of it.