def predict(self, u=0):
        """ Predict next position.

        Parameters
        ----------

        u : ndarray
            Optional control vector. If non-zero, it is multiplied by B
            to create the control input into the system.
        """

        # x = Fx + Bu

        A = dot3(self._F_inv.T, self._P_inv, self._F_inv)
        try:
            AI = inv(A)
            invertable = True
            if self._no_information:
                try:
                    self._x = dot(inv(self._P_inv), self._x)
                except:
                    self._x = dot(0, self._x)
                self._no_information = False
        except:
            invertable = False
            self._no_information  = True

        if invertable:
            self._x = dot(self._F, self.x) + dot(self._B, u)
            self._P_inv = inv(AI + self._Q)
        else:
            I_PF = self._I - dot(self._P_inv,self._F_inv)
            FTI = inv(self._F.T)
            FTIX = dot(FTI, self._x)
            print('Q=', self._Q)
            print('A=', A)
            AQI = inv(A + self._Q)
            self._x = dot(FTI, dot3(I_PF, AQI, FTIX))
dataset/ETHPy150Open rlabbe/filterpy/filterpy/kalman/information_filter.py/InformationFilter.predict/original