Perturb starting value of endogenous variable

I am working with a multisector growth model with two trends. I am trying to simulate the effect of an exogenous unanticipated event like a strike in one sector that temporarily reduces labor in that sector. Simply adding a one-period shock to labor in that sector doesn’t work because labor in all sectors will respond contemporaneously to the shock. I thought of making labor predetermined, but then I get the Blanchard-Kahn violation error. I also considered doing a simulation with initval imposing the reduced labor, with endval set at the steady state, as in When I write an initval block that computes initial values given the perturbation, with an endval block that is the steady state, I get the “trends not compatible with balanced growth path” error.

I have attached a .mod file that runs the baseline model (SectorNoStrike.mod), but only with the predetermined_variables line commented out. So it’s not the exercise I want. I used stoch_simul, but I presume the same problem would arise with deterministic simulation. But it shows that the model has balanced growth.

I also attach a .mod file (Sector4Strike.mod) that attempts the second method. In the initval block, one variable (n4u) is set to half its steady state value (computed in the block as n4ux), and two other variables (z4u and z4d) are also perturbed as a result. This gets the “trends not compatible error.” Strangely, that error occurs even if I change “n4u=0.5*n4ux” to “n4u=n4ux” (third line from the end of the initval block), which I thought would just make initval the steady state.

There’s probably something obviously wrong with either of these approaches, but I’m wondering if they can work, or if there’s some other way to do what I’m trying to do.
SectorNoStrike.mod (7.1 KB)
Sector4Strike.mod (9.6 KB)

Sorry, I’ve discovered some mistakes in Sector4Strike.mod. Aside from that, I suspect the problem is applying the method in Solow_SS_transition.mod to a 2-sector growth model with two trends. That model works fine with stochastic simulation starting from the steady state, but perhaps not for this exercise. Instead I will try it with a stationary version of the model without growth, and report back.

Following up, I was able to do a perfect foresight simulation on a stationary version of the model, attached here. The challenge was to solve for the correct initial values of the remaining endogenous variables, given that I have fixed some of them. (This is different from the Solow_SS_transition.mod case, where the initial value of a state variable is set. In that case the controls (consumption, investment, etc.) can be solved for in the usual way.) In the attached, I take a shortcut and compute (or approximate) values of other initial quantities I know to be affected by the perturbation and put those in the initval block. It happens that in this model initial consumption and investment are not affected, so I think these results are approximately correct.

So consider this topic closed, though I would like to come up with a more general and elegant solution for solving for the initval block values in a problem like this.
Sector4Strike_revised.mod (7.4 KB)