Debian Codegraph @

tests/deterministic_simulations/initialization.mod

raw
1 %% CODE TO SIMULATE LOGISTIC MAP
2 %% DECLARATION OF ENDOGENOUS VARIABLES
3 var x;
4 parameters r s;
5
6 r=3.8;
7 s=0;
8
9 model;
10 x = r*x(-1)*(1 - x(-1)) + s*x(+1);
11 end;
12
13 initval;
14 x = 0;
15 end;
16
17 check;
18
19 %% DETERMINISTIC SIMULATION
20 perfect_foresight_setup(periods = 40);
21 perfect_foresight_solver(stack_solve_algo=0, maxit=100);
22
23 if ~oo_.deterministic_simulation.status
24 error('Perfect foresight simulation failed')
25 end
26
27 dsample 40;
28 rplot x;