 # A model of two tales, one work and the other not, Why?

One model, I calculate steady states. In 4.6.3:

1. In one way, I use steady state file, it works fine and give me desired results.
aa2016_nonlinear_level.mod (4.3 KB) aa2016_nonlinear_level_steadystate.m (2.7 KB)

2. In another way, I feed the steady states to initval block, it does not work and say it can not find steady states (see errors below). It looks weired. What happened?
aa2016_nonlinear_level_ss.mod (4.2 KB)

The above two mod files have the same equilibrium conditions and same parameters value. I calculate the steady states in the same way in the two implementations. One can check aa2016_nonlinear_level_steadystate.m and aa2016_nonlinear_level_ss.mod for how steady states are calculated. I declare extra parameters (with surfix ‘s’ for that variable) to cacluate s.s in aa2016_nonlinear_level_ss.mod.

BWT, Why we need Randomize initial guess?

Randomize initial guess… (What does this mean? Why we need Randomize initial guess?)

Residuals of the static equations:

Equation number 1 : 7.1619 : x
Equation number 2 : 8.1475 : 2
Equation number 3 : -6.0616 : 3
Equation number 4 : -4.327 : 4
Equation number 5 : -90.8664 : Cc
Equation number 6 : -6.1214 : Y
Equation number 7 : 5.1798 : C
Equation number 8 : 7.5495 : Lc
Equation number 9 : -80.5798 : x1
Equation number 10 : -53.3739 : x2
Equation number 11 : 8.3234 : inflstar
Equation number 12 : -6.1966 : 12
Equation number 13 : -53.3694 : dpt
Equation number 14 : 26.3056 : 14
Equation number 15 : 0 : sdf
Equation number 16 : 4.1013 : deltat
Equation number 17 : 12.9514 : g
Equation number 18 : 11738.4097 : mc
Equation number 19 : 0 : 19
Equation number 20 : -3.8593 : 20
Equation number 21 : 0 : 21
Equation number 22 : -2.2825e-07 : 22

Error using print_info (line 32)
Impossible to find the steady state (the sum of square residuals of the static equations is
137812002.5487). 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

You are calling `steady` before you even set your `initval`. That will not work.

Thank you @jpfeifer! I did not realize that! That solve all the problems I have now.