MPC on the Unstable Branch of a Nonlinear Reactor

A jacketed continuous stirred tank reactor with cooling water and a temperature sensor

Open the Stirred Reactor Control Studio app

Advanced Control Exercise 21 of 30 in Nonlinear and Economic MPC · All exercises · Time: 15 minutes

An exothermic stirred reactor can have three steady states for the same inputs, and the middle one, often the most profitable, is unstable. A controller built on a model linearized there holds it well. When the reactor runs away to the hot state, the same linear model is far from right, and the estimate of the unmeasured concentration matters. This exercise measures both.

Learning Outcomes

  • Locate the steady states of an exothermic reactor from its heat generation and removal curves and judge their stability.
  • Compare an MPC and a PID holding the unstable steady state against a setpoint step and a feed disturbance.
  • Explain why a linear model fails far from its operating point, and what a better concentration estimate can and cannot fix.

Book Chapter

Nonlinear Dynamics, Oscillations, and Stabilization (Volume 7), Chapter 2, Exothermic Reactor Simulator for Temperature Control Across an Ignition Boundary. Read the chapter, open the PDF, or watch the lecture slides.

Theory in Brief

With concentration `C_A`, temperature `T` and jacket temperature `T_c`, the balances are

$$\begin{gathered} \frac{dC_A}{dt} = \frac{q}{V}\left(C_{Af} - C_A\right) - k_0 e^{-E/RT} C_A, \\ \frac{dT}{dt} = \frac{q}{V}\left(T_f - T\right) + \frac{-\Delta H}{\rho c_p} k_0 e^{-E/RT} C_A + \frac{UA}{\rho c_p V}\left(T_c - T\right) \end{gathered}$$

At steady state the heat generated by reaction, `G(T)`, an S-shaped curve, equals the heat removed by flow and jacket, `R(T)`, a straight line. They cross up to three times. A crossing is unstable where generation rises faster than removal:

$$\frac{dG}{dT} > \frac{dR}{dT}$$

The middle crossing at 340 K is of that kind: linearized there, `\dot x = A x + B u` has an eigenvalue with positive real part. An MPC on that linear model, with a disturbance estimate, holds the reactor there. Far from 340 K the Arrhenius term changes by orders of magnitude and the linear model's predictions are wrong. A nonlinear MPC would relinearize, or solve the nonlinear program, along its own plan; exercise 22 shows that step. The estimator matters too: an MHE can bound `0 \le \hat C_A \le C_{Af}`, which a Kalman filter cannot.

Model: Physics-based. Nonlinear mass and energy balances; the MPC plans on their linearization at 340 K.
Decision: The jacket temperature, every 3 s, from a quadratic program over the horizon.
Learning: None offline. The estimator infers the unmeasured concentration online from the temperature.

Exercise

Read 2 min · Predict 1 min · Run 7 min · Explain 3 min · Check your AI 2 min.

Predict. The reactor sits at 340 K on its unstable branch. Will an MPC built on a model linearized there step the setpoint to 345 K with less overshoot than a PID? After a runaway to over 400 K, will a bounded MHE help the MPC recover faster than a Kalman filter?

Run the Stirred Reactor Control Studio app. Use the fastest speed, 10 min/s, and press Run again to pause at the times in each step.

  1. Open 9 · MPC on the unstable branch. Press Run and pause at 10 min: the setpoint steps to 345 K at 1 min and the feed warms at 5 min. Read the reactor temperature IAE and the peak after the setpoint step on the trend.
  2. Set Controller to PID, press Reset, run to 10 min and read the IAE.
  3. Open 10 · MPC takes over a runaway: Kalman or MHE estimate: the reactor runs away at 1 min and the MPC with the MHE takes over at 3 min. Run to 10 min and read the IAE and the jacket's MV travel.
  4. Set Estimator to Kalman (Advanced), press Reset, and run again.

Explain.

  1. Why can the controller hold an unstable steady state at all, and what limits how far from it the linear model is useful?
  2. The bounded MHE gives a physically possible concentration, yet it helps the recovery only a little. Why?

Generative AI Learning

"An exothermic CSTR has three steady states. Explain how to tell which are stable, and whether a linear MPC designed at the unstable middle state can recover the reactor from the hot steady state."

Check the answer against your run: A good answer uses the slopes of heat generation and removal and says a linear model is accurate only near its linearization point, so recovery from far away is slower or needs relinearization. Your step 3 and 4 runs test it. The assistant is your tutor and reviewer; you answer for every claim you turn in.

What to Turn In

A four-row table (MPC, PID, MPC with MHE, MPC with Kalman) with the IAE and MV travel, your written prediction, and three sentences that answer the two questions.

Holding the unstable branch, the MPC's IAE over 10 min is 2.69 K·min with 103 K of jacket travel, against 4.38 K·min and 128 K under the PID. Both stabilize the reactor, because feedback moves the jacket faster than the unstable mode grows; the MPC overshoots the setpoint step less (the app's case text gives 345.75 K against 347.29 K) because its model predicts how the temperature will respond to a jacket move; after the feed step both peak about the same.

After the runaway, the MPC with the MHE scores 118 K·min with 364 K of jacket travel, and with the Kalman filter 123 K·min and 397 K. The MHE helps a little: its concentration stays inside its physical bounds, so the plan starts from a more sensible state. It cannot fix the plan's model, which is linearized at 340 K while the reactor is at more than 400 K, where the reaction rate is many times what the model says. The bound corrects the state, not the model; a nonlinear or relinearized plan is what would.

Measured with the app build of December 3, 2026 by a scripted replay of the steps above. Numbers that no tile shows come from the replay's record; your readings from the trends will be close. A later app release may move the last digit.

Nonlinear Control runs a nonlinear MPC on this CSTR in GEKKO. Start it from the hot steady state and compare with a linear MPC linearized at 340 K: plot both jacket profiles. The nonlinear plan cools harder at first because its model knows how fast the reaction is at 400 K.

Related

References

  1. Hedengren, J. D. (ed.), Nonlinear Dynamics, Oscillations, and Stabilization, Volume 7 of Interactive Control Engineering, Chapter 2, "Exothermic Reactor Simulator for Temperature Control Across an Ignition Boundary", pp. 22–52, Advanced Process Solutions, 2026. PDF (CC BY 4.0).
  2. Uppal, A., Ray, W. H., Poore, A. B., On the dynamic behavior of continuous stirred tank reactors, Chemical Engineering Science 29(4), 967–985, 1974.

Course Information

TCLab

Project

Applications

Advanced Control Exercises

Exams

Modeling

Machine Learning

Estimation

Control

Reinforcement Learning

Related Courses

Admin