ModelRisk Optimizer example · Energy and utilities
Desalination Plant: Antiscalant Dosing
How much antiscalant should each reverse-osmosis train receive when feed salinity is uncertain?
The optimisation problem
Lowest mean daily cost
- Decide
- 6 antiscalant doses, 0 to 8
- Goal
- Lowest mean daily cost
- Limit
- 95th-percentile brine toxicity no more than 34
- Engine
- Vertex Detector
What the Optimizer found
| Starting plan | Optimizer’s plan | |
|---|---|---|
| Train 1 | 3 | 1 |
| Train 2 | 3 | 1 |
| Train 3 | 3 | 2 |
| Train 4 | 3 | 2 |
| Train 5 | 3 | 1 |
| Train 6 | 3 | 2 |
| Goal: Mean total cost ($/day) | 2,520 | 1,682 |
| Limit: 95th percentile of brine toxicity index, at most 34 | 23.8 met | 14.8 met |
ModelRisk Optimizer run on 13 Oct 2026: the Vertex Detector engine, with Turbo simulation, tried 296 plans, each simulated with 10,000 samples, in 3 seconds. Both plans above were then simulated again with the same 10,000 samples.
What the workbook models
A seawater RO plant runs 6 membrane trains. Antiscalant suppresses mineral scaling but is costly and loads the brine discharge with toxicity. Feed salinity varies day to day (lognormal), so whether a train fouls — and needs an expensive clean-in-place — is uncertain. You choose an integer dose 0 to 8 per train.
Decision, objective and constraint
- Decision variables
- 6 integer antiscalant doses (Model!B15:B20), each 0 to 8
- Objective
- Minimise the Mean of total daily cost (antiscalant + expected clean-in-place), Model!C25
- Hard constraint
- 95th-percentile brine toxicity index ≤ 34 (Model!C26) — a service-level / discharge-permit limit
Why the Vertex Detector
The percentile (chance) constraint makes the feasible region a thin, noisy boundary walled by an infinite penalty: any dose vector that violates the 95% toxicity limit is infeasible, so finite-difference gradient engines see a flat wall and stall. Method = Auto routes this integer + percentile-constrained model to the Vertex Detector, which samples vertices and walks the feasible edge to the least-cost dose plan.
The model
Set the antiscalant dose on each RO train to minimise expected cost while holding a 95% brine-toxicity limit.
InputDecision (the Optimizer changes it)Calculated or uncertain (sampled each iteration)Objective
Plant parameters
| Scaling decay per dose unit k | 0.28 |
|---|---|
| Fouling threshold (scaling index) | 1.05 |
| Antiscalant cost per dose unit ($/day) | 140 |
| Membrane clean-in-place cost if fouled ($) | 2,600 |
| Brine toxicity per dose unit (index) | 1.00 |
| 95%-tile toxicity limit | 34.00 |
Membrane trains (decision = integer dose 0 to 8)
| Train | Dose (0-8) | Feed salinity × | Scaling index | Fouled clean $ | Toxicity |
|---|---|---|---|---|---|
| Train 1 | 3 | uncertain | calculated | calculated | uncertain |
| Train 2 | 3 | uncertain | calculated | calculated | uncertain |
| Train 3 | 3 | uncertain | calculated | calculated | uncertain |
| Train 4 | 3 | uncertain | calculated | calculated | uncertain |
| Train 5 | 3 | uncertain | calculated | calculated | uncertain |
| Train 6 | 3 | uncertain | calculated | calculated | uncertain |
Results
| Antiscalant cost ($/day) | calculated |
|---|---|
| Expected clean cost ($/day) | calculated |
| TOTAL cost ($/day): objective | calculated |
| Brine toxicity index: constraint | calculated |
Decision cells hold starting values: the workbook opens at the starting plan above, and the Optimizer finds its plan when you run it. The figures are illustrative.
Run it yourself. Open the workbook with ModelRisk, open the Optimizer from the ribbon (the saved task opens with it) and press Start.
How to run it
- ModelRisk ribbon then Optimizer (the saved task opens automatically).
- Press Start Optimization.
- Read the optimal doses in B15:B20 and the cost in C25.
- Simulation: 1000 Monte-Carlo iterations per trial (needed for a stable 95th percentile).
Glossary
- Antiscalant
- chemical that keeps dissolved minerals from precipitating on the membrane
- Clean-in-place
- chemical wash of a fouled membrane train; costly and interrupts production
- 95th percentile
- the value the toxicity index stays below on 95% of simulated days
Find similar models
- Product
- Type
- Application
- Uses
Download the workbook and run the Optimizer. It opens in Excel with ModelRisk.
Related example models
- ModelRiskOptimizer★★★★★Micro-Grid: Single-Period Economic DispatchHow much power to draw from each source to maximise expected margin within the feeder and emissions limits?Dispatches power from four sources for the highest mean margin, within limits on grid import and emissions.
- ModelRiskOptimizer★★★★★Wastewater Aeration: Blower StagingHow many blower steps per basin minimise the worst-case energy bill while keeping oxygen safe 95% of the time?Stages the blowers in four basins to cut the worst 10% of energy bills, keeping oxygen above 2.0 mg/L with 95% assurance.
- ModelChoice★★★★★Renewable Energy Project SelectionA 50 MW solar farm, a 30 MW wind farm, solar with storage, or no project?One decision and 12 chance events. Best first decision: Hybrid Solar+Storage, expected value $4.9m.
An illustrative example: the figures are invented for teaching. Last updated 9 October 2026.