The Jacobian at the initial values contains Inf or NaN

dear all:
i have a problem when running dynare codes.some questions as follows:

Some of the parameters have no value (cs, g1s, g2s, lamdas) when using steady. If these
parameters are not initialized in a steadystate file or a steady_state_model-block, Dynare may
not be able to solve the model…

Residuals of the static equations:

Equation number 1 : NaN : 1
Equation number 2 : NaN : lamda
Equation number 3 : NaN : 3
Equation number 4 : NaN : k
Equation number 5 : NaN : 5
Equation number 6 : NaN : piwstar
Equation number 7 : NaN : f
Equation number 8 : NaN : 8
Equation number 9 : NaN : 9
Equation number 10 : NaN : g1
Equation number 11 : NaN : g2
Equation number 12 : NaN : 12
Equation number 13 : NaN : mc
Equation number 14 : NaN : 14
Equation number 15 : NaN : 15
Equation number 16 : NaN : 16
Equation number 17 : NaN : em
Equation number 18 : NaN : jp
Equation number 19 : NaN : subsidy
Equation number 20 : NaN : y
Equation number 21 : NaN : 21
Equation number 22 : NaN : l
Equation number 23 : NaN : vp
Equation number 24 : NaN : vw
Equation number 25 : NaN : zeta
Equation number 26 : NaN : A
Equation number 27 : NaN : CHI
Equation number 28 : NaN : EP
Equation number 29 : NaN : PO
Equation number 30 : NaN : GPO
Equation number 31 : NaN : G
Equation number 32 : NaN : ZHONG
Equation number 33 : NaN : TAU

simulation.mod (8.3 KB)

i’m a rookie in dynare.how can i solve it?thanks a lot!

You are using r before it has been defined. See Debugging parameter initializations and steady_state_model-blocks - YouTube

thank you very much,dear professor! i have solved the thorny problem,but another problem arises as well and have no way to start.so could you please help me again?some questions as follows:

DYNARE_SOLVE (solve_algo=2|4): number of blocks = 18
DYNARE_SOLVE (solve_algo=2|4): solving block 17, of size 1
DYNARE_SOLVE (solve_algo=2|4): solving block 16, of size 1
DYNARE_SOLVE (solve_algo=2|4): solving block 15, of size 1
DYNARE_SOLVE (solve_algo=2|4): solving block 14, of size 1
DYNARE_SOLVE (solve_algo=2|4): solving block 13, of size 1
DYNARE_SOLVE (solve_algo=2|4): solving block 12, of size 1
DYNARE_SOLVE (solve_algo=2|4): solving block 11, of size 1
DYNARE_SOLVE (solve_algo=2|4): solving block 10, of size 1
DYNARE_SOLVE (solve_algo=2|4): solving block 9, of size 1
DYNARE_SOLVE (solve_algo=2|4): solving block 8, of size 2
DYNARE_SOLVE (solve_algo=2|4): solving block 7, of size 1
DYNARE_SOLVE (solve_algo=2|4): solving block 6, of size 1
DYNARE_SOLVE (solve_algo=2|4): solving block 5, of size 1
DYNARE_SOLVE (solve_algo=2|4): solving block 4, of size 1
DYNARE_SOLVE (solve_algo=2|4): solving block 3, of size 16

MODEL_DIAGNOSTICS: The steady state cannot be computed

Residuals of the static equations:

Equation number 1 : 0 : 1
Equation number 2 : 0 : lamda
Equation number 3 : 0 : 3
Equation number 4 : 0 : k
Equation number 5 : 0 : 5
Equation number 6 : 0 : piwstar
Equation number 7 : 0.033009 : f
Equation number 8 : 0 : 8
Equation number 9 : 0 : 9
Equation number 10 : 0 : g1
Equation number 11 : 0 : g2
Equation number 12 : 0 : 12
Equation number 13 : NaN : mc
Equation number 14 : 0 : 14
Equation number 15 : 0 : 15
Equation number 16 : NaN : 16
Equation number 17 : -Inf : em
Equation number 18 : 0.0033215 : jp
Equation number 19 : 0.0033215 : subsidy
Equation number 20 : 1.0192 : y
Equation number 21 : 0.020759 : 21
Equation number 22 : 0 : l
Equation number 23 : 0 : vp
Equation number 24 : 0 : vw
Equation number 25 : 1.16 : zeta
Equation number 26 : 0 : A
Equation number 27 : 0 : CHI
Equation number 28 : 0 : EP
Equation number 29 : 0 : PO
Equation number 30 : 0 : GPO
Equation number 31 : 0 : G
Equation number 32 : 0 : ZHONG
Equation number 33 : 0 : TAU

simulation.mod (6.2 KB)

Some processes like

EP=rhoep*EP(-1)+sdep;

imply a 0 steady state. That will not work with divisions like

em=phi*y/EP;

I guess it should be

log(EP)=rhoep*log(EP(-1))+sdep;

to have steady state 1.

wooooo!!! it really works!!! i really appreciate your support!!!
while i still have a minor problem.The outcome shows that consumption steady state is negative.
even MODEL_DIAGNOSTICS shows that No obvious problems with this mod-file were detected,but i feel something wrong with it.how can i improve it?

thanks,professor!

Then there must still be a mistake somewhere.