function [A,b] = steamSystem(p,T,h) % steamSystem System of equations to obtain an interpolant of the steam table % The interpolant is of the form % % h = c_1 + c_2 * p + c_3 * T + c_4 * p * T % % where h is the enthalpy, p is the pressure, and T is the % temperature % % Synopsis: [A,b] = steamSystem(p,t,h) % % Input: p,T,h = vectors containing known pressure, temperature and % enthalpy values. The p, T and h vectors can be % row or column vectors so long as they all have the % same number of elements % % Output: A, b = matrix and right hand side vector that define the system % of equations for the interpolant as A*c = h where c is % the four-element column vector of coefficients for the % interpolant. A = [ones(size(p(:))) p(:) T(:) p(:).*T(:)]; b = h(:);