# Why does DSolve not give the expected analytical solution for a system of DAE? [closed]

I made a mistake in typo I am trying to solve the following system of DAE:

X'[t] - y*Y[t] + x*X[t] == 0
Z'[t] - y*Y[t] + x*Z[t] == 0
X[t] + Y[t] + Z[t] == 1


with initial condition:

X == 1, Y == 0, Z == 0


Implemented in mathematica as:

dae = {X'[t] - y*Y[t] + x*X[t] == 0, Z'[t] - y*Y[t] + x*Z[t] == 0,
X[t] + Y[t] + Z[t] == 1, X == 1, Y == 0, Z == 0};

sol = DSolve[dae, {X[t], Y[t], Z[t]}, t]


The solution is not expected.

The correct answer should be: $$X(t) = \left(\frac{1}{2}-\frac{y}{x+2y}\right)e^{-\left(x+2y\right)t}+\frac{y}{x+2y}+\frac{1}{2}e^{-xt}$$

from it we can see that $$X(t) \rightarrow \frac{y}{x+2y}$$ as $t \rightarrow \infty$. But the mathematica solution, which is not expressed in exponential function, gives me X goes to 0 as t goes to infinity.

• Why you think your by-hand result is correct? Maple's result is the same as Mathematica's: i.stack.imgur.com/OYav3.png – xzczd May 5 '15 at 11:25
• Thanks! But I believe there is another solution this DAE system. Mathematica returns one, but this is not the solution I am looking for (another solution). How can I get another solution to this system? – Ka-Wa Yip May 5 '15 at 18:09
• I'm not an expert of DAE, but I think for a linear system it's natural to have only one solution. Can you provide a proof for your belief? – xzczd May 6 '15 at 2:40
• I got it! I have a typo in my mathematica code (in the system of diff. equations). Take me a day to figure it out. Sorry. The code has been corrected above. – Ka-Wa Yip May 6 '15 at 3:09
• @kwyip The MMA code still contains Y'[t] in the first equation, where Y[t] should probably be. Also, would you mind double- and triple-checking your equations? I'd hate for your confusion to be due simply to another typo! @xzczd also raised some very good points that you have not addressed: 1) it looks like your DAE system should admit only one solution 2) the correctness of MMA's solution can be checked easily by plugged the solution back into the equation and verifying that it is verified. Have you tried to do the same with your set of expected solution? – MarcoB May 6 '15 at 4:18

dae =
{X'[t] - y*Y[t] + x*X[t] == 0,
Z'[t] - y*Y[t] + x*Z[t] == 0,
X[t] + Y[t] + Z[t] == 1, X == 1,
Y == 0, Z == 0};


I get

(E^(-t x) (x + E^(t x + t (-x - 2 y)) x + 2 y + 2 E^(t x) y))/(2 (x + 2 y))


as the solution for X[t] and

Limit[
(E^(-t x) (x + E^(t x + t (-x - 2 y)) x + 2 y + 2 E^(t x) y))/(2 (x + 2 y)),
t -> ∞, Assumptions -> (x > 0 && y > 0)]


gives

y/(x + 2 y)


as you assert. So your problem seem to boil down to a typo,