global residual and jacobian
global jacobian