ControlPendulum

Pendulum equations/constants: Farama Gymnasium classic_control/pendulum.py. theta=0 is upright, g=10, m=l=1, dt=0.05, torque in [-2,2], speed in [-8,8]. Semi-implicit Euler and the standard positive angle/rate/torque cost.
Imports
import Control; open Control; import Math;
Table of Contents

Types

ControlPendulum

(inductive)
inductive ControlPendulum

Constructors

For each type in this module: inductive types list their declared constructors; opaque types list any local function whose name starts with mk and which returns a value of that type.

ControlPendulum (inductive)

mk

constructor
ControlPendulum

Functions

angle

def angle (s : ControlPendulum) : Float

velocity

def velocity (s : ControlPendulum) : Float

step

def step (s : ControlPendulum) (command : Float) : ControlPendulum

invalid

def invalid (s : ControlPendulum) : Bool

energy_policy

Energy pumping far from upright, PD stabilization near upright. The energy convention is E=rate^2/6 + 5*cos(theta), desired energy=5.
def energy_policy (kp : Float) (kd : Float) (ke : Float) (theta : Float) (rate : Float) : Float

reference

def reference (theta : Float) (rate : Float) : Float

idle

def idle (theta : Float) (rate : Float) : Float

advance

def advance (policy : (theta : Float) → (rate : Float) → Float) (s : ControlPendulum) : ControlPendulum

cost

def cost (policy : (theta : Float) → (rate : Float) → Float) (s : ControlPendulum) : Float

episode

def episode (horizon : Int | horizon ≥ 0 && horizon ≤ 500) (policy : (theta : Float) → (rate : Float) → Float) (initial : ControlPendulum) : Control

training

def training (policy : (theta : Float) → (rate : Float) → Float) : Float

held_out

def held_out (policy : (theta : Float) → (rate : Float) → Float) : Float