function U=U_given_TVN(x)
% Calculates internal energy from given temperature, volume and
% mole number. Input x = [T;V;N]
A = co2_sw(x);
U = [-x(1);x(2:3)]'*A.g;