
difflow is a Python framework for fully differentiable simulation of chemical processes using JAX. It provides exact gradients through unit operations, thermodynamics, flowsheet recycle convergence, and technoeconomic models, enabling gradient-based optimization, sensitivity analysis, and uncertainty quantification.The core package implements reactors (CSTR, PFR, fed-batch), separators (flash, distillation, liquid-liquid extraction), heat exchangers, and thermodynamic models ranging from ideal mixtures to cubic equations of state (Peng-Robinson, SRK). Flowsheets with recycle streams are solved with acceleration methods (Anderson, Wegstein), and gradients are obtained by implicit differentiation of the converged solution. Domain plugins cover bio manufacturing, rare-earth-element solvent extraction, carbon capture, and gas transmission networks.Note: this is alpha research software under active development. Users should independently confirm the equations and physical property models used in any flowsheet they build.
