Real-Time Optimization With the Wrong Model

A chemical reactor with feeds A and B and a separation train for product P

Open the Williams–Otto Plant and Real-Time Optimization app

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

A real-time optimizer moves a plant's setpoints toward the most profitable steady state using a model. The Williams-Otto plant has three reactions; the optimizer's model has two. Fitting the model's parameters better does not fix a missing reaction. This exercise watches a classic two-step RTO settle short of the best, a modifier adaptation scheme correct it with measured gradients, and an economic MPC handle a disturbance and a price change.

Learning Outcomes

  • Explain why re-fitting the parameters of a structurally wrong model does not reach the plant's optimum.
  • State the modifier adaptation correction and the condition it enforces at convergence.
  • Compare a steady-state optimizer with an economic MPC on a feed rise and a price change.

Book Chapter

Control in Chemical Plants (Volume 13), Chapter 11, Real-Time Optimization of a Williams–Otto Reactor Whose Model Lacks a Reaction. Read the chapter, open the PDF, or watch the lecture slides.

Theory in Brief

The two-step method alternates a parameter fit and an economic optimization on the fitted model:

$$\begin{gathered} \hat p = \arg\min_p \left\| y_p - y(u, p) \right\|^2, \\ u^{*} = \arg\max_u \; \phi(u, \hat p) \\ \mathrm{s.t.}\quad g(u, \hat p) \le 0 \end{gathered}$$

It stops where the fitted model's gradient vanishes. When the model's structure is wrong, that point is not the plant's optimum, which satisfies `\nabla \phi_p(u^{*}) = 0`. Modifier adaptation adds first-order corrections so that the model's gradients match the plant's, estimated from past operating points:

$$u_{k+1} = \arg\max_u \; \phi(u) + \lambda_k^T \left(u - u_k\right), \qquad \lambda_k = \nabla \phi_p(u_k) - \nabla \phi(u_k)$$

At convergence the corrected model's optimum satisfies the plant's optimality conditions, whatever the model's structure, provided the plant gradients are estimated well. That needs excitation and steady states, so it is slow. An economic MPC optimizes the profit over a horizon on a dynamic model, so it moves within minutes of a measured disturbance, but it inherits its model's errors at steady state.

Model: Physics-based but structurally wrong. A two-reaction model of a three-reaction plant, refitted from measurements.
Decision: The feed rate and reactor temperature setpoints, updated hourly (RTO) or every few minutes (economic MPC).
Learning: Parameter fitting and gradient estimation from measured steady states; modifier adaptation learns corrections, not parameters.

Exercise

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

Predict. The two-step RTO fits its model at every run. Will it reach the plant's best profit? If not, will modifier adaptation, which uses the same model, do better?

Run the Williams–Otto Plant and Real-Time Optimization app. Use the fastest speed, 10 h/s, and press Run again to pause at the times in each step.

  1. Open 3 · Two-step RTO settles below the best, set RTO method to Two-step, and run to 12 h. Read Gap to best and Profit (measured).
  2. Open 4 · Modifier adaptation climbs to the best, set RTO method to Modifier adaptation, and run to 24 h. Read the same tiles.
  3. Open 9 · Economic MPC against modifier adaptation: a feed rise and a price cut (economic MPC; the A feed rises at 12 h and the product price falls at 24 h). Run to 30 h and read Gap to best and Profit so far, % of best.
  4. Press Reset, set RTO method to Modifier adaptation, and run to 30 h again.

Explain.

  1. The two-step RTO's own model says it reached the optimum. Why is the plant's profit still 7 % short?
  2. After the price cut, which method is closer to the new best, and why does the time it takes to adapt matter?

Generative AI Learning

"A real-time optimizer re-fits its model's parameters every hour and then optimizes profit on the fitted model. The model is missing one reaction. Will the RTO converge to the plant optimum? What would fix it?"

Check the answer against your run: A good answer says no, because parameter fitting cannot fix structural mismatch, and names modifier adaptation or gradient correction as a fix. Your step 1 and step 2 gaps are the test. The assistant is your tutor and reviewer; you answer for every claim you turn in.

What to Turn In

A four-row table (two-step, modifier adaptation, economic MPC, modifier adaptation on the same events) with gap to best and profit, your written prediction, and three sentences that answer the two questions.

The two-step RTO settles with Gap to best at 7.13 % and a measured profit of 167.0 $/s against the best 178.5 $/s. It stopped where its fitted model's slopes vanish, and that is a property of the model: a two-reaction model fitted to a three-reaction plant has its optimum in the wrong place however well its parameters are fitted. Modifier adaptation with the same model reaches a gap of 2.78 % by 24 h: the corrections `\lambda_k` replace the model's gradients with the plant's, and the corrected optimum moves toward the plant's; it is still closing the last few percent at 24 h because each gradient estimate needs new steady states.

On the feed rise and price cut, the economic MPC's gap at 30 h is 1.30 % with 98.45 % of the best earned so far; modifier adaptation's gap is 6.41 % with 98.46 %. The two earn about the same overall. After the price cut the MPC is much closer to the new best, because it re-optimizes within minutes on its dynamic model, while modifier adaptation must wait for new steady states to re-estimate the plant's gradients. Each is right about something different: modifier adaptation about the plant's optimum, eventually; the MPC about the next few hours.

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.

Control Objectives discusses economic objectives. In Python, take a plant profit `\phi_p(u) = -(u-2)^2` and a model `\phi(u) = -(u-1)^2` with one fitted offset parameter. Run the two-step method and modifier adaptation from `u = 0` with gradients estimated by finite differences, and plot both paths.

Related

References

  1. Hedengren, J. D. (ed.), Control in Chemical Plants, Volume 13 of Interactive Control Engineering, Chapter 11, "Real-Time Optimization of a Williams–Otto Reactor Whose Model Lacks a Reaction", pp. 255–281, Advanced Process Solutions, 2026. PDF (CC BY 4.0).
  2. Marchetti, A., Chachuat, B., Bonvin, D., Modifier-adaptation methodology for real-time optimization, Industrial & Engineering Chemistry Research 48(13), 6022–6033, 2009.
  3. Williams, T. J., Otto, R. E., A generalized chemical processing model for the investigation of computer control, AIEE Transactions 79(5), 458–473, 1960.

Course Information

TCLab

Project

Applications

Advanced Control Exercises

Exams

Modeling

Machine Learning

Estimation

Control

Reinforcement Learning

Related Courses

Admin