---
title: "Analyze Monte Carlo"
method: POST
path: "/api/analyze-monte-carlo"
---

# Analyze Monte Carlo

`POST /api/analyze-monte-carlo`

## Request

- Base URL: `https://biotechdsp-579272663320.europe-west1.run.app`
- URL: `https://biotechdsp-579272663320.europe-west1.run.app/api/analyze-monte-carlo`
- Auth: HTTP bearer

Monte Carlo uncertainty analysis of the flowsheet as it stands. Nothing is searched
and nothing is written back: each draw perturbs every uncertain input at once, and
the answer is the distribution of the objective (P10/P50/P90, histogram) with the
inputs ranked by how much of that spread they explain.

## Request body

- MonteCarloBody: Same feed and steps the simulation posted, replayed through a Monte Carlo uncertainty analysis: every model calibration, economic assumption, feed or fermenter titre, the raw-material price level and the capital estimate are sampled JOINTLY (Latin hypercube, rank-correlated) and the distributions of the objective and the headline metrics are reported. n_samples draws (100-5000; about 2-20 ms each depending on the route) seed makes the run reproducible variation relative P10/P90 half-width on every sampled input (0.3 = a lognormal whose P90 is 1.3x and P10 1/1.3x the base) capex_p10 / capex_p90 the AACE class band on the capital estimate; the default 0.70 / 1.50 is the class 4/5 band the estimator prints include_capex, correlate switch the capital factor and the default rank correlations off for a pure-marginals run
  - `annual_operating_hours` integer
  - `capex_p10` number
  - `capex_p90` number
  - `cooling_water_price_usd_per_m3` number
  - `correlate` boolean
  - `electricity_price_usd_per_kWh` number
  - `facility_type` string, nullable
  - `feeds` object
  - `include_capex` boolean
  - `labor_profile` string
  - `n_samples` integer
  - `objective` string
  - `product_identity_requested_targets` string[]
  - `product_identity_warnings` string[]
  - `product_selling_price_source` 'default' | 'user_supplied'
  - `product_selling_price_usd_per_kg` number
  - `recycles` RecycleSpec[]
    - `fraction` number, required
    - `from_step` integer, required
    - `outlet` 'light' | 'heavy'
    - `to_step` integer, required
  - `seed` integer
  - `skip_steps` integer[]
  - `steam_price_usd_per_GJ` number
  - `steps` object[], required
  - `stream` object, required
  - `stream_closure_warnings` string[]
  - `target_products` string[], required
  - `target_provenance` object, nullable
  - `terminal_streams` TerminalStream[], nullable
    - `fraction` number, required
    - `output_index` integer, required
    - `port_id` string, required
    - `sink` 'product' | 'waste' | 'vent', required
    - `step_index` integer, required
    - `target_products` string[]
    - `terminal_id` string, required
  - `variation` number
  - `wastewater_scope` 'included' | 'excluded_osbl'

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/untangle/apis/untangle-bio-engine-api.md) · [All operations](https://skmtc.dev/untangle/apis/untangle-bio-engine-api/llms.txt) · [OpenAPI document](https://skmtc.dev/untangle/apis/untangle-bio-engine-api/revisions/161714bf261c?raw)
