# Initial conditions for pendulum Jerk equation

I have a very simple problem, but can't seem to understand what I need to do. In simulating a pendulum from it's jerk equation, I'm having a hard time setting initial conditions to get it to work out. So for example the equation of motion for a pendulum is

$$\ddot{\theta} = -A \sin{\theta}$$

And I'm interested in modeling from it's jerk,

$$\dddot{\theta}=-A\, \dot{\theta} \cos{\theta}$$

So a little change of coordinates $\theta = x, \dot{\theta}=y$, and $\ddot{\theta} = z$, can yield three equations of motion:

$$\dot{x}=y$$ $$\dot{y}=z$$ $$\dot{z}=-A \, y \cos{x}.$$

My problem are the initial conditions. Since the problem is nonlinear and cannot be solved, how do I pick initial conditions that will yield the correct results (oscillating symmetrically around $x=0$ (from the view only looking at the $x$ axis)). Specifically I would like to know $(x_0,y_0,z_0)=(a,0,?)$ meaning I pull it back at angle $a$ and let it go. The general process is what I'm after, meaning I could also solve,

$$\dot{x}=y$$ $$\dot{y}=z$$ $$\dot{z}=-B\, z-A \, y \cos{x}$$

or anything else that would be a symmetric perturbation (around $x=0$) if you will. I'm able so solve this, but currently I'm cheating. I set $(x_0,y_0,z_0)=(0,v,0)$ (which is always good for any $v$ since the time derivative at the bottom of the swing will be zero for the velocity). I then look at $x_{max}$ and the corresponding $z$, but I would like it to be a lot more clean.

Thanks!

You can't independently choose initial conditions for $x,y,z$. That's because you have that $z=\ddot\theta$ and consequently $z(0)=\ddot\theta(0)=-A\sin(\theta(0))=-A\sin(x(0))$. So the initial conditions for $x$ and $z$ are not independent.

But if you go with the original equation of second order, you will see that you can independently choose $\theta(0)$ (the initial angle) and $\dot\theta(0)$ (the initial angular velocity of the pendulum). You can then solve the differential equation to obtain $\theta(t)$, and the jerk is simply the third derivative of this solution.

• Although I appreciate your comment, you did not address my question. I know that $x,y,$ and $z$ are not independent which is why I asked how to solve $(x_0,y_0,z_0)=(a,0,?)$ because I know they are dependent on each other. Furthermore, I asked for the general process, for example had $\dot{z}=-z+yx+x^3$ you cannot obtain a $z(0)$ equation. Additionally, in your second paragraph you suggest solving the differential equation, but it cannot be solved even for a simple pendulum without dissipation (plus this is not what I asked for). – Josh Feb 21 '18 at 15:10
• Then I'm confused what you are asking. Solving the original second order equation is as simple or difficult as solving your system of three equations. What I'm pointing out is that differentiating an ODE once more is rarely a good idea because it leads to problems with the independence of the initial conditions -- so don't do it. – Wolfgang Bangerth Feb 22 '18 at 23:26
• Given that I think that your initial approach is flawed, I don't think that answering the question of what ? should be is a useful question. Can you say what your next question then is? – Wolfgang Bangerth Feb 22 '18 at 23:27

The most general case that can be set is the following: $$f(\dot{x},x,t)=0, \qquad x(0)=x^0\tag{*}$$ If you are interested in the obtainment of the variable $\dot{x}$ you can differentiate the previous equation wrt. $t$. This gives you: $$f_\dot{x}\ddot{x}+f_x\dot{x}+f_t=0\tag{**}$$ Where the subscripts indicate partial derivatives. It is clear that the equation $(**)$ must come with an initial condition for $\dot{x}(0)=\dot{x}^0$. This is done by means of the equation $(*)$. If it is nonlinear in the variable of interest... one may use iterative methods to solve $$f(\dot{x}^0,x^0,t^0)=0$$ for $\dot{x}^0$.

The common sense in physics simulations is to first simplify the equations as much as you can, and only set-up your numerical method after that. Everything that can be done analytically has to be done analytically, lest you multiply numerical artifacts. So, you do not need to solve third-order equation (it can even be counter-productive). Solve the second order equation, and then just calculate the third order derivative of $\theta$ as someone already said in his/her answer.

About the equation (2nd order one) being "unsolvable": it is solvable and its solutions are Jacobi ellyptic functions. Howevei, you don't need to solve it analytically. Just get a numerical solution and then find it's 3rd order derivative using finite differences.