# Matlab's DAE example

I am a newcomer to working with differential algebraic equations and I am trying to work my way through Matlab's pendulum DAE system example:

https://www.mathworks.com/help/symbolic/solve-differential-algebraic-equations.html. \left\{\begin{aligned} m\ddot x(t)&=T(t)\frac{x(t)}{r}\\ m\ddot y(t)&=T(t)\frac{y(t)}{r}-mg\\ r^2&=x(t)^2+y(t)^2 \end{aligned}\right.

I understand what's going on here at the high level, but I find when I tweak the code in "Step 6" to ask for a simulation that lasts longer than the $$0.5$$ seconds of the code example, it refuses to solve past $$x=0.5$$. For the second run of the code in Step 6 (with the changed parameter value), it similarly stops at about $$x=0.7$$. It appears to be the $$x$$ value reaching 0 that breaks the example. Is there an obvious reason why that would happen?

I get no error messages except for the warning shown in the link above, which I've copied here:

Warning: Failure at t=5.067150e-01. Unable to meet integration tolerances
without reducing the step size below the smallest value allowed (1.800123e-15)
at time t.


I'm hoping to use the same process to solve more complicated sets of DAEs, but this doesn't inspire much confidence. Am I heading down the wrong path?

Thanks for any insight.

• Do you get an error message, and if yes, could you add it to the question? A probable reason is that a derivative or Jacobi-matrix becomes singular, which indicates that the system is not uniquely solvable at that point. It should not really happen, there should be a parametrization making the situation regular, but the documentation does not give details about the internals. Commented Sep 23, 2019 at 16:07
• No error messages, but there is a warning (that I've added in an edit to the original question). The fact that the stopping point seems to happen around the time that $x$ becomes 0 makes me think that the Jacobian becoming singular is a definite possibility. I had counted on the Matlab functions to keep that from happening as long as the original system of equations mapped to a well-defined physical system, but maybe that isn't happening. Commented Sep 23, 2019 at 23:53