def inv_map(self, sol: Solution) -> Solution:
        if self.ind_state_idx is None:
            self.ind_state_idx = np.shape(sol.y)[1] - 1

        sol.t = sol.y[:, self.ind_state_idx]
        sol.y = np.delete(sol.y, self.ind_state_idx, axis=1)

        sol.dual_t = sol.dual[:, self.ind_state_idx]
        sol.dual = np.delete(sol.dual, self.ind_state_idx, axis=1)

        return sol
    def map(self, sol: Solution) -> Solution:
        if self.ind_state_idx is None:
            self.ind_state_idx = np.shape(sol.y)[1]

        if len(sol.dual_t) == 0:
            sol.dual_t = np.zeros_like(sol.t)

        sol.y = np.insert(sol.y, self.ind_state_idx, sol.t, axis=1)
        sol.dual = np.insert(sol.dual, self.ind_state_idx, sol.dual_t, axis=1)

        return sol