Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Studies and uncertainty

FlowState has three tools for asking “how sensitive is the result?”:

  • Studies: uncertainty and sensitivity studies that sample many inputs at once (Monte Carlo, Latin hypercube, Sobol or Morris), with correlated inputs, distributions of the key figures, sensitivity rankings and fan charts;
  • Tornado & scale-up: a quick one-at-a-time tornado and a throughput scale-up;
  • Throughput analysis on the Economics tab: how far the batch size and the number of batches can grow with the equipment you have.

For named cases compared side by side, use Scenarios. For fitting model parameters to data and planning the next experiment, see Parameter estimation.

The Studies window

Open it with Tasks ▸ Studies (uncertainty & sensitivity)…, the 🎲 Studies button in the Economics toolbar or on the Economics tab, or the Studies node of the Model tree (each saved study is a leaf under it; click one to open it). While the window is open, the toolbar has a Studies group with + New and ▶ Run. Ctrl+K also finds New study and Run study.

The left half of the window defines the study; the right half shows the results.

Defining a study

  1. Pick a study in the combo, or New study. Delete removes the selected one.
  2. Set the Name, the Sampler, the number of Samples and the Seed.
  3. In Indicators, list the results to collect, separated by commas, for example npv, unit_production_cost, irr, gwp. Short names are batch_time, cycle_time, min_cycle_time, batches_per_year, unit_production_cost, unit_revenue, npv, irr, roi, payback_years, gross_margin, net_profit, total_investment, annual_operating_cost, revenues, main_product_kg_per_year, e_factor, total_waste_kg, gwp and pmi; anything else is read as a results/… path.
  4. Under Uncertain parameters, add each input: type its variable path (for example components/A/price), choose a distribution, enter its parameters and click Add parameter. Use base fills the distribution around the current value (±10 %).
  5. Click ▶ Run study.
DistributionParametersShown as
Uniformmin, maxU(a, b)
Normalmean, sdN(m, sd)
Triangularmin, mode, maxTri(min, mode, max)
Lognormalμ (ln), σ (ln)LogN(μ, σ)
Truncated normalmean, sd, min, maxTN(m, sd; min–max)
SamplerUse it for
Monte CarloPlain random sampling
Latin hypercube (default)Even coverage of every input with fewer samples
SobolLow-discrepancy sequence (up to 64 parameters)
MorrisScreening many inputs cheaply. Samples becomes Trajectories, and Grid levels sets the levels of each input (even, 2–20)

Options:

  • Warm starts: order the samples along a nearest-neighbour chain and start each solve from the previous solution.
  • Tornado (P5/P95): also run each parameter at its 5th and 95th percentile with the others at base.
  • Verify cost-only: check once that parameters classed as cost-only really leave the balances unchanged (see below).

Editing the study does not re-solve the flowsheet. A study runs on a background thread on all cores; the window and the Progress tab of the bottom dock show its progress, and Cancel stops it. When it finishes, the study and its result are stored in the project (one undo step). Save to project stores the definition without running it.

Cost-only parameters

Most uncertainty in a techno-economic study is in prices and cost factors, which do not change the material and energy balances. FlowState classes each parameter automatically (the kind column shows auto: cost only or auto: coupled; you can override it):

  • cost only: component, mixture and stream prices, utility, power and labour rates, the economic parameters (except the cost-index ratio and membrane and filter media costs), LCA settings and the per-procedure cost settings;
  • coupled: everything else, which needs a full simulation.

Samples that change only cost-only parameters re-run the economics, LCA and environmental results on the solved flowsheet, which is typically 10–100 times faster. The result header reports how many full solves, warm starts and cost-only evaluations were made and the speed-up. With Verify cost-only, a parameter that turns out to change the balance is re-solved as coupled, with a note. If design specs are enabled, every sample is a full simulation.

Correlated inputs

Under Correlation (Spearman, optional), enter a rank-correlation matrix with one row per parameter, comma separated (or as JSON, [[1,0.5],[0.5,1]]). Leave it empty for independent inputs. The samples are reordered with the Iman–Conover method, which keeps each input’s distribution. The matrix must be square, symmetric, with ones on the diagonal and positive definite; a matrix that cannot be read is treated as empty. Morris ignores correlations, and with Sobol the reordering keeps the marginals but not the low-discrepancy structure.

