diff --git a/doc/manual/source/the-model-file.rst b/doc/manual/source/the-model-file.rst
index 253190d5df2db9765b89a34f9ae88571778614be..bb7000b5e04f003ff1388306fd367f3c0a20bb60 100644
--- a/doc/manual/source/the-model-file.rst
+++ b/doc/manual/source/the-model-file.rst
@@ -4015,6 +4015,23 @@ speed-up on large models.
     ``1+M_.maximum_lag``, and the total number of rows is
     ``M_.maximum_lag+periods+M_.maximum_lead``.
 
+.. matvar:: oo_.initial_steady_state
+
+    If a permanent shock is simulated through the use of both ``initval`` and
+    ``endval`` blocks, this variable contains the initial steady state, as
+    determined by the ``initval`` block (when followed by a ``steady``
+    command). This variable has the same structure as :mvar:`oo_.steady_state`
+    (and this latter variable contains the terminal steady state, if the
+    ``endval`` block is followed by a ``steady`` command).
+
+.. matvar:: oo_.initial_exo_steady_state
+
+    If a permanent shock is simulated through the use of both ``initval`` and
+    ``endval`` blocks, this variable contains the initial steady state of the
+    exogenous variables, as specified in the ``initval`` block. This variable
+    has the same structure as :mvar:`oo_.exo_steady_state` (and this latter
+    variable contains the terminal steady state of the exogenous variables).
+
 .. matvar:: M_.maximum_lag
 
     |br| The maximum number of lags in the model. Note that this value is
diff --git a/matlab/+gui/+perfect_foresight/run.m b/matlab/+gui/+perfect_foresight/run.m
index 03ff8f9476baba9d36e0850cb0128d62c1ea732d..2a817effc17d770c35c7bb45e865e4943c44bb69 100644
--- a/matlab/+gui/+perfect_foresight/run.m
+++ b/matlab/+gui/+perfect_foresight/run.m
@@ -30,7 +30,7 @@ function run(json)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <https://www.gnu.org/licenses/>.
 
-global M_ options_ oo_ ys0_ ex0_
+global M_ options_ oo_
 
 %% Check Inputs
 if nargin ~= 1 || ~ischar(json)
@@ -64,12 +64,12 @@ end
 
 %% ENDVAL instructions
 % initialize exogenous shocks to zero and compute final ss unless there is a permanent shock
-ys0_ = [];
-ex0_ = [];
+oo_.initial_steady_state = [];
+oo_.initial_exo_steady_state = [];
 M_.det_shocks = [];
 if ~isempty(jm.anticipated_permanent_shocks) || ~isempty(jm.endval_endo)
-    ys0_= oo_.steady_state;
-    ex0_ = oo_.exo_steady_state;
+    oo_.initial_steady_state= oo_.steady_state;
+    oo_.initial_exo_steady_state = oo_.exo_steady_state;
     for i = 1:length(jm.endval_endo)
         oo_.steady_state(jm.endval_endo(i).id) = jm.endval_endo(i).value;
     end
@@ -152,10 +152,10 @@ end
 
 % surprise shocks present
 % in case there are unanticipated shocks...
-if isempty(ys0_)
+if isempty(oo_.initial_steady_state)
     yy = oo_.steady_state;
 else
-    yy = ys0_;
+    yy = oo_.initial_steady_state;
 end
 
 if mapkeys(1) ~= 1
diff --git a/matlab/global_initialization.m b/matlab/global_initialization.m
index f76c01d42a8292670393f9b21e1216f783f034e9..3853e28d30b422315083329c6bd7dc424db8334b 100644
--- a/matlab/global_initialization.m
+++ b/matlab/global_initialization.m
@@ -11,7 +11,7 @@ function global_initialization()
 % SPECIAL REQUIREMENTS
 %    none
 
-% Copyright © 2003-2018 Dynare Team
+% Copyright © 2003-2023 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -28,7 +28,7 @@ function global_initialization()
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <https://www.gnu.org/licenses/>.
 
