(self, state, action)
return state_derivative
Compute the state time-derivative.

        Parameters
        ----------
        state: ndarray or Tensor
            States.
        action: ndarray or Tensor
            Actions.

        Returns
        -------
        state_derivative: Tensor
            The state derivative according to the dynamics.
Compute the state time-derivative.
Compute the state time - derivative .
def ode(self, state, action):
        """Compute the state time-derivative.

        Parameters
        ----------
        state: ndarray or Tensor
            States.
        action: ndarray or Tensor
            Actions.

        Returns
        -------
        state_derivative: Tensor
            The state derivative according to the dynamics.

        """
        # Physical dynamics
        m = self.pendulum_mass
        M = self.cart_mass
        L = self.length
        b = self.rot_friction
        g = self.gravity

        x, theta, v, omega = tf.split(state, [1, 1, 1, 1], axis=1)

        x_dot = v
        theta_dot = omega

        det = L*(M + m*tf.square(tf.sin(theta)))
        v_dot = (action - m*L*tf.square(omega)*tf.sin(theta) - b*omega*tf.cos(theta) + 0.5*m*g*L*tf.sin(2*theta)) * L/det
        omega_dot = (action*tf.cos(theta) - 0.5*m*L*tf.square(omega)*tf.sin(2*theta) - b*(m + M)*omega/(m*L)
                     + (m + M)*g*tf.sin(theta)) / det

        state_derivative = tf.concat((x_dot, theta_dot, v_dot, omega_dot), axis=1)

        return state_derivative
def ode ( self , state , action ) : # Physical dynamics m = self . pendulum_mass M = self . cart_mass L = self . length b = self . rot_friction g = self . gravity x , theta , v , omega = tf . split ( state , [ 1 , 1 , 1 , 1 ] , axis = 1 ) x_dot = v theta_dot = omega det = L * ( M + m * tf . square ( tf . sin ( theta ) ) ) v_dot = ( action - m * L * tf . square ( omega ) * tf . sin ( theta ) - b * omega * tf . cos ( theta ) + 0.5 * m * g * L * tf . sin ( 2 * theta ) ) * L / det omega_dot = ( action * tf . cos ( theta ) - 0.5 * m * L * tf . square ( omega ) * tf . sin ( 2 * theta ) - b * ( m + M ) * omega / ( m * L ) + ( m + M ) * g * tf . sin ( theta ) ) / det state_derivative = tf . concat ( ( x_dot , theta_dot , v_dot , omega_dot ) , axis = 1 ) return state_derivative