# Examples of DAEs

This is a simple homogeneous DAE with constant coefficients.
 In[1]:=
This finds the general solution. It has only one arbitrary constant because the second equation in the system specifies the relationship between x[t] and y[t].
 In[2]:=
 Out[2]=
This verifies the solution.
 In[3]:=
 Out[3]=
Here is an inhomogeneous system derived from the previous example.
 In[4]:=
The general solution is composed of the general solution to the corresponding homogeneous system and a particular solution to the inhomogeneous equation.
 In[5]:=
 Out[5]=
This solves an initial value problem for the previous equation.
 In[6]:=
 In[7]:=
 Out[7]=
Here is a plot of the solution and the constraint (algebraic) condition.
 In[8]:=
 Out[8]=
In this DAE, the inhomogeneous part is quite general.
 In[9]:=
 In[10]:=
Note that there are no degrees of freedom in the solution (that is, there are no arbitrary constants) because z[t] is given algebraically, and thus x[t] and y[t] can be determined uniquely from z[t] using differentiation.
 In[11]:=
 Out[11]=
 In[12]:=
 Out[12]=
In this example, the algebraic constraint is present only implicitly: all three equations contain derivatives of the unknown functions.
 In[13]:=
 In[14]:=
The Jacobian with respect to the derivatives of the unknown functions is singular, so that it is not possible to solve for them.
 In[15]:=
 Out[15]=
 In[16]:=
 Out[16]=
The differential-algebraic character of this problem is clear from the smaller number of arbitrary constants (two rather than three) in the general solution.
 In[17]:=
 Out[17]=

Systems of equations with higher-order derivatives are solved by reducing them to first-order systems.

Here is the general solution to a homogeneous DAE of order two with constant coefficients.
 In[18]:=
 In[19]:=
 Out[19]=
 In[20]:=
 Out[20]=
This inhomogeneous system of ODEs is based on the previous example.
 In[21]:=
 In[22]:=
 Out[22]=
 In[23]:=
 Out[23]=
Here is an initial value problem for the previous system of equations.
 In[24]:=
 In[25]:=
 Out[25]=
Here is a plot of the solution.
 In[26]:=
 Out[26]=
Finally, here is a system with a third-order ODE. Since the coefficients are exact quantities, the computation takes some time.
 In[27]:=
 In[28]:=
 In[29]:=
 Out[29]=
 In[30]:=
 Out[30]=

The symbolic solution of DAEs that are nonlinear or have non-constant coefficients is a difficult problem. Such systems can often be solved numerically with the Wolfram Language function NDSolve.