This site is aimed at math and physics majors who may have little programming experience, but who want to learn techniques in computational physics. It contains examples pulled from a variety of fields in math, physics and astronomy. The examples are meant to supplement existing tutorials such as the excellent one put together by Spencer and Ware at BYU. It may be downloaded in pdf form from their website here.
Loops and If Statements
Reading Data Files
|A11||Read in data from a text file||load(), textread()|
Download all Programing Basics Examples A00.m–A11.m here.
Download all 2D Plot Examples plot01.m–plot11.m here.
Solving Ordinary Differential Equations (ODEs)
1D First-Order ODEs
1D Second-Order ODEs
2D Second-Order ODEs
Circular, Restricted Three-Body Problem
- Code Download
- Pseudo-Potential & Lagrange Points
- Simulations & Chaos