{% import macros as m with context %} .. _pendulum_game: Week 3: Pendulum with random actions ============================================================================================================= {{ m.embed_game('week3_pendulum') }} .. topic:: Controls :class: margin :kbd:`p` Start the simulation :kbd:`r` Reset the game .. rubric:: Run locally :gitref:`../irlc/lectures/lec03/lecture_03_pendulum_random.py` What you see ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The example show the Pendulum example (see (:cite:t:`herlau`, Subsection 10.4.1)). The control signal, :math:`u(t) = 0`, is selected a random in each step. How it works ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The pendulum is defined as a differential equation given in (:cite:t:`herlau`, Subsection 10.4.1). This differential equation is then simulated using Runga-Kuttas method (RK4) using the random action signal.