Home / Monte Carlo / Model Building / Mark Input
Mark Input¶
From Excel click...
QXL Monte Carlo New > Design > Mark Input
Marks one or more worksheet cells as inputs to the Monte Carlo model, and says what distribution each one is drawn from. An input is a quantity that varies: on every trial of a simulation, Quantum XL draws a value from the distribution and writes it into the cell, and the rest of the worksheet recalculates from it.
A marking is what tells Quantum XL that one worksheet cell takes part in the model. Marking a cell does not change the value in it and does not add a formula to it. It records, alongside the worksheet, that this cell is an input the simulation will write trial values into, or an output the simulation will read a result from.
Everything the model knows about a cell comes from its marking. A workbook with no markings has no model in it, however many formulas it holds.
What a cell has to be¶
A cell has to be the right kind of cell before it can be marked, and Quantum XL checks twice: once when the dialog opens, so you are told before you fill anything in, and again when you press OK, because Excel stays live while the dialog is open and the cell can change in between.
| Marking | The cell must be | Because |
|---|---|---|
| Input | not a formula | the simulation writes a trial value into the cell on every run, which would destroy a formula |
| Input | numeric, or empty | an input is a numeric random variable. An empty cell is allowed, because an input cell is legitimately blank until the simulation fills it |
| Output | a formula | an output has to compute from the model |
The refusals say which cell and which rule, worded as the product words them:
Inputs can only be defined for cells which are not formulas. The cell
Sheet1!$B$4contains a formula.Inputs must be numeric. The cell
Sheet1!$B$4contains a non-numeric value.Outputs can only be defined on cells that are formulas. The cell
Sheet1!$B$4does not contain a formula.
When the cell changed while the dialog was open, the same sentence is used with one in front of it, so a refusal minutes after you opened the dialog does not read as though the cell had been wrong all along:
The cell changed in Excel while this dialog was open.
Nothing has been written when a commit is refused this way.
Merged cells cannot be marked. The refusal comes when the dialog opens, and the same condition is checked again when the model is read.
A protected sheet refuses a marking only when the write would actually fail, which is why marking works on the design sheet: that sheet is protected but leaves its own anchor cells unlocked and its notes writable. The two cases that do refuse are a locked cell, and a sheet whose drawing objects are protected, because every marking writes a note on the cell it marks. Both say what to do about it:
Unprotect the sheet in Excel (Review tab, Unprotect Sheet), then mark the cell.
Marking more than one cell at once¶
Select a range before pressing Mark Input and every cell in it is marked, with the dialog showing the top-left cell of the selection. The Inputs range band at the top of the dialog names the cells being marked, and it stays visible on both tabs.
Every cell in the selection is checked before the dialog opens, and the first one that cannot be an input names itself in the refusal.
When more than one cell is being marked, a value linked to a worksheet cell can shift from one marked cell to the next, and a box appears to say how. See Reference mode on the Options page.
The dialog¶
The controls sit on two tabs, with a live density preview beside them.
Distribution, the everyday tab, has four sections: the input's name and distribution, its parameters, optional truncation, and whether the input can be optimized.
Advanced has two more: the valid range, which records where the model is valid, and the default range for plotting. Neither affects sampling.
Every control on both tabs is described on the Options page.
The density preview¶
The panel beside the controls draws the distribution currently described by the boxes, and it redraws as you type. Truncation shows in it: an excluded tail or an excluded interior band is cut out of the curve, so you can see the shape the simulation will actually draw from.
The preview is a drawing with nothing to operate, so it is not a stop on the keyboard tab order. It is announced to a screen reader as part of the window, and it re-announces itself when the drawing changes.
Choosing a distribution with help¶
Two buttons sit under the form.
Browse Distribution Gallery opens a gallery of the distributions and returns your choice to the list, which then rebuilds the parameter boxes for it.
Fit Distribution from Data is advertising a future version. Pressing it says so in the status line and changes nothing.
The Help button opens the reference page for whichever distribution is selected at the moment you press it, at that distribution's own section. A custom distribution or an Empirical variable opens the Custom Distributions page instead.
Moving between marked inputs¶
<< Previous Input and Next Input >> save the input you are looking at and show the next one already marked in the workbook, so a model can be reviewed without closing and reopening the dialog for each cell.
Both buttons stay enabled at all times, including when there is nowhere to go, because a disabled button cannot take keyboard focus. Pressing one with nowhere to go says why in the status line.
What is written¶
Markings are stored in the workbook, so they travel with the file and survive being closed and reopened. Three things are written for each marked cell:
| What | Where | What it is for |
|---|---|---|
An Input or Output entry |
in a hidden container sheet in the workbook | the marking itself: the name, the distribution or the spec limits, and every parameter |
A defined name beginning DFSSXLTag_ |
in the workbook's defined names | how the entry finds its cell again after rows are inserted, cells are dragged, or a sheet is renamed |
| A note on the cell | on the cell itself | the indicator you can see, so a marked cell is visible on the worksheet |
The container is the same format Quantum XL v17 wrote, so a workbook marked in v17 opens here.
Two pieces of information are v18 additions that v17 does not write and ignores when it meets them: each link also stores the cell address it currently points at, rewritten every time the marking is saved, and each link stores the name to display for it. The address is a fallback used when the defined name no longer resolves, so a link still finds its cell if the name is deleted. The value itself is always read from the cell at the moment of the run, never from that stored copy.
The display name is stored as an attribute rather than as the entry's text, so cleaning up a marking never deletes a named range of yours.
The note on the cell¶
The note on a marked cell is what makes the marking visible on the worksheet, and it summarises what was marked. An input note names the input, its distribution, one line per parameter, and whether the input can be optimized:
Quantum XL Input
Inlet pressure
Distribution=Normal
Mean=12.5
Standard deviation=0.4
Can be optimized=True
An output note names the output and the specification limits, and a limit that was not given has no line at all:
Quantum XL Output
Yield
LSL=98
USL=102
An unnamed cell shows (cell address) on its name line rather than a resolved address, so the note
does not go stale when the cell moves. A value that came from a link shows (linked value) rather
than a number, because the number is only known at run time.
Removing a marking¶
Unmark removes the marking from the selected cells and leaves their values alone.