Disturbance rejection in Simulink - Time & Space Complexity
We want to understand how the time needed to reject disturbances changes as the system size grows.
How does the system's response time scale when disturbances increase?
Analyze the time complexity of the disturbance rejection block in this Simulink model.
% Simulink disturbance rejection example
% Assume a feedback control loop with disturbance input
% and a PID controller block
% Time vector
t = 0:0.01:10;
% Disturbance input block
Disturbance = (t >= 5);
% Plant model block
Plant = tf([1], [1 3 2]);
% PID controller block
Controller = pid(1, 0.5, 0.1);
% Closed-loop system
ClosedLoop = feedback(Controller*Plant, 1);
% Output response to disturbance
Output = lsim(ClosedLoop, Disturbance, t);
This code models how a control system reacts to a sudden disturbance using a PID controller and a plant model.
Look for repeated calculations or simulations that affect time.
- Primary operation: Simulation of system response over time steps.
- How many times: Once per time step in the simulation timeline.
The time to simulate grows as we increase the number of time steps in the simulation.
| Input Size (n = time steps) | Approx. Operations |
|---|---|
| 10 | 10 simulation steps |
| 100 | 100 simulation steps |
| 1000 | 1000 simulation steps |
Pattern observation: The operations increase directly with the number of time steps.
Time Complexity: O(n)
This means the time to simulate disturbance rejection grows linearly with the number of time steps.
[X] Wrong: "The disturbance rejection simulation time stays the same no matter how long the simulation runs."
[OK] Correct: Each additional time step requires calculations, so longer simulations take more time.
Understanding how simulation time grows helps you design efficient models and explain system behavior clearly.
"What if we increased the complexity of the plant model? How would the time complexity change?"
Practice
Solution
Step 1: Understand disturbance rejection purpose
Disturbance rejection aims to keep the system output steady even when outside changes happen.Step 2: Compare options to this goal
Only To keep the system output stable despite external changes matches this goal by focusing on output stability despite disturbances.Final Answer:
To keep the system output stable despite external changes -> Option AQuick Check:
Disturbance rejection = output stability [OK]
- Confusing disturbance rejection with increasing input
- Thinking disturbance rejection removes feedback loops
- Assuming it speeds up the system only
Solution
Step 1: Identify blocks that affect disturbance
PID Controller blocks adjust system response to reduce disturbance effects.Step 2: Eliminate unrelated blocks
Gain changes signal strength, Scope shows signals, Mux combines signals but doesn't reduce disturbances.Final Answer:
PID Controller block -> Option AQuick Check:
PID Controller reduces disturbances [OK]
- Choosing Scope block which only displays signals
- Confusing Gain block with disturbance rejection
- Selecting Mux block which combines signals
Disturbance --> + --> System --> Output
^ |
|-----------------|
PID ControllerSolution
Step 1: Understand low PID gains effect
Low PID gains mean weak correction to disturbances, so system output follows disturbance closely.Step 2: Analyze other options
Complete rejection needs strong gains, oscillation usually comes from too high gains, zero output is unrealistic here.Final Answer:
The system output will closely follow the disturbance -> Option BQuick Check:
Low gains = poor disturbance rejection [OK]
- Assuming low gains cause oscillations
- Thinking output will be zero regardless
- Believing disturbance is fully rejected with low gains
Solution
Step 1: Identify cause of large output fluctuations
High PID gains can cause the system to become unstable and oscillate, causing large fluctuations.Step 2: Check other options
Missing disturbance input means no disturbance effect, Scope connection affects display only, no input signal means no output but not fluctuations.Final Answer:
The PID controller gains are set too high causing instability -> Option DQuick Check:
High gains cause instability and fluctuations [OK]
- Blaming Scope block for output fluctuations
- Ignoring PID gain settings
- Assuming missing disturbance input causes fluctuations
Solution
Step 1: Identify blocks for disturbance rejection
PID Controller with tuned gains helps react quickly and reduce overshoot; feedback loop is needed to correct disturbances.Step 2: Evaluate other options
Gain block alone cannot reject disturbances well; Scope only monitors signals; Mux combines signals but does not control.Final Answer:
Use a PID Controller block with tuned proportional and derivative gains, plus a feedback loop including the disturbance input -> Option CQuick Check:
PID + feedback = fast, minimal overshoot rejection [OK]
- Relying on Gain block without feedback
- Using Scope as control instead of monitoring
- Ignoring feedback loop importance
Ready to prove it?
Pass the test and this pattern moves unknown
