PAT replaces slow, offline lab sampling with an inline probe
(the glowing tip in the tank) that measures the reaction continuously.
That signal feeds a feedback controller, which adjusts the feed valve
to keep the measured value at the setpoint. Toggle the loop open to see
the concentration drift with a fixed valve, or add sensor noise to see
how a real probe's jitter propagates into valve chatter.
dC/dt = k_feed · valve − k_decay · C + disturbance
measured = C + noise (if sensor noise is on)
error = setpoint − measured
valve = clamp(Kp · error, 0, 1) (closed loop only)
- Setpoint — the target concentration the batch should be held at.
- Controller gain (Kp) — how aggressively the valve reacts to error; too high causes overshoot/oscillation, too low reacts too slowly.
- Control loop — closed uses the sensor to correct the valve automatically; open freezes the valve, showing an uncontrolled process.
- Disturbance — injects a sudden feed/impurity shock so you can watch the controller reject it (or not, if the loop is open).