MATLAB: Problem Solving a System of Coupled Differential Equations

differential equationsMATLABodeode45simulink

I have to solve the following system of coupled differential equations:
x1''+x2''+x1'+x1=0
x2''+x1''+x2'+x2=0
With the initial conditions:
x1(0)=1
x1'(0)=0
x2(0)=0
x2'(0)=0
I have tried simulink, but there seems to be an "algebraic loop" which I do not know how to solve. I have tried ode45 too, but it cannot solve it either, due to a division by zero.
If anyone knows how to solve it, I would be very grateful.
Thanks in advance for your answers,
Alberto.

Best Answer

Subtracting equation (2) from equation (1) gives
(x1 - x2)' = -(x1 - x2)
with
(x1 - x2)(0) = 1
Solution:
x1 - x2 = exp(-t)
thus
x1 = x2 + exp(-t).
Now insert in equation (1), e.g., to get an equation for x2 alone.
Best wishes
Torsten.