Finding Iterative Solutions to Non-Linear Equations

  • Context: MHB 
  • Thread starter Thread starter topsquark
  • Start date Start date
Click For Summary
SUMMARY

This discussion focuses on finding iterative solutions to non-linear differential equations, specifically the equations \(\ddot{\theta} = A \cos(\theta)\) and \(\dot{\theta}^2 = B(\sin(\theta) - \sin(\theta_0))\). The iterative methods discussed include Euler's method and the Runge-Kutta method, with a preference for Runge-Kutta due to its stability and accuracy. The conversation also touches on the application of Taylor series for deriving solutions and the challenges faced in solving the double pendulum problem. Ultimately, the user Dan successfully derived a Taylor series solution but decided to abandon the project due to its complexity.

PREREQUISITES
  • Understanding of ordinary differential equations (ODEs)
  • Familiarity with numerical methods, specifically Euler's method and Runge-Kutta method
  • Knowledge of Taylor series expansions
  • Basic concepts of harmonic oscillators and non-linear dynamics
NEXT STEPS
  • Study the Runge-Kutta method in detail, including its derivation and applications
  • Explore Taylor series expansions and their use in solving differential equations
  • Investigate the dynamics of the double pendulum and its equations of motion
  • Learn about Fourier transforms and their application in analyzing oscillatory systems
USEFUL FOR

Physicists, mathematicians, and engineers interested in solving non-linear differential equations, particularly those working on dynamic systems and numerical analysis.

topsquark
Science Advisor
Homework Helper
Insights Author
MHB
Messages
2,020
Reaction score
843
I am currently trying to find an iterative solution to the non-linear differential equations represented by
[math]\ddot{ \theta} = A~\cos( \theta )[/math]

and
[math]\dot{ \theta } ^2 = B( \sin( \theta ) - \sin( \theta _0 ) )[/math]

where the dot represents a time derivative and [math]\theta _0[/math] is the angle at time t = 0. (This is the harmonic oscillator where the angle is not taken to be small. A and B are related constants and I can give the derivations if you feel you need them.)

I'm looking for an iterated solution for [math]\theta (t)[/math], but I'm actually more interested in [math]t( \theta )[/math] for now.

Most of the Physics is involved with the first equation, which you are more likely to find as [math]\ddot{ \theta } = A~\sin( \theta )[/math] if you look it up. The second equation can be taken simply to mean that [math]\sin( \theta _0 ) \leq \sin( \theta )[/math] at all times.

Thanks for any help!

-Dan
 
Physics news on Phys.org
Just to be clear I am looking for a set of points [math]( t_n, \theta _n )[/math] where [math]\theta _{n+1} = f( \theta _i, t_i )[/math] ([math]0 \leq i \leq n[/math] ) such that the points on the graph are "close" to the function given by the differential equation, so I'm not looking at the elliptic function repesentation of the solution to the differential equation.

-Dan
 
Hi Dan,

I'm still not sure what you are asking for exactly.

Anyway, the method to solve an ODE like $\ddot\theta=A \cos\theta$ iteratively is by writing it as $\dot y = f(t,y)$.
In our case:
$$\begin{cases}\dot\theta = \omega \\ \dot\omega = A\cos\theta \end{cases} \Rightarrow \d{}t (\theta,\omega) = f(t,(\theta,\omega)) = (\omega,A\cos\theta)$$
The quick-and-dirty method to solve it is with Euler, which is $y_{n+1}=y_n+h f(t_n, y_n)$:
$$\begin{cases}t_{n+1}=t_n+ h \\ (\theta_{n+1},\omega_{n+1}) = (\theta_{n},\omega_{n}) + h f(t_n,(\theta_n,\omega_n))\end{cases}\Rightarrow\begin{cases}
t_{n+1}=t_n+ h \\
\theta_{n+1} = \theta_{n} + h \omega_n \\
\omega_{n+1} = \omega_{n} + h A\cos\omega_n\end{cases}$$
However, Euler is known to be unstable and yield errors that are ever getting worse.

[box=yellow]Instead, the commonly used method to solve $\dot y = f(t,y)$ is Runge-Kutta:
\begin{cases}
t_{n+1} &= t_n + h \\
y_{n+1} &= y_n + \tfrac{1}{6}\left(k_1 + 2k_2 + 2k_3 + k_4 \right)\\
\end{cases}
where:
\begin{cases}
k_1 &= h\ f(t_n, y_n) \\
k_2 &= h\ f\left(t_n + \frac{h}{2}, y_n + \frac{k_1}{2}\right) \\
k_3 &= h\ f\left(t_n + \frac{h}{2}, y_n + \frac{k_2}{2}\right) \\
k_4 &= h\ f\left(t_n + h, y_n + k_3\right)
\end{cases}[/box]

Alternatively, we can use the same methods to solve $\dot θ^2 = B(\sin(θ)−\sin(θ_0))$.
(We can derive this equation from the previous equation if we assume that $\dot θ_0 = 0$.)
$$\dot θ = f(t,θ) = \pm\sqrt{B(\sin(θ)−\sin(θ_0))}$$
We can apply Euler or Runge-Kutta again as desired.
To instead find $t(\theta)$, we can apply the inverse function theorem, and do:
$$t'(θ) = \frac1{\dot θ} = g(θ, t) = \frac{\pm 1}{\sqrt{B(\sin(θ)−\sin(θ_0))}}\Rightarrow
\begin{cases}
\theta_{n+1}=\theta_n+ h \\
t_{n+1} = t_{n} + h g(\theta_n,t_n)\end{cases}$$
And now apply Euler or Runge-Kutta.
 
Thank you. I worked with Runge-Kutta once and was able to use it all right, but I really don't understand where it comes from. In fact my otherwise fairly exhaustive personal library doesn't cover this topic at all and I'm wanting to understand what I'm up to. For that reason and one other I've decided to try to do a Taylor expansion recursion formula (that's what I've been meaning when I've used the word "iterative.") By doing this I should be able to match my series with the series for the associated elliptic integral (which I also have few sources about.)

Thanks for the information and advice. I'm at my parents at the moment and I'm not working consistently on it. I'll probably get back to you folks here in a week or so.

-Dan
 
I gave up on my project.

I was eventually able to derive the Taylor series. In fact I was a bit embarrassed how simple the solution was and how long it took me. Ah well.

Anyway I thought I'd let you all know what I was up to in case anyone wants to play with it. I was in the initial stages of finding an iterative solution to the double pendulum problem. (I was trying out methods on the simple pendulum.) I wanted to see if I could get any information about modes via Fourier transforms. I just derived the "full" equations for the double pendulum, as opposed to the small angle approximation, and the two equations of motion go all the way across the page. Not something I'd want to set up by hand, Runge-Kutta or not. I could program the solution but then I'd have a page full of data to try to Fourier transform, which would have to be done by computer as well. I figure I wouldn't get any inspiration from a page full of numbers, so I've quit.

It was fun while it lasted!

-Dan
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 36 ·
2
Replies
36
Views
5K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 24 ·
Replies
24
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
Replies
8
Views
2K