# Not sure what wrong is with my codes

"出错"means there‘s something wrong.Wish anyone could help me,thx a lot!

STEADY: The Jacobian contains Inf or NaN. The problem arises from:

STEADY: Derivative of Equation 1 with respect to Variable C (initial value of C: 0)
STEADY: Derivative of Equation 2 with respect to Variable C (initial value of C: 0)
STEADY: Derivative of Equation 2 with respect to Variable W (initial value of W: 0)
STEADY: Derivative of Equation 1 with respect to Variable P (initial value of P: 0)
STEADY: Derivative of Equation 2 with respect to Variable P (initial value of P: 0)
STEADY: Derivative of Equation 5 with respect to Variable P (initial value of P: 0)
STEADY: Derivative of Equation 6 with respect to Variable P (initial value of P: 0)
STEADY: Derivative of Equation 6 with respect to Variable P1 (initial value of P1: 0)
STEADY: Derivative of Equation 6 with respect to Variable P2 (initial value of P2: 0)
STEADY: Derivative of Equation 1 with respect to Variable R (initial value of R: 0)
STEADY: Derivative of Equation 5 with respect to Variable M (initial value of M: 0)

STEADY: The problem most often occurs, because a variable with
STEADY: exponent smaller than 1 has been initialized to 0. Taking the derivative
STEADY: and evaluating it at the steady state then results in a division by 0.

An element of the Jacobian is not finite or NaN

[ys,check] = dynare_solve([M.fname 'static’],…

(line 54)

evalin(‘base’,fname) ;

It seems you are having a nonlinear model. In this case, consumption for example cannot be 0. You need to provide explicit initial values for steady state finding in an `initval`-block

my code is in below,and matlab told me:Impossible to find the steady state. Either the model doesn’t have a steady state, there are an infinity of steady states, or the guess values are too far from the solution.
I’m not sure if I set a wrong model or wrong codes.

code:

``````var Y,Y1,Y2,C,I,K,K1,K2,W,A,P,P1,P2,R,M,N1,N2;
varexo e1;
parameters alpha,beta,gamma,phi,delta,chi,rho1,rho2,epsilong,miu;
alpha=0.7;
gamma=0.5;
beta=0.98;
phi=0.45;
delta=0.05;
chi=2.616;
rho1=0.6661;
rho2=0.5;
epsilong=1.25;
miu=0.03;
model;
1/W=(beta*((1-delta)*P(+1)+R(+1)))/(P(+1)*C(+1));
R=alpha*((K1/(A*N1))^(1-alpha));
W=(1-alpha)*A*((K1/(A*N1))^alpha);
C=M/P;
C+I=Y;
P1=epsilong/(epsilong-1);
P2=((1-alpha)/(1-gamma))*(chi^(gamma-1))*(A^(gamma-alpha))*(K1^alpha)*(K2^(-gamma))*(N1^(-alpha))*(N2^gamma);
P^epsilong=rho1*(P1^epsilong)+(1-rho1)*(P2^epsilong);
Y=Y1+Y2;
K=K1+K2;
N1(+1)=N1*(1+miu);
N2(+1)=N2*(1+miu);
Y1=((K1)^alpha)*(A*N1)^(1-alpha);
Y2=((K2)^gamma)*((chi*A*N2)^(1-gamma));
K1(+1)=(1-delta)*K1+I;
K2(+1)=(((1-phi)*(1-alpha))/(1-gamma))*(A^(1-alpha))*(K1^alpha)*(N1^(-alpha))-(1-alpha)*(A^(1-alpha))*N2*(K1^alpha)*(N1^(-alpha));
log(A)=rho2*log(A(-1))+e1;
end;
initval;
Y=0.001;
Y1=0.0007;
Y2=0.0003;
W=0.000001;
M=0.000001;
R=0.000002;
K=0.01;
K1=0.056;
K2=0.044;
P1=0.000000001;
P2=0.0000000008;
P=0.0000000018;
C=0.0003;
I=0.0007;
N1=0.0001;
N2=0.0001;
A=1;
e1=0;
end;
``````N1(+1)=N1*(1+miu);
implies that `N1` has steady state 0. But in the end I am afraid that you need to analytically compute the steady state