Final project for ASEN 5010 Spacecraft Attitude Dynamics and Control. Models the use of magnetorquers (torque rods) to control attitude of spacecraft in Earth orbit. Compares two different control laws.
Uses MRPs (modified Rodriguez parameters) for attitude representation. Custom RK4 integrator to account for MRP switching to avoid singularities.
All code included in project report pdf file as well.