Free coding Seminar
Free Coding Seminar - Physics Problems
Today’s seminar will be a free coding session. You’ll have 30 minutes to work on one of the following physics problems. After the coding time, we’ll discuss your approaches, solutions, and any challenges you encountered.
Problem 1: Damped Driven Pendulum (Chaos)
Physics Background: A damped driven pendulum is a classic example of a system that can exhibit chaotic behavior under certain conditions.
Programming Task:
- Implement the equation of motion for a damped driven pendulum: \[\ddot{\theta} + b\dot{\theta} + \omega_0^2\sin\theta = F\cos(\Omega t)\] where \(b\) is the damping coefficient, \(\omega_0^2 = g/L\), \(F\) is the driving amplitude, and \(\Omega\) is the driving frequency.
- Solve this second-order differential equation numerically using
solve_ivp. - Visualize the pendulum’s motion over time for different parameter values.
- Create a phase-space plot (\(\theta\) vs. \(\dot{\theta}\)) to visualize the system’s behavior.