Model Constrained Systems as DAEs

Model the motion of a single pendulum.

    
Click for copyable input
Derive the governing equations using Newton's second law of motion, and :
In[1]:=
Click for copyable input
Express the fixed length of the pendulum rod as an algebraic constraint:
In[2]:=
Click for copyable input
The pendulum is released from the horizontal position with a vertical velocity of 1:
In[3]:=
Click for copyable input
Specify the physical parameters for the pendulum system:
In[4]:=
Click for copyable input
Solve the high-index DAE and visualize the system:
In[5]:=
Click for copyable input
In[6]:=
Click for copyable input
Out[6]=