Section 8.4 Numerical Modeling with Eulerβs Method
Many differential equations cannot be solved analytically, yet we still need solutions for practical applications. Eulerβs method provides a straightforward numerical approach to approximate solutions by following the tangent line direction step by step.
In this section, weβll model a nonlinear pendulumβa system whose differential equation cannot be solved in closed formβand use Eulerβs method to understand its motion.
Subsection The Problem: The Nonlinear Pendulum
A pendulum consists of a mass attached to a rigid rod or string, free to swing. For large angles, the motion is governed by a nonlinear differential equation. Unlike the simple harmonic motion approximation (\(\sin\theta \approx \theta\)), the true pendulum exhibits complex behavior.
How does the period of oscillation depend on amplitude for large swings?
Subsection Assumptions
-
The pendulum rod is rigid and massless.
-
All mass is concentrated at the bob.
-
There is no friction or air resistance.
-
The pivot point is fixed.
-
Motion is constrained to a vertical plane.
Subsection Building the Model
Let \(\theta(t)\) be the angle from vertical at time \(t\text{.}\) The torque equation gives:
\begin{equation*}
\frac{d^2\theta}{dt^2} + \frac{g}{L}\sin\theta = 0
\end{equation*}
This is a second-order nonlinear differential equation. To apply Eulerβs method, we convert it to a system of first-order equations:
\begin{align*}
\frac{d\theta}{dt} \amp = \omega \\
\frac{d\omega}{dt} \amp = -\frac{g}{L}\sin\theta
\end{align*}
where \(\omega\) is the angular velocity.
Parameters:
-
\(g = 9.8 \text{ m/s}^2\text{:}\) gravitational acceleration
-
\(L\text{:}\) length of pendulum (m)
-
\(\theta_0\text{:}\) initial angle (radians)
-
\(\omega_0\text{:}\) initial angular velocity (radians/s)
Eulerβs Method for Systems:
Starting from initial conditions \((\theta_0, \omega_0)\text{,}\) update using:
\begin{align*}
\theta_{n+1} \amp = \theta_n + h\omega_n \\
\omega_{n+1} \amp = \omega_n - h\frac{g}{L}\sin\theta_n
\end{align*}
where \(h\) is the time step size.
Subsection Numerical Simulation Activity
Objective: Implement Eulerβs method to simulate pendulum motion and investigate how period depends on amplitude.
Implementation:
Use a computational tool (spreadsheet, Python, MATLAB, or provided code template):
-
Set parameters: \(g = 9.8\text{,}\) \(L = 1.0\) (gives period \(\approx 2\) seconds for small angles)
-
Set initial conditions: \(\omega_0 = 0\text{,}\) various \(\theta_0\) values
-
Choose time step: \(h = 0.01\) (or smaller for better accuracy)
-
Implement the update formulas
-
Run simulation for sufficient time to observe several complete oscillations
Part 1: Small Angle Approximation
-
Simulate with \(\theta_0 = 0.1\) radians (\(\approx 5.7Β°\))
-
Plot \(\theta(t)\) and \(\omega(t)\)
-
Measure the period \(T\) (time for one complete oscillation)
-
Compare with the small-angle formula: \(T_0 = 2\pi\sqrt{\frac{L}{g}}\)
Part 2: Large Amplitude Effects
-
Repeat simulations for \(\theta_0 = 0.2, 0.5, 1.0, 1.5, 2.0\) radians
-
For each, measure the period \(T\)
-
Create a table: \(\theta_0\text{,}\) \(T\text{,}\) \(T/T_0\)
-
Plot period versus initial amplitude
Part 3: Phase Space Portrait
-
For several initial amplitudes, plot \(\omega\) versus \(\theta\) (phase portrait)
-
Observe the shape of the trajectoriesβthey should be closed loops for oscillatory motion
-
What happens as \(\theta_0\) approaches \(\pi\) (upside-down position)?
Subsection Physical Pendulum Activity
Optional Experimental Validation:
Materials:
-
Pendulum (string and mass, or rigid rod)
-
Protractor
-
Stopwatch
-
Meter stick
Procedure:
-
Measure the length \(L\) of your pendulum.
-
For various starting angles (5Β°, 15Β°, 30Β°, 45Β°, 60Β°), release from rest and time 10 complete oscillations.
-
Calculate the period: \(T = \text{total time}/10\)
-
Compare experimental periods with your Eulerβs method simulations.
Subsection Analytical Questions
-
How does the step size \(h\) affect the accuracy of Eulerβs method? Test with \(h = 0.1, 0.01, 0.001\text{.}\)
-
For the small-angle approximation (\(\sin\theta \approx \theta\)), the equation becomes \(\frac{d^2\theta}{dt^2} + \frac{g}{L}\theta = 0\text{.}\) Solve this analytically and compare with your numerical solution.
-
Energy should be conserved: \(E = \frac{1}{2}mL^2\omega^2 + mgL(1-\cos\theta)\text{.}\) Calculate \(E\) at each time step in your simulation. How well is energy conserved? Why might it drift?
-
What happens if you start the pendulum with \(\theta_0 = \pi\) (exactly upside down)? Is this a stable or unstable equilibrium?
-
For what initial angle does the period equal \(1.1 T_0\) (10% longer than the small-angle period)?
Subsection Extensions
Modify your code to explore:
-
Damping: Add a term \(-b\omega\) to model air resistance. How does the amplitude decay?
-
Driving force: Add \(F_0\cos(\omega_d t)\) to model a periodically driven pendulum. Can you observe resonance?
-
Chaotic pendulum: For strong driving and damping, the pendulum can exhibit chaotic motion. Explore parameter ranges where chaos occurs.
Subsection Final Report
Submit a comprehensive report (4-5 pages) including:
-
Derivation of the pendulum differential equation from Newtonβs laws or energy principles.
-
Explanation of how the second-order equation is converted to a system of first-order equations.
-
Description of your Eulerβs method implementation (include code snippets or pseudocode).
-
Graphs of \(\theta(t)\) and \(\omega(t)\) for multiple amplitudes.
-
Period versus amplitude data and graph, with comparison to small-angle theory.
-
Phase space portraits showing closed orbits.
-
Energy conservation analysis throughout your simulations.
-
Discussion of numerical accuracy and how step size affects results.
-
If conducted, comparison with experimental pendulum data.
-
Exploration of at least one extension (damping, driving, or chaos).
Eulerβs method, though simple, is a powerful tool for understanding differential equations that resist analytical solution. The nonlinear pendulum demonstrates why numerical methods are essential in applied mathematicsβthe real world often gives us equations we cannot solve exactly, yet we can still extract meaningful predictions through careful numerical approximation. This approach extends to weather prediction, rocket trajectories, circuit simulation, and countless other applications where exact solutions are unattainable.
You have attempted of activities on this page.
