Skip to content

Reporting

Helpers that turn engine results into human-readable summaries: stream tables, optimization and economics write-ups, and the formatting used in copilot reports.

report

Human-readable (Markdown) summaries of simulation and design results.

The copilot returns numbers; these helpers turn them into the tables and summaries an engineer expects (a stream table, an optimization summary, an equipment cost breakdown, and a rendered agent transcript) so a language model (or a notebook) can present results cleanly. Everything here is pure Python string formatting over already-computed results; no JAX, no I/O.

Functions:

Name Description
summarize_bubble_point

Return a one-line natural-language summary of a binary bubble point.

stream_table

Render a Markdown stream table: per-stream T, P, total flow, and mole fractions.

summarize_optimization

Summarize an OptimizeResult or FlowsheetOptResult as Markdown.

summarize_economics

Render an equipment cost breakdown and the resulting total annual cost.

summarize_pid_tuning

Render a recommend_pid_tuning result as a Markdown comparison table.

summarize_heat_integration

Render heat-integration targets as a Markdown summary.

summarize_lqr_design

Render an lqr_design result (gain, poles, stability) as Markdown.

summarize_mpc_simulation

Render a simulate_mpc result as a Markdown step-response report.

summarize_transcript

Render an agent run (its tool calls and final answer) as a Markdown report.

summarize_bubble_point

summarize_bubble_point(
    x1: float,
    temperature: float,
    antoine1: Antoine,
    antoine2: Antoine,
    a12: float = 0.0,
    a21: float = 0.0,
) -> str

Return a one-line natural-language summary of a binary bubble point.

stream_table

stream_table(
    streams: Mapping[str, Stream], *, digits: int = 4
) -> str

Render a Markdown stream table: per-stream T, P, total flow, and mole fractions.

Parameters:

Name Type Description Default
streams Mapping[str, Stream]

Named streams (e.g. the output of a flowsheet solve).

required
digits int

Significant digits for the mole fractions.

4

Returns:

Type Description
str

A Markdown table with one column per stream.

summarize_optimization

summarize_optimization(
    result: Any, *, title: str = "Optimization"
) -> str

Summarize an OptimizeResult or FlowsheetOptResult as Markdown.

Reads the common fields by duck typing, so it accepts either the raw optimizer result (fun) or a flowsheet optimization result (objective).

summarize_economics

summarize_economics(
    items: Sequence[EquipmentCost],
    *,
    operating_cost: float = 0.0,
    interest_rate: float = 0.1,
    years: float = 10.0,
) -> str

Render an equipment cost breakdown and the resulting total annual cost.

Parameters:

Name Type Description Default
items Sequence[EquipmentCost]

Costed equipment (from fugacio.sim.bare_module_cost).

required
operating_cost float

Annual operating (utility) cost ($/yr).

0.0
interest_rate float

Annual interest rate for the capital-recovery factor.

0.1
years float

Project life (years).

10.0

Returns:

Type Description
str

A Markdown report: a per-item cost table plus annualized capital, OPEX,

str

and total annual cost.

summarize_pid_tuning

summarize_pid_tuning(
    recommendation: Mapping[str, Any],
) -> str

Render a recommend_pid_tuning result as a Markdown comparison table.

Accepts the dict returned by the recommend_pid_tuning copilot tool (a list of candidate rules with their gains and closed-loop metrics) and renders the comparison plus the recommended rule.

summarize_heat_integration

summarize_heat_integration(
    targets: Mapping[str, Any],
) -> str

Render heat-integration targets as a Markdown summary.

Accepts the dict returned by the heat_integration_targets copilot tool (minimum utilities, pinch, recovery, area/unit/cost targets) and lays it out as a compact engineer-facing report.

summarize_lqr_design

summarize_lqr_design(design: Mapping[str, Any]) -> str

Render an lqr_design result (gain, poles, stability) as Markdown.

Accepts the dict returned by the lqr_design copilot tool.

summarize_mpc_simulation

summarize_mpc_simulation(result: Mapping[str, Any]) -> str

Render a simulate_mpc result as a Markdown step-response report.

Accepts the dict returned by the simulate_mpc copilot tool (per-output step metrics, setpoint, and final value) and lays it out as an engineer-facing table.

summarize_transcript

summarize_transcript(
    result: AgentResult, *, max_chars: int = 200
) -> str

Render an agent run (its tool calls and final answer) as a Markdown report.