Cart Pendulum Template for MATLAB - This guide provides an overview of the MATLAB code for simulating the dynamics of a cart-pendulum system using the RDS2020 framework. The primary entry point of the application is main.m, which utilizes various dynamics-related functions through a wrapper. These functions are generated automatically by running derive_equations.m. Important: You must run derive_equations.m before main.m to initialize the required dynamics functions.
Workflow:
- Symbolic Computation:
derive_equations.memploys symbolic computation to create the cart-pendulum’s state-space dynamics. It exports this as MATLAB functions (e.g.,autogen_drift_vector_field.mandautogen_control_vector_field.m). - Controller Design: You can experiment with controller design in
main.m. For certain controller types, a middleware layer may be necessary to customize control functionality.
Note to Students: This code requires additional setup before it can run. You must complete derive_equations.m where you see TODO lines to finalize certain parts of the code.