This project began as a personal curiosity project stemming from my interest in astrophysics and my minor in the subject. I wanted to understand, from the math outward, how the planets actually move, not just the conceptual explanations seen in lectures. With my proficiency in MATLAB, I set out to simulate the solar system using real physics instead of pre-built simulation tools. What began as a small side project quickly grew into a deeper learning experience.

The goal was to create a script capable of modeling planetary orbits using actual numerical integration methods. Rather than approximating circular orbits or using animations, I wanted the simulation to be grounded in gravitational equations and differential motion. To do this correctly, I began working with a UC professor to ensure the physics and math behind the model were robust. The project shifted from a casual idea to a real study of orbital mechanics.

Objective:

  • This project began as a personal exploration driven by my interest in astrophysics and my MATLAB experience. It later evolved into a collaborative project with a UC professor to deepen my understanding of orbital mechanics.

Solution:

  • Develop a MATLAB simulation of the solar system using numerical integration methods (Leapfrog, ODE solvers) to accurately model planetary orbits.

Tools/Skills Used:

  • MATLAB, Ordinary Differential Equations, Numerical Methods, Astrophysics Concepts

Approach:

  • Started by modeling a two-body Earth–Sun system, then progressively incorporated additional planets and gravitational interactions to build a full, multi-body orbital simulation.

My Role:

  • Wrote the core code framework and mathematical logic, consulting with my professor to refine the physics model and ensure numerical accuracy and realistic orbital behavior.

Results/Impact:

  • The final simulation provides an accurate, dynamic model of planetary motion and reflects my initiative to push beyond coursework and tie advanced math concepts directly into real astrophysical systems.

I wrote the core structure of the MATLAB code myself, handling the logic, numerics, and plotting functions. Working alongside my professor, I refined the physical assumptions and corrected errors that appeared when modeling multi-body interactions. Together, we made adjustments to maintain stability over longer simulated time spans. The code became steadily more realistic and mathematically accurate.

The final model demonstrated near-accurate orbital paths for the planets, showing how each orbit shifts over time as gravitational influences vary. The visualization allowed the motion of the solar system to be observed dynamically rather than abstractly. Running the simulation made the mathematics behind planetary motion feel tangible. It connected high-level theory directly to something observable and interactive.

MATLAB Gravitational Simulation

To simulate orbital motion, I implemented Newton’s law of gravitation and motion as a system of differential equations. The planets’ positions and velocities needed to be updated continuously, requiring careful selection of numerical integration techniques. I utilized methods like leapfrog integration and MATLAB’s ODE solvers to determine which was stable and accurate over long periods. This step established the mathematical backbone of the model.

I began by modeling a simple two-body system: Earth orbiting the Sun. Once the baseline worked reliably, I expanded the code to include additional planets one by one. Each new body required accounting for additional gravitational interactions and recalibrating initial conditions. Through iterative testing, the simulation began to resemble a functioning model of the solar system.

This project became a meaningful milestone in my growth as an engineer and student of astrophysics. It showed me how deeply mathematical structures are tied to real-world physical behavior, especially in celestial mechanics. It also reaffirmed that learning happens most powerfully through building and experimenting. The simulation stands as something I can return to — a reminder of my curiosity, persistence, and the excitement of turning abstract math into a working system.