function [K11,K12,K13,K22,K23,K33]=ckddfl(alph,bet,gam,delt) % function [K11,K12,K13,K22,K23,K33]=ckddfl(alph,bet,gam,delt) [Cbar Kbar]=ckss(alph,bet,gam,delt); %x0=log([Cbar;Kbar]); x0=[Cbar;Kbar]; [K1,K2,K3]=ckdfl(x0,x0,0,alph,bet,gam,delt); xtil=[x0 x0]+1e-5*eye(2); [K11,K21,K31]=ckdfl(xtil,[x0 x0],[0 0],alph,bet,gam,delt); K11=1e5*(K11-repmat(K1,[1,1,2])); K21=1e5*(K21-repmat(K2,[1,1,2])); K31=1e5*(K31-repmat(K3,[1,2])); K31=reshape(K31,[2,1,2]); [K12,K22,K32]=ckdfl([x0 x0],xtil,[0 0],alph,bet,gam,delt); K12=1e5*(K12-repmat(K1,[1,1,2])); K22=1e5*(K22-repmat(K2,[1,1,2])); K32=1e5*(K32-repmat(K3,[1,2])); K32=reshape(K32,[2,1,2]); [K13,K23,K33]=ckdfl(x0,x0,1e-5,alph,bet,gam,delt); K13=(K13-K1)*1e5; K23=(K23-K2)*1e5; K33=(K33-K3)*1e5;