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 on the output.
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.25 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.
With B2's mean at 10.25, B5 has a mean of 24.5 and a standard deviation of 0.4123
(the square root of (2*0.2)^2 + 0.1^2), which puts 112,764 dpm outside the 23 to 25 band.
Steps¶
-
QXL Monte Carlo > Monte Carlo > Optimize. Optimizer Setup opens on Step 1 of 2: the goal and the constraints.
-
Choose Optimize one statistic and set the goal sentence's pickers to Minimize, dpm and the B5 output, so it reads "Minimize the dpm of" followed by B5's name. Click Next.
-
Step 2 of 2: the input ranges has one Mean row per input: B2 from 8.25 to 12.25 and B3 from 3 to 5, each the mean plus or minus 10 standard deviations. Set the B3 row's Type to Not Optimized, which keeps B3's mean at 4. Click Next.
-
Optimization in progress charts the best dpm found so far. When the run ends, Optimizer Results has one row, B2's Mean, with its Value now (10.25) and its Optimal value, and the dpm at that value after Optimizer Results:.
-
Click Yes to write the optimal value into B2's input, or No to leave it at 10.25. Tick Run Monte Carlo simulation at the optimal settings before clicking Yes to run the model once the value is written.
What it can change¶
The Optimized rows on screen 2, each between its Low and its High. The answer is one value per Optimized row, and the figure after Optimizer Results: is the goal's statistic at those values.
For this model the lowest dpm with B3's mean at 4 is at a B2 mean of 10, where B5 is centred at 24 and the dpm is 15,293. The Optimizer measures its figures by simulation, so it reports a value near those, not exactly them.
Applying the answer¶
Yes writes the optimal values into the inputs. A value typed in Mark Input is replaced in the input's stored definition, and a value linked to a cell is written into that cell. The note on B2 is not rewritten, so it can still show the old mean. There is no undo.
Run Monte Carlo simulation at the optimal settings runs an ordinary simulation after the values are written, with the Simulations and Sampling lists on the ribbon, as Run Model does.
Things to try next¶
- Set a target: choose Set target in the goal sentence and type the value after "to".
- Move a spread: in Parameter to add, choose B2's Standard deviation and click Add Input Optimization Parameter, then type its Low and High.
- Add a constraint with Add Constraint on screen 1.
See Also¶
- Optimize
- Options, every control on the dialog
- Tolerance Allocation