Skip to content

fugacio.sim

The differentiable process-simulation layer (depends on fugacio.thermo): streams, energy-balanced unit operations, a recycle/tear solver, columns, reactors, optimization, economics, and the time-domain dynamics, control, and heat-integration toolkits. Import the public surface from the package root:

from fugacio.sim import Stream, flash_drum, tear_solve, linear_mpc, pinch_analysis

Differentiable process-simulation layer for Fugacio (depends on fugacio.thermo).

The layer provides:

  • Stream: the differentiable material stream passed between units;
  • a stream property bridge (enthalpy_flow, entropy_flow, molar_enthalpy, molar_entropy, mass_flow) that gives any stream a two-phase-aware enthalpy/entropy via fugacio.thermo;
  • unit operations with rigorous material and energy balances (flash_drum, heater, valve, pump, compressor, turbine, mix, splitter, component_separator);
  • a thermodynamic-model bridge (eos_model_for, nrtl_model_for, uniquac_model_for, unifac_model_for) that turns component names into a ready EOS or gamma-phi EquilibriumModel;
  • non-ideal separation units (flash_vle, decanter, three_phase_flash) and binary diagram / azeotrope / residue-curve helpers (pxy_diagram, txy_diagram, azeotrope_pressure, azeotrope_temperature, residue_curve, residue_curve_map);
  • reactor unit operations (equilibrium_reactor, stoichiometric_reactor, cstr, pfr, batch_reactor) and reactive separations (reactive_flash, reactive_distillation);
  • a differentiable optimization toolkit (minimize, argmin, least_squares) that differentiates through the optimum by the implicit function theorem;
  • design specifications and set-point controllers (meet_spec, solve_design, controller) that adjust a degree of freedom to hit a target, plus end-to-end flowsheet optimization (optimize_flowsheet);
  • equipment sizing, Turton bare-module costing, utility pricing, and financial metrics (heat_exchanger_area, bare_module_cost, utility_cost, total_annual_cost, npv) for money-valued design objectives;
  • differentiable heat integration / pinch analysis (pinch_analysis, composite_curves, grand_composite_curve, area_target, optimal_dt_min, synthesize_network) for minimum-utility targets and heat-exchanger-network synthesis (see fugacio.sim.integration);
  • advanced process control: model predictive control and state estimation (linear_mpc, nonlinear_mpc, solve_qp, dare, lqr, kalman_gain, KalmanFilter, ExtendedKalmanFilter, UnscentedKalmanFilter, moving_horizon_estimate, simulate_closed_loop, tune_mpc), differentiable end to end, so the controller weights are tunable by gradient descent (see fugacio.sim.mpc);
  • physical steam/cooling-water utilities on IAPWS-95 steam tables (steam_heating, cooling_water, steam_turbine, condensate_flash_fraction) for utility balances with real latent heats, differentiable end to end;
  • the original lightweight modified-Raoult helpers (bubble_pressure, antoine_psat).

Where to look next

Area Page Key symbols
Streams & properties Streams & properties Stream, enthalpy_flow, molar_enthalpy, liquid_density
Unit operations Unit operations flash_drum, heater, pump, compressor, mix, splitter, flash_vle
Flowsheet & recycle Flowsheet & recycle Flowsheet, tear_solve
Thermodynamic models Thermodynamic models eos_model_for, nrtl_model_for, uniquac_model_for, unifac_model_for
Distillation & diagrams Distillation & diagrams shortcut_column, solve_column, pxy_diagram, residue_curve_map
Reactors Reactors & reactive separations equilibrium_reactor, cstr, pfr, reactive_flash, reactive_distillation
Optimization & design Optimization & design minimize, argmin, meet_spec, optimize_flowsheet
Economics & sizing Economics & sizing heat_exchanger_area, bare_module_cost, total_annual_cost, npv
Dynamics & control Dynamics & control odeint, integrate, PID, DynamicFlowsheet, tune_pid
Advanced control (MPC) Advanced control (MPC) linear_mpc, nonlinear_mpc, solve_qp, KalmanFilter, tune_mpc
Heat integration Heat integration pinch_analysis, composite_curves, optimal_dt_min, synthesize_network
Steam & cooling utilities Steam & cooling utilities steam_heating, cooling_water, steam_turbine

See the optimization & economics guide, the dynamics & control guide, the advanced-control guide, and the heat-integration guide for worked examples.