%ex2_function with PFOA function yout = ex2_function(kd, L0) global P0 yout = ((L0+P0+kd)-(sqrt((L0+P0+kd).^2-(4.*P0.*L0))))/(2.*P0);