<0, Print[LifePosn]; Print["OmegaInvt"]; OmegaInvtArgumentList = AddOutcome[OmegaInvtArgArray,Table[LifePosn,{Length[OmegaInvtArgArray]}]]; OmegaInvtRawResults = Map[Apply[OmegaInvtRaw,#] &,OmegaInvtArgumentList]; OmegaInvtInterpData[[LifePosn]] = AddOutcome[OmegaInvtArgArray,OmegaInvtRawResults]; OmegaInvtInterpFunc[[LifePosn]] = Interpolation[OmegaInvtInterpData[[LifePosn]],InterpolationOrder->1]; Print["OmegasInvt"]; OmegasInvtArgumentList = AddOutcome[OmegasInvtArgArray,Table[LifePosn,{Length[OmegasInvtArgArray]}]]; OmegasInvtRawResults = Map[Apply[OmegasInvtRaw,#] &,OmegasInvtArgumentList]; OmegasInvtInterpData[[LifePosn]] = AddOutcome[OmegasInvtArgArray,OmegasInvtRawResults]; OmegasInvtInterpFunc[[LifePosn]] = Interpolation[OmegasInvtInterpData[[LifePosn]],InterpolationOrder->1]; Print["OmegahInvt"]; OmegahInvtArgumentList = AddOutcome[OmegahInvtArgArray,Table[LifePosn,{Length[OmegahInvtArgArray]}]]; OmegahInvtRawResults = Map[Apply[OmegahInvtRaw,#] &,OmegahInvtArgumentList]; OmegahInvtInterpData[[LifePosn]] = AddOutcome[OmegahInvtArgArray,OmegahInvtRawResults]; OmegahInvtInterpFunc[[LifePosn]] = Interpolation[OmegahInvtInterpData[[LifePosn]],InterpolationOrder->1]; (* Now find the point at which the liquidity constraint begins to bind for the central value of h *) Print["BindingPoints"]; If[LifePosn < LifeLength, hCenter=hGrid[[Round[Length[hGrid]/2]+1]]; hList = {hMin,hCenter,hMax}; BindingPoints = Table[ (x /. FindRoot[ x==(hList[[LoopOverhVals]]^(gamma-rho gamma)) beta * (Omegast[0,hList[[LoopOverhVals]]-lambda(x-hList[[LoopOverhVals]]),LifePosn] - (lambda/(1-lambda))Omegaht[0,hList[[LoopOverhVals]],LifePosn])^(-1/rho) ,{x,{.01,1}}]) ,{LoopOverhVals,Length[hList]}]; xGrid = Union[BindingPoints,xGridBaseline]; (* Add the point to the gridpoints *) MakeArgArrays[xFunctions]; (* Reconstruct the ArgArrays *) ]; ctArgumentList = AddOutcome[ctArgArray,Table[LifePosn,{Length[ctArgArray]}]]; ctRawResults = Map[Apply[ctRaw,#] &,ctArgumentList]; ctInterpData[[LifePosn]] = AddOutcome[ctArgArray,ctRawResults]; ctInterpFunc[[LifePosn]] = Interpolation[ctInterpData[[LifePosn]],InterpolationOrder->1]; VInvtArgumentList = AddOutcome[VInvtArgArray,Table[LifePosn,{Length[VInvtArgArray]}]]; VInvtRawResults = Map[Apply[VInvtRaw,#] &,VInvtArgumentList]; VInvtInterpData[[LifePosn]] = AddOutcome[VInvtArgArray,VInvtRawResults]; VInvtInterpFunc[[LifePosn]] = Interpolation[VInvtInterpData[[LifePosn]],InterpolationOrder->1]; VxInvtArgumentList = AddOutcome[VxInvtArgArray,Table[LifePosn,{Length[VxInvtArgArray]}]]; VxInvtRawResults = Map[Apply[VxInvtRaw,#] &,VxInvtArgumentList]; VxInvtInterpData[[LifePosn]] = AddOutcome[VxInvtArgArray,VxInvtRawResults]; VxInvtInterpFunc[[LifePosn]] = Interpolation[VxInvtInterpData[[LifePosn]],InterpolationOrder->1]; VhInvtArgumentList = AddOutcome[VhInvtArgArray,Table[LifePosn,{Length[VhInvtArgArray]}]]; VhInvtRawResults = Map[Apply[VhInvtRaw,#] &,VhInvtArgumentList]; VhInvtInterpData[[LifePosn]] = AddOutcome[VhInvtArgArray,VhInvtRawResults]; VhInvtInterpFunc[[LifePosn]] = Interpolation[VhInvtInterpData[[LifePosn]],InterpolationOrder->1]; LifePosn--; ] (* End While *) LifePosn++; PlotVxtVSVxtRaw = Plot[ {VxtRaw[xt,.25,LifePosn] ,Vxt[xt,.25,LifePosn]} ,{xt,1,12} ,PlotStyle->{Dashing[{}],Dashing[{.01}]} ,ImageSize->{72 6.,72 6./GoldenRatio} ,PlotLabel->"Interpolated VS Calculated Vxt" ,AxesLabel->{"xt","Vxt[xt,.25]"} ]; Display[ParentDirectoryString<>"PlotVxtVSVxtRaw.EPS",PlotVxtVSVxtRaw,"EPS"]; Plot3DcOfxandh = Plot3D[ ct[x,h,LifePosn] ,{x,xMin,xMax} ,{h,.25,1.75} ,ImageSize->{72 6.,72 6./GoldenRatio} ,PlotLabel->"Consumption Function in First Period" ,AxesLabel->{"xt","htm1","ct[xt,htm1]"} ]; Display[ParentDirectoryString<>"Plot3DcOfxandh.EPS",Plot3DcOfxandh,"EPS"];