  We describe simulations that track a state vector with pressure, temperature,
and gas flow through the helium liquefier in the FREIA laboratory. Most
components, including threeway heat exchangers, are represented by matrices
that allow us to track the state through the system. The only non-linear
element is the Joule-Thomson valve, which is represented by a non-linear map
for the state variables. Realistic properties for the enthalpy and other
thermodynamic quantities are taken into account with the help of the CoolProp
library. The resulting system of equations is rapidly solved by iteration and
shows good agreement with the observed LHe yield with and without liquid
nitrogen pre-cooling.
