Nonlinear differential equation with singularity: numerical solution?

523 Views Asked by At

I want to numerically solve the following problem over some interval of time: \begin{eqnarray*} \dot{\theta}_1 & = & \theta_2\\ \dot{\theta}_2 & = & \frac{g - l\theta_2^2\cos\theta_1}{l\sin\theta_1} \end{eqnarray*} from initial condition $(\theta_1(0),\theta_2(0)) = (0,\sqrt{\frac{g}{l}})$. The constant are $l = 1$, $g = 10$.

My problem is that right hand side is infinity for the initial condition, so I cannot use an Euler scheme, for example.

Is there a general way to deal with problems like this one? Can anyone recommend a good textbook that deals with it? Thanks!

1

There are 1 best solutions below

3
On BEST ANSWER

In this particular case, the system is equivalent to the second order ODE \begin{equation} \ddot{\theta} \sin \theta + \dot{\theta}^2 \cos \theta = \frac{g}{l}, \end{equation} with $\theta = \theta_1$. We can recognise the left hand side as the second derivative of $-\cos \theta$, so that we obtain \begin{equation} \frac{\text{d}^2}{\text{d} t^2} \cos \theta = - \frac{g}{l}. \end{equation} If I were to guess, this is probably where your system came from in the first place. Integrating twice with respect to $t$ and using the initial condition $\theta(0) = 0$ yields then \begin{equation} \cos \theta = 1 - \frac{1}{2}\frac{g}{l} t^2. \end{equation} When you try to draw $\theta(t)$, you'll see that there is a problem at $t=0$: there are two solution branches to choose from. However, the initial condition on the derivative at $0$, $\theta'(0) = \sqrt{\frac{g}{l}}>0$ allows you to select the correct branch. Note that every branch only exists up to $t_* = 2 \sqrt{\frac{l}{g}}$.

From the dynamical systems point of view, the limit $(\theta_1,\theta_2) \to (0,\sqrt{\frac{g}{l}})$ in the equation for $\dot{\theta_2}$ is not unique: write $\theta_1 = \varepsilon$ and $\theta_2 = \sqrt{\frac{g}{l}} + s \varepsilon$, then \begin{equation} \lim_{\varepsilon \to 0} \left.\frac{g - l \theta_2^2 \cos \theta_1}{\sin \theta_1}\right|_{\theta_1=\varepsilon,\theta_2 = \sqrt{\frac{g}{l}} + s \varepsilon} = -2 \sqrt{\frac{g}{l}} s, \end{equation} which therefore depends on the direction $(1,s)$ of the limit.