Mathematical Modeling for Refinery Simulation

This knowledge hub contains articles covering the mathematical foundations of refinery simulation, including mathematical modeling, optimization, thermodynamics, material and energy balances, numerical methods, and engineering calculations used in the Petroleum Refining Library (PRL). More detailed information is available in our Solutions section.

First published: July 26, 2026

Linear Programming in Petroleum Refining

Linear Programming (LP) is one of the fundamental methods of mathematical optimization used to solve resource allocation problems under linear constraints. This article explains the core concepts of LP, including decision variables, objective functions, constraints, the Simplex Method, LP solvers, industrial applications, and the limitations of linear programming.

Continue reading


First published: August 11, 2026

Linear Programming in AnyLogic with the
ojAlgo Solver

This article explains how to use ojAlgo for linear programming (LP) and mixed-integer linear programming (MILP) in AnyLogic through a lightweight Petroleum Refining Library wrapper. It covers the solver selection, wrapper architecture, a feedstock allocation example, and integration into Java-based AnyLogic models

Continue reading


First published: August 12, 2026

Linear Programming for Refinery Flow Allocation: Practical Modeling Techniques (part 1)

This article explains how to use ojAlgo for linear programming (LP) and mixed-integer linear programming (MILP) in AnyLogic through a lightweight Petroleum Refining Library wrapper. It covers the solver selection, wrapper architecture, a feedstock allocation example, and integration into Java-based AnyLogic models

Continue reading


First published: August 13, 2026

Linear Programming for Refinery Flow Allocation (part 2)

This article presents a practical MILP-based approach to refinery flow allocation, demonstrating how incoming feed flow can be optimally distributed among parallel process lines while considering throughput limits, operating states, unaccepted flow, and allocation priorities. The approach is implemented in the Petroleum Refining Library and dynamically integrates optimization with refinery simulation.

Continue reading


First published: August 14, 2026

Advanced Linear Optimization for Refinery Flow Allocation (part 3)

This article presents advanced refinery flow allocation optimization techniques for distributing incoming feed among multiple process units and production lines. It covers penalty functions, material balances, target loading, operating-mode constraints, unit underloading, and feed blending within LP/MILP models. The article also shows how these optimization models can be dynamically recalculated within a refinery digital twin as operating conditions change.

Continue reading