function P2_09A2 clear, clc, format short g, format compact xguess = 0.505 ; 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 = 100; R = .08206; T = 300; nmoles = 2.5 * 1000 / V; Tc = 304.2; Pc = 72.9; a = 27 * R ^ 2 * Tc ^ 2 / (Pc * 64); b = R * Tc / (8 * Pc); fV = (P + a / (V * V)) * (V - b) - (R * T);