Takes a path for the endogenous variables and returns the residuals of the dynamic equations. This routine is useful for solving the model with the PEA approach.