Root locus analysis in Simulink - Time & Space Complexity
We want to understand how the time to perform root locus analysis changes as the system size grows.
How does the number of calculations grow when we analyze more complex systems?
Analyze the time complexity of the following MATLAB root locus setup.
% Define transfer function
sys = tf([1], [1 3 2]);
% Define gain range
K = 0:0.1:10;
% Compute root locus
rlocus(sys, K);
This code calculates the root locus for a system over a range of gain values.
Look for repeated calculations in the code.
- Primary operation: Calculating system poles for each gain value.
- How many times: Once for each gain in the range (here, about 101 times).
As the number of gain points increases, the calculations increase proportionally.
| Input Size (n) | Approx. Operations |
|---|---|
| 10 | 10 calculations of poles |
| 100 | 100 calculations of poles |
| 1000 | 1000 calculations of poles |
Pattern observation: Doubling the number of gain points doubles the work.
Time Complexity: O(n)
This means the time grows directly in proportion to the number of gain values analyzed.
[X] Wrong: "The time to compute root locus stays the same no matter how many gain points we check."
[OK] Correct: Each gain value requires recalculating poles, so more points mean more work.
Understanding how computation time grows helps you explain system analysis efficiency clearly and confidently.
What if we increased the system order (more poles and zeros)? How would the time complexity change?
Practice
Solution
Step 1: Understand root locus purpose
The root locus plot shows how the locations of system poles change as the gain parameter varies.Step 2: Differentiate from other plots
Frequency response and time response plots show different system behaviors, not pole movement.Final Answer:
How the system poles move as the gain changes -> Option CQuick Check:
Root locus = pole movement with gain [OK]
- Confusing root locus with frequency response
- Thinking it shows output noise
- Mixing it up with time response plots
G = tf([1], [1, 3, 2])?Solution
Step 1: Identify root locus command
In Simulink and MATLAB,rlocus()is the function to plot root locus.Step 2: Differentiate from other commands
step()plots step response,bode()plots frequency response, andpzmap()plots poles and zeros but not root locus.Final Answer:
rlocus(G) -> Option AQuick Check:
Root locus plot = rlocus() [OK]
- Using step() instead of rlocus()
- Confusing bode() with root locus
- Using pzmap() which shows poles but no gain variation
G = tf([2], [1, 4, 5]), what is the number of branches in the root locus plot?Solution
Step 1: Determine number of poles
The denominator polynomial[1, 4, 5]is second order, so there are 2 poles.Step 2: Relate poles to root locus branches
Root locus branches equal the number of poles, so there are 2 branches.Correction:
The denominator polynomial[1, 4, 5]is of order 2, so there are 2 poles, but the number of branches in root locus equals the number of poles, which is 2, not 3.Final Answer:
2 -> Option BQuick Check:
Branches = number of poles = 2 [OK]
- Counting zeros instead of poles
- Confusing numerator order with poles
- Assuming branches equal zeros
rlocus(tf([1 2], [1 3]))Solution
Step 1: Check transfer function order
Numerator order is 1 (degree 1), denominator order is 1 (degree 1). Transfer function is proper if denominator order >= numerator order.Step 2: Analyze properness
Here numerator and denominator orders are equal, so transfer function is proper, not improper.Step 3: Check command validity
The command is syntactically correct and will run without error.Final Answer:
No error, command is correct -> Option AQuick Check:
Proper TF and syntax = no error [OK]
- Assuming numerator length must be less than denominator
- Thinking equal order is improper
- Confusing vector length with polynomial degree
G = tf([1], [1, 2, 2, 1]). You want to design a controller gain K so that the system poles lie on the left half of the complex plane for stability. Using root locus analysis, which gain range should you choose?Solution
Step 1: Understand root locus stability
Root locus shows pole movement as gain K changes. Poles in left half-plane mean stable system.Step 2: Identify gain limits for stability
Poles start stable at K=0 and move as K increases. Stability is maintained until poles cross imaginary axis at a critical gain.Step 3: Choose gain range
Gain K must be positive and less than the critical gain where poles cross imaginary axis to keep system stable.Final Answer:
K > 0 and less than the gain where poles cross imaginary axis -> Option DQuick Check:
Stable poles = gain below crossing point [OK]
- Assuming any positive gain is stable
- Choosing negative gain for stability
- Ignoring pole crossing points
Ready to prove it?
Pass the test and this pattern moves unknown