Sweep and fan chart

Tick Sweep a variable against every sample and give a variable path, from, to and steps (2–50). Each sample is then evaluated across the sweep, and the Fan chart shows the median with P25–P75 and P5–P95 bands of an indicator against the swept variable. A sweep cannot be combined with Morris.

Reading the results

The header shows the sampler, number of samples and seed, an indicator picker and Export CSV… and Export Excel…. Samples that did not converge are counted. A statistics table gives the base value, mean, standard deviation and the P5, P25, P50, P75 and P95 percentiles. The charts are:

ChartShows
DistributionHistogram with a kernel density line and the P5, P50, P95 and base markers
Spearman tornadoRank correlation of each parameter with the indicator
Tornado P5/P95The indicator with each parameter at its P5 and P95 (if the option was on)
Morris μ*–σMean absolute elementary effect against its spread (Morris only)
Fan chartThe sweep bands (with a sweep only)

The Sensitivity table lists, per parameter, its kind, Spearman ρ with its p-value, Pearson r and the Kolmogorov–Smirnov D statistic and p-value. The CSV export has one row per sample; the Excel export has the sheets Samples, Statistics, Sensitivity, Fan (with a sweep) and Run.

To look at one sample in detail, create a scenario from it: in the Scenarios window, under Create from, pick the study and the sample number and click Create.

From the command line

flowstate-cli study FILE runs the same engine:

flowstate-cli study my.flow --sampler lhs --n 500 --seed 1 \
    --var components/A/price:triangular:8,10,14 \
    --var economics/tax_rate:uniform:0.3,0.5 \
    --metric npv,unit_production_cost --out samples.csv --xlsx study.xlsx

Distributions are uniform, normal, triangular, lognormal (μ, σ of ln x) and truncnormal (mean, sd, min, max). Other options are --sampler mc|lhs|sobol|morris, --levels, --correlation FILE (CSV or JSON), --cost-only PATH and --coupled PATH to override the classification, --sweep path:from:to:steps, --spec STUDY.json, --no-warm-start, --no-tornado, --no-verify and --threads. Results go to --out (samples), --summary-out, --sensitivity-out, --xlsx and --json; --attach (or --save-to FILE, with --name) stores the study in the project. The HTTP API and MCP server offer the simpler sweep and Monte Carlo studies only; see Command line and automation API.

Tornado and scale-up

Open Tasks ▸ Tornado & scale-up…, the 🌪 Tornado toolbar button on the Economics tab or the Tornado & scale-up node of the Model tree.

Tornado (one-at-a-time sensitivity)

  1. Add variables with + variable (a variable path such as components/Glucose/price; matching paths are suggested as you type) or + common prices, which adds the first priced raw materials at ±20 % and the tax rate at ±10 %.
  2. Set the − % and + % change for each (10 % by default).
  3. Click ▶ Run tornado. Each variable is moved down and up with a full re-simulation. Bars show the effect on NPV, or on the unit cost with Show unit cost instead of NPV, sorted by swing, and the table lists the low and high unit cost and NPV.

The tornado variables are saved in the project. Variable paths are the same ones used by flowstate-cli get/set and the automation API.

Throughput scale-up

Enter a target annual output of the main product and click Scale feeds to target. All feeds are scaled and equipment in Design mode re-sizes; the scaling is repeated until the target is met.

Throughput analysis

The Throughput analysis card on the Economics tab shows how well the equipment is used and how far production could grow:

  • Size utilisation: how full each equipment item is;
  • Time utilisation: occupancy divided by the cycle time (and the number of staggered sets);
  • Combined: the product of the two;
  • Batch-size potential: how much larger the batch could be before rating-mode equipment is full (design-mode equipment shows re-sized, because it grows with the batch);
  • Batch-count potential: the maximum batches per year divided by the current number.

The summary line gives the batch-size and batch-count potentials with the limiting procedure, and the annual time utilisation, followed by a suggestion. Adjust throughput scales every feed by the batch-size potential; it is available when a rating-mode item limits the batch. The table lists each procedure with its equipment and marks the cycle-time bottleneck.