
Computational Physics
March 24, 2025
C++
1. Mechanics & Motion
Kinematics Equations
- Velocity: v = d / t - Distance divided by time
- Acceleration: a = (v_f - v_i) / t - Change in velocity over time
- Displacement: s = v_i · t + 0.5 · a · t² - Distance traveled with initial velocity and acceleration
- Displacement (Average Velocity): s = 0.5 · (v_i + v_f) · t - Distance using average of initial and final velocities
- Final Velocity: v_f = v_i + a · t - Final velocity after acceleration
Newton’s Laws & Forces
- Gravitational Force: F = G · (m₁ · m₂) / r² - Force between two masses (G = 6.67430e-11)
- Force: F = m · a - Mass times acceleration (Newton’s Second Law)
Momentum
- Momentum: p = m · v - Mass times velocity
2. Energy
- Kinetic Energy: KE = 0.5 · m · v² - Energy due to motion
- Potential Energy: PE = m · g · h - Gravitational potential energy (g = 9.81 m/s²)
- Work Done: W = F · d - Force applied over distance
- Power: P = W / t - Work done per unit time
- Mass-Energy Equivalence: E = m · c² - Einstein’s mass-energy equation (c = 299,792,458 m/s)
3. Waves & Periodic Motion
- Frequency: f = 1 / T - Inverse of period
- Period: T = 1 / f - Time for one complete cycle
4. Geometry
- Area of Circle: A = π · r² - Circle area from radius
5. Vectors
- Vector Addition/Subtraction: Handles parallel, opposite, and perpendicular vectors with direction (N, S, E, W)
- Pythagorean Theorem: R = √(v₁² + v₂²) - Resultant of perpendicular vectors
6. Unit Conversions
Temperature
- Celsius to Kelvin: K = C + 273.15
- Kelvin to Fahrenheit: F = (K - 273.15) · 9/5 + 32
- Fahrenheit to Celsius: C = (F - 32) · 5/9
Length
- Supports: millimeter, centimeter, meter, kilometer, inch, foot, yard, mile
Weight
- Kilogram to Gram: g = kg · 1000
Volume
- Cubic Meter to Cubic Kilometer: km³ = m³ / 1e9
Area
- Square Meter to Square Kilometer: km² = m² / 1e6
Time
- Hour to Minutes: min = h · 60
7. Basic Arithmetic
- Addition, Subtraction, Multiplication, Division