Tipping Point modeling via threshold

Since I am completely new to DSGE Modeling and Dynare, this question might seem Strange or misplaced. If so, I am sorry!

I am trying to model a climate tipping point for the NK Model in Economides and Xepapadeas (2018). In the model, TFP depends negatively on the demand for Fossil fuel energy which drives up CO2 emissions and thus global warming Tt - T0 (global temperature in t as compared to preindustrial times). Adjusted TFP Looks like this:

where Es is the global stock of CO2 emission and Psi is the damage elasticity of climate change for GDP.

The tipping point equation would look something like: Pt = Pt-1 + X with X being some constant value. Pt represents additional Carbon emissions released every following period after a threshold is passed, in this context a certain global mean temperature Tt.
Ideally, the model would behave like normal, and only if the temperature in t surpasses a threshold of say Tt > T0 + 1.5° (for example after a large enough shock in TFP driving up energy demand and thus global mean temperature), the tippng point activates and from there on out, the additional emissions affect TFP by being added to the stock of emission Es. Else, Pt = 0.

Is there any feesible way to model such an “if threshold surpassed → activate function” mechanism?

I would be really glad if somebody could help me out!

What exactly is your question? What you describe seems like a proper setup. Essentially, you are defining an indicator function. I presume your question is whether a model with a feature like that can be solved in Dynare. As long as you are fine with a perfect foresight solution, the answer should be yes. But without knowing more details about the model, it is impossible to tell. If the model is forward-looking, things may be tricky due to the terminal steady state potentially not existing.

Thank you so much for the fast reply!

Indeed, perfect foresight is supposed for the model.
What I essentially asked was how to approach such a mechanism, and the indicator function sounds like a good lead. I am going to look into that!

I will come back to you if I have further questions.

Unfortunately, I ran into some other problems:
After setting up the baseline model as in the paper (while ignoring the adjusted TFP component for the moment), I get two error messages when trying to initiate Dynare:

Starting Dynare (version 5.1).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
WARNING: A parameter was used with a lead or a lag in the model block
Substitution of exo lags: added 1 auxiliary variables and equations.
Found 17 equation(s).
Evaluating expressions…done
Computing static model derivatives (order 1).
Computing dynamic model derivatives (order 2).
Processing outputs …
Preprocessing completed.

Error using Economides_Xepapadeas_Replication.driver
File: driver.m Line: 303 Column: 1
Invalid use of operator.

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

I attached the .mod file as well as driver.m.

Any idea what this might be?
Economides_Xepapadeas_Replication.mod (2.5 KB)

driver.m (12.4 KB)

In the first line, the comment needs to be //, not /. Next, assignments like


are not valid.