function P2_01A clear, clc, format short g, format compact xguess = 0.7 ; disp('Variable values at the initial estimate'); disp([' Unknown value ' num2str(xguess) ' Function Value ' num2str(NLEfun(xguess))]); xsolv=fzero(@NLEfun,xguess); disp(' Variable values at the solution'); disp([' Unknown value ' num2str(xsolv) ' Function Value ' num2str(NLEfun(xsolv))]); %- - - - - - - - - - - - - - - - - - - - - - function fV = NLEfun(V); P = 56; R = .08206; T = 450; Tc = 405.5; Pc = 111.3; Pr = P / Pc; a = 27 * R ^ 2 * Tc ^ 2 / Pc / 64; b = R * Tc / (8 * Pc); Z = P * V / (R * T); fV = (P + a / (V ^ 2)) * (V - b) - (R * T);