Concepts
A scenario is one plant and one or more controllers. Every controller runs on its own copy of the plant, with the same noise, so their results can be compared directly.
Plant
The plant is the simulated filtration system: the ground truth of a run. At every instant it is either filtering or being backwashed, which a single command u decides:
u = +1: filtration (production). Permeate is produced and the membrane fouls.u = -1: backwash. The membrane is cleaned, at the cost of some permeate.
A plant exposes three quantities to the app:
| Quantity | Meaning | Seen by the controllers |
|---|---|---|
cost | what the run is judged on, for example the net volume of permeate produced | yes, with noise |
x1 | the fouling of the membrane | no: it has to be estimated |
x2 | a second output, or simply the elapsed time | yes, with noise |
A plant can have many more internal states. They are simulated but never shown.
The app ships with three benchmark plants taken from Filtration.jl (Benyahia, Cogan, Aichouche) and with membrane-bioreactor plants that couple biology and fouling.
Controllers
A controller chooses u at every sampling period, from the measurements only.
| Controller | What it does |
|---|---|
| Constant | keeps the same command for the whole run |
| Periodic | repeats a fixed cycle: a filtration duration, then a backwash duration |
| Optimal | applies the optimal feedback law of its own internal model |
| PeriodicOptimal | starts with a few periodic cycles to collect data, fits its internal model, then switches to optimal control |
Periodic has an option, use optimal period: after its first cycles it switches to the best fixed filtration/backwash split for the plant. It is the strongest periodic strategy, and so the fair reference for the optimal controllers.
Internal model and refit
An optimal controller does not know the plant. It reasons with a small internal model, one of the benchmark models of Filtration.jl, whose parameters it has to identify. That the internal model differs from the plant is the point of the comparison: it is the situation of a real installation.
A refit re-estimates the parameters of the internal model from the recent measurements. It happens after the warm-up cycles of a PeriodicOptimal controller, then at a regular interval. Each parameter can be left free or held fixed.
Closed loop
At each sampling period Ts:
- the plant is measured, with noise, every
Ts_measure; - each controller updates its estimate of the state and chooses
u; - the plant advances by one period under that command.
The app shows the result as it is computed:
- Comparison: the command, the cost and the fouling of every controller on shared axes, with the controllers' own estimates.
- Params: the parameters fitted by each controller, refit after refit.
- Metrics: by cycle, the filtration/backwash ratio, the net production rate, and the share of refits that succeeded.