# Dynamic from one steady state to another

Hello everyone, I’m new to this forum and I just wanted to introduce myself. I’m completely new to Dynare and don’t have much experience with MATLAB either, so I apologize in advance if my questions seem basic or if I need some extra help understanding certain concepts. I appreciate any guidance or advice you can offer me as I work on my project.

I am currently working on a general equilibrium model with search frictions that includes two sectors and heterogeneous workers based on Iftikhara and Zaharieva (2019). Initially, I used `vpasolve` to evaluate the two steady states that occur as a result of a shock that permanently increases the labor force. However, I am now interested in understanding how the model’s dynamics develop from one steady state to another.

To accomplish this, I have formulated the equations in Dynare and I am also using an external MATLAB file to provide the steady state. However, I have some questions about how to add the necessary inputs to calculate the model’s dynamics using the deterministic simulation toolbox, specifically using the `perfect_foresight_solver` function (if you think it might be the best approach).

I am attaching the mod file, the external MATLAB file that computes the steady state, and the corresponding function.

Could you help me understand how to use these files to calculate the model’s dynamics?

example.mod (8.0 KB)
solve_SS.m (2.5 KB)
stst_guess.mat (1.9 KB)

You should be able to either directly set the initial and terminal condition in `oo_.endo_simul` directly after calling `perfect_foresight_setup` or use the computed steady states to create an `initval_file`.

Thank you very much for your response.

Since I wrote the post, I have made some modifications and added some elements to the model to simulate perfect foresight. Firstly, I created two exogenous variables (`flow_L flow_H` ) to simulate the increase in the workforce in my model. Additionally, I decided to manually compute the initial and final conditions. I can find the steady-state equilibria; however, when I try to simulate the model, I receive the following message: “Simulation of the perfect foresight model failed! Switching to a homotopy method…” and then “Failed to solve the perfect foresight model.”

What could be causing this issue? I thought that if I could find the steady states, it would be possible to perform the simulation.

I attach the new files.
example.mod (9.8 KB)

1. First of all, you need to use more `periods`. After all, the model needs sufficient time to return back to the terminal steady state.
2. Please try first whether a small perturbation works before you go for huge shocks.

Thank you very much, Johannes. I appreciate the comments you made. I followed your advice and increased the number of periods up to 1000, and I also changed the size of the shock defined by `flow_l` and `flow_H`, increasing the labor force by 1 person in each sector.

However, even though it finds the new steady state, it still shows ‘Failed to solve perfect foresight model.’ Could there be a problem in the model structure that prevents me from simulating the perfect foresight? If that’s the case, what should I analyze to identify the possible issue?

Can you provide the updated version?

Sure, here is the updated file:

example.mod (9.7 KB)

It seems the problem is finding the solution for

``````wL_1
wL_2
wH_1
wH_2
``````

But I have no idea why that is the case.