-global oo_ M_ options_ estim_params_ bayestopt_ estimation_info ex0_ ys0_ dataset_ dataset_info
+global oo_ M_ options_ estim_params_ bayestopt_ estimation_info dataset_ dataset_info
 estim_params_ = [];
 bayestopt_ = [];
 dataset_=[];
@@ -86,13 +86,13 @@ estimation_info.joint_parameter = {'index','domain','interval','mean','median','
 
 oo_.exo_simul = [];
 oo_.endo_simul = [];
-ys0_ = [];
-ex0_ = [];
 oo_.dr = [];
 oo_.exo_steady_state = [];
 oo_.exo_det_steady_state = [];
 oo_.exo_det_simul = [];
 oo_.initval_series = dseries();
+oo_.initial_steady_state = [];
+oo_.initial_exo_steady_state = [];
 
 oo_.gui.ran_estimation = false;
 oo_.gui.ran_stoch_simul = false;
diff --git a/matlab/perfect-foresight-models/make_ex_.m b/matlab/perfect-foresight-models/make_ex_.m
index 8533805d68f4269531b3cb1f0e0e24ff78bdd2fe..3234afbeca94783354aa58564584a122e634826e 100644
--- a/matlab/perfect-foresight-models/make_ex_.m
+++ b/matlab/perfect-foresight-models/make_ex_.m
@@ -10,7 +10,7 @@ function oo_ = make_ex_(M_, options_, oo_)
 % OUTPUTS
 % - oo_          [struct]   Updated dynare results structure
 
-% Copyright © 1996-2021 Dynare Team
+% Copyright © 1996-2023 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -27,8 +27,6 @@ function oo_ = make_ex_(M_, options_, oo_)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <https://www.gnu.org/licenses/>.
 
-global ex0_
-
 if isempty(oo_.exo_steady_state)
     oo_.exo_steady_state = zeros(M_.exo_nbr,1);
 end
@@ -39,13 +37,13 @@ end
 % Initialize oo_.exo_simul
 if isempty(oo_.initval_series)
     if isempty(M_.exo_histval)
-        if isempty(ex0_)
+        if isempty(oo_.initial_exo_steady_state)
             oo_.exo_simul = repmat(oo_.exo_steady_state',M_.maximum_lag+options_.periods+M_.maximum_lead,1);
         else
-            oo_.exo_simul = [ repmat(ex0_',M_.maximum_lag,1) ; repmat(oo_.exo_steady_state',options_.periods+M_.maximum_lead,1) ];
+            oo_.exo_simul = [ repmat(oo_.initial_exo_steady_state',M_.maximum_lag,1) ; repmat(oo_.exo_steady_state',options_.periods+M_.maximum_lead,1) ];
         end
     else
-        if isempty(ex0_)
+        if isempty(oo_.initial_exo_steady_state)
             oo_.exo_simul = [M_.exo_histval'; repmat(oo_.exo_steady_state',options_.periods+M_.maximum_lead,1)];
         else
             error('histval and endval cannot be used simultaneously')
@@ -92,10 +90,10 @@ if isfield(M_, 'det_shocks')
                 case 'multiply_steady_state'
                     oo_.exo_simul(k,ivar) = oo_.exo_steady_state(ivar) * v;
                 case 'multiply_initial_steady_state'
-                    if isempty(ex0_)
+                    if isempty(oo_.initial_exo_steady_state)
                         error('Option relative_to_initval of mshocks block cannot be used without an endval block')
                     end
-                    oo_.exo_simul(k,ivar) = ex0_(ivar) * v;
+                    oo_.exo_simul(k,ivar) = oo_.initial_exo_steady_state(ivar) * v;
             end
         else
             switch M_.det_shocks(i).type
diff --git a/matlab/perfect-foresight-models/make_y_.m b/matlab/perfect-foresight-models/make_y_.m
index 07af24ce3b97f1a3328dfbf5ce88216a707438b5..c421421032d8bf6cc6c583a41b3f0a853db71b13 100644
--- a/matlab/perfect-foresight-models/make_y_.m
+++ b/matlab/perfect-foresight-models/make_y_.m
@@ -10,7 +10,7 @@ function oo_=make_y_(M_, options_, oo_)
 % OUTPUTS
 % - oo_         [struct]   Updated dynare results structure
 
-% Copyright © 1996-2020 Dynare Team
+% Copyright © 1996-2023 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -27,21 +27,19 @@ function oo_=make_y_(M_, options_, oo_)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <https://www.gnu.org/licenses/>.
 
-global ys0_
-
 if isempty(oo_.steady_state)
     oo_.steady_state = zeros(M_.endo_nbr,1);
 end
 
 if isempty(oo_.initval_series)
     if isempty(M_.endo_histval)
-        if isempty(ys0_)
+        if isempty(oo_.initial_steady_state)
             oo_.endo_simul = repmat(oo_.steady_state, 1, M_.maximum_lag+options_.periods+M_.maximum_lead);
         else
-            oo_.endo_simul = [repmat(ys0_, 1, M_.maximum_lag) repmat(oo_.steady_state, 1,options_.periods+M_.maximum_lead)];
+            oo_.endo_simul = [repmat(oo_.initial_steady_state, 1, M_.maximum_lag) repmat(oo_.steady_state, 1,options_.periods+M_.maximum_lead)];
         end
     else
-        if ~isempty(ys0_)
+        if ~isempty(oo_.initial_steady_state)
             error('histval and endval cannot be used simultaneously')
         end
         % the first NaNs take care of the case where there are lags > 1 on
@@ -54,7 +52,7 @@ else
     oo_.endo_simul = y(M_.orig_maximum_lag - M_.maximum_lag + 1:M_.orig_maximum_lag + options_.periods + ...
                        M_.maximum_lead, :)';
     if ~isempty(M_.endo_histval)
-        if ~isempty(ys0_)
+        if ~isempty(oo_.initial_steady_state)
             error('histval and endval cannot be used simultaneously')
         end
         oo_.endo_simul(:,1:M_.maximum_lag) ...
diff --git a/matlab/perfect-foresight-models/perfect_foresight_solver.m b/matlab/perfect-foresight-models/perfect_foresight_solver.m
index a7fa866c53f02ad7541fb0858f17ae190b51fd1c..5179c6922303345017225c9276c9be1c6d06159d 100644
--- a/matlab/perfect-foresight-models/perfect_foresight_solver.m
+++ b/matlab/perfect-foresight-models/perfect_foresight_solver.m
@@ -31,7 +31,7 @@ function perfect_foresight_solver(no_error_if_learnt_in_is_present)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <https://www.gnu.org/licenses/>.
 
-global M_ options_ oo_ ys0_ ex0_
+global M_ options_ oo_
 
 check_input_arguments(options_, M_, oo_);
 
@@ -103,13 +103,13 @@ lastperiods = M_.maximum_lag+periods+(1:M_.maximum_lead);
 
 % Create base scenario for homotopy, which corresponds to the initial steady
 % state (i.e. a known solution to the perfect foresight problem, assuming that
-% oo_.steady_state/ys0_ effectively contains a steady state)
-if isempty(ys0_)
+% oo_.steady_state/oo_.initial_steady_state effectively contains a steady state)
+if isempty(oo_.initial_steady_state)
     endobase = repmat(oo_.steady_state, 1,M_.maximum_lag+periods+M_.maximum_lead);
     exobase = repmat(oo_.exo_steady_state',M_.maximum_lag+periods+M_.maximum_lead,1);
 else
-    endobase = repmat(ys0_, 1, M_.maximum_lag+periods+M_.maximum_lead);
-    exobase = repmat(ex0_', M_.maximum_lag+periods+M_.maximum_lead, 1);
+    endobase = repmat(oo_.initial_steady_state, 1, M_.maximum_lag+periods+M_.maximum_lead);
+    exobase = repmat(oo_.initial_exo_steady_state', M_.maximum_lag+periods+M_.maximum_lead, 1);
 end
 
 % Determine whether to recompute the final steady state (either because
@@ -117,7 +117,7 @@ end
 % terminal condition is a steady state)
 if options_.simul.endval_steady
     recompute_final_steady_state = true;
-elseif ~isempty(ys0_)
+elseif ~isempty(oo_.initial_steady_state)
     recompute_final_steady_state = true;
     for j = lastperiods
         endval_resid = evaluate_static_model(oo_.endo_simul(:,j), oo_.exo_simul(j,:)', M_.params, M_, options_);
@@ -398,7 +398,7 @@ function [steady_success, endo_simul, exo_simul, steady_state, exo_steady_state]
 %   steady_state     [vector]    steady state of endogenous corresponding to the scenario (equal to the input if terminal steady state not recomputed)
 %   exo_steady_state [vector]    steady state of exogenous corresponding to the scenario (equal to the input if terminal steady state not recomputed)
 
-global M_ options_ oo_ ys0_
+global M_ options_ oo_
 
 % Compute convex combination for the path of exogenous
 exo_simul = exoorig*share + exobase*(1-share);
@@ -432,10 +432,10 @@ if recompute_final_steady_state
         [endo_simul(:, j), ~, info] = evaluate_steady_state(endo_simul(:, j), exo_simul(j, :)', M_, options_, true);
         if info(1)
             % If this fails, then try again using the initial steady state as guess value
-            if isempty(ys0_)
+            if isempty(oo_.initial_steady_state)
                 guess_value = oo_.steady_state;
             else
-                guess_value = ys0_;
+                guess_value = oo_.initial_steady_state;
             end
             [endo_simul(:, j), ~, info] = evaluate_steady_state(guess_value, exo_simul(j, :)', M_, options_, true);
             if info(1)
diff --git a/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_setup.m b/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_setup.m
index 3c5465bdd47712e5b7beac8f5a5af5438f54b32c..86752ec1cc0ab7e5223c04641a5a99941e25d8de 100644
--- a/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_setup.m
+++ b/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_setup.m
@@ -17,7 +17,7 @@ function perfect_foresight_with_expectation_errors_setup
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <https://www.gnu.org/licenses/>.
 
-global M_ oo_ options_ ys0_ ex0_
+global M_ oo_ options_
 
 if ~isempty(M_.endo_histval)
     error('perfect_foresight_with_expectation_errors_setup: cannot be used in conjunction with histval')
@@ -33,7 +33,7 @@ oo_.pfwee.terminal_info = NaN(M_.exo_nbr, periods); % 2nd dimension is informati
 oo_.pfwee.shocks_info = NaN(M_.exo_nbr, periods, periods); % 2nd dimension is real time, 3rd dimension is informational time
 
 if exist(options_.datafile, 'file')
-    if ~isempty(M_.det_shocks) || ~isempty(M_.learnt_shocks) || ~isempty(ys0_) || ~isempty(M_.learnt_endval)
+    if ~isempty(M_.det_shocks) || ~isempty(M_.learnt_shocks) || ~isempty(oo_.initial_steady_state) || ~isempty(M_.learnt_endval)
         warning('perfect_foresight_with_expectation_errors_setup: since you passed the datafile option, the contents of shocks and endval blocks will be ignored')
     end
     %% Read CSV file
@@ -81,10 +81,10 @@ else
                 case 'multiply_steady_state'
                     oo_.pfwee.shocks_info(exo_id, prds, 1) = oo_.exo_steady_state(exo_id) * v;
                 case 'multiply_initial_steady_state'
-                    if isempty(ex0_)
+                    if isempty(oo_.initial_exo_steady_state)
                         error('Option relative_to_initval of mshocks block cannot be used without an endval block')
                     end
-                    oo_.pfwee.shocks_info(exo_id, prds, 1) = ex0_(exo_id) * v;
+                    oo_.pfwee.shocks_info(exo_id, prds, 1) = oo_.initial_exo_steady_state(exo_id) * v;
             end
         end
     end
@@ -135,13 +135,13 @@ else
 end
 
 % Build initial paths for endos and exos (only initial conditions are set, the rest is NaN)
-if isempty(ys0_)
+if isempty(oo_.initial_steady_state)
     oo_.endo_simul = repmat(oo_.steady_state, 1, M_.maximum_lag+periods+M_.maximum_lead);
 else
-    oo_.endo_simul = [repmat(ys0_, 1, M_.maximum_lag) repmat(oo_.steady_state, 1, periods+M_.maximum_lead)];
+    oo_.endo_simul = [repmat(oo_.initial_steady_state, 1, M_.maximum_lag) repmat(oo_.steady_state, 1, periods+M_.maximum_lead)];
 end
-if isempty(ex0_)
+if isempty(oo_.initial_exo_steady_state)
     oo_.exo_simul = repmat(oo_.exo_steady_state', M_.maximum_lag+periods+M_.maximum_lead, 1);
 else
-    oo_.exo_simul = [repmat(ex0_', M_.maximum_lag, 1); repmat(oo_.exo_steady_state', periods+M_.maximum_lead, 1)];
+    oo_.exo_simul = [repmat(oo_.initial_exo_steady_state', M_.maximum_lag, 1); repmat(oo_.exo_steady_state', periods+M_.maximum_lead, 1)];
 end
diff --git a/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_solver.m b/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_solver.m
index dad8e57a790d7069ce4699ccda3ccf74a385a35e..14ea5a48c587f45b961f5348544f927c74f5ea26 100644
--- a/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_solver.m
+++ b/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_solver.m
@@ -17,7 +17,7 @@ function perfect_foresight_with_expectation_errors_solver
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <https://www.gnu.org/licenses/>.
 
-global M_ oo_ options_ ys0_
+global M_ oo_ options_
 
 % Same for periods (it will be modified before calling perfect_foresight_solver if constants_simulation_length option is false)
 periods = options_.periods;
diff --git a/matlab/steady.m b/matlab/steady.m
index 106f4c201f01ece8e9e1c3f6e810ea36a1ea71a6..7153e1b6c1e8269c499049923239e1918dcff791 100644
--- a/matlab/steady.m
+++ b/matlab/steady.m
@@ -28,7 +28,7 @@ function steady()
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <https://www.gnu.org/licenses/>.
 
-global M_ oo_ options_ ex0_
+global M_ oo_ options_
 
 test_for_deep_parameters_calibration(M_);
 
@@ -64,12 +64,12 @@ if options_.homotopy_mode ~= 0
 
     % If the “from_initval_to_endval” option was passed to the “homotopy_setup” block, add the relevant homotopy information
     if options_.homotopy_from_initval_to_endval
-        if isempty(ex0_)
+        if isempty(oo_.initial_exo_steady_state)
             error('HOMOTOPY_SETUP: the from_initval_to_endval option cannot be used without an endval block')
         end
         for i = 1:M_.exo_nbr
             if ~any(hv(:,1)==1 & hv(:,2)==i) % Do not overwrite information manually specified by the user
-                hv = vertcat(hv, [ 1 i ex0_(i) oo_.exo_steady_state(i)]);
+                hv = vertcat(hv, [ 1 i oo_.initial_exo_steady_state(i) oo_.exo_steady_state(i)]);
             end
         end
     end
diff --git a/preprocessor b/preprocessor
index 6235e6907526d468e2c35f14c38db1e308698bc9..9b50a8a159b7f0904809a726a55fcd1ad0e4acfb 160000
--- a/preprocessor
+++ b/preprocessor
@@ -1 +1 @@
-Subproject commit 6235e6907526d468e2c35f14c38db1e308698bc9
+Subproject commit 9b50a8a159b7f0904809a726a55fcd1ad0e4acfb