Hello. I have a problem writing inequality in dynare software. Can you help me with the following error?

In an assignment A(I) = B, the number of elements in B and I must be the same.

Error in get_complementarity_conditions (line 66)
ub(k) = str2num(str(kop+1:end));

Error in initialize_stacked_problem (line 53)
[lb,ub,pfm.eq_index] = get_complementarity_conditions(M,options.ramsey_policy);

Error in solve_stacked_problem (line 33)
[options, y0, yT, z, i_cols, i_cols_J1, i_cols_T, i_cols_j, i_cols_1, i_cols_0, i_cols_J0,
dynamicmodel] = …

Error in perfect_foresight_solver_core (line 116)
[oo_.endo_simul, oo_.deterministic_simulation] = …

Error in perfect_foresight_solver (line 63)
oo_ = perfect_foresight_solver_core(M_,options_,oo_);

Error in my_model_def_0005.driver (line 298)
perfect_foresight_solver;

Error in dynare (line 293)
evalin(‘base’,[fname ‘.driver’]) ;

Without the mod-file, it is impossible to tell.

Hello: I attach my code in dynare for your kind attention. please cheack and reply me your comment.
my_model_def_0020.mod (1023 Bytes)

The mcp-tag only allows <, not <=.

thx for your reply. I set “z<1.5” but received the attached error. may you please help me to solve the problem? thx again.

There is no message attached.

The model failed to solve. Does it work without the constraint?

yes, it runs without constraint. i have done without constraint and result is attached. also the model without constraint is attached, please try it.
my_model_def_0020.mod (1004 Bytes)

Are you sure the approach is correct?

[mcp = 'z < 1.50']
gf=z;

states that z is capped at a value of 1.5. But you are claiming that at the end of the simulation, z must be at the steady state value, which is 2.52

Thx for your reply. I expect that the model result in a steady state path with maximum value of z set to 1.5. That is steady state path relevant to z<1.5.

But then you need to set the terminal condition accordingly.

May you please let me know how to do it?

That is the tricky part. At the moment, Dynare cannot compute steady states where the constraint binds, see Implement option to use LMMCP for steady state computation (#1664) · Issues · Dynare / dynare · GitLab
You would need to compute the terminal condition manually.

Thx lot :sunflower: :tulip: :pray: