Home / Monte Carlo / Analyzing the Model / Optimize / Optimize How-To
Optimize How-To¶
This walkthrough uses a small model you can build in a minute: two inputs, one output, and a specification band that half the output sits outside of.
Press Copy for Excel, then paste the table into a blank worksheet.
| Model | Value |
|---|---|
| Wall thickness | 10 |
| Bore | 4 |
| Outside width | =B2*2+B3 |
Click cell A1 in a blank worksheet and press Ctrl+V. The two headings land in row 1, the labels in column A, and the model in column B: B2 holds the wall thickness, B3 the bore, and B5 the formula that reads them both. The empty row is deliberate, so the output lands in B5 and not B4, which is what every Monte Carlo walkthrough calls it.
Mark B2 and B3 as inputs with Mark Input, giving each a Normal distribution: B2 mean 10 standard deviation 0.2, B3 mean 4 standard deviation 0.1. Mark B5 as an output with Mark Output and give it a lower limit of 23 and an upper limit of 25.
Steps¶
-
QXL Monte Carlo New > Monte Carlo > Optimize.
-
Set the goal on the output, and give each input the range the search may move it in.
-
Run the search, then read the settings it returns.
What it is searching¶
The model, with the inputs' distributions in play. The answer is a set of input settings, and the figures beside it are what the simulation gives at those settings.
Narrow the input ranges to settings you can actually hold. The search will use whatever range you allow, so a range the process cannot reach produces an answer you cannot use.
Check the answer before you act on it¶
Run the model at the returned settings. Set each input's mean to the value the search returned and run Run Model. The output should match what the optimizer reported, and if it does not, the difference is the thing to understand before going further.
A second search can return a different answer. That tells you the optimum is flat rather than that something is wrong, and a flat optimum is useful news: it means the setting does not have to be held precisely.
Things to try next¶
- Tighten B5's limits and re-run. The achievable goal moves, and that trade is the output worth having.
- Fix one input by giving it a range of zero width, and let the search work on the other.
- Compare with Tolerance Allocation, which asks what tightening a spread buys rather than where to centre it.