MATLAB: Does Simulink detect an algebraic loop with the State-Space block in Simulink 7.4 (R2009b)

simulink

I am trying to simulate MIMO state-space model. Consider for example the system:
d x1/dt = -x1 + u1
d x2/dt = -x2 + u2
y1 = x1 + u1
y2 = x2 + u2
I have created a state-space model of this system. Clearly, the model has direct feedthrough from input 1 to output 1 and from input 2 to output 2. But there is no direct feedthrough from input 1 to output 2 or from input 2 to output 1. Now, if I apply direct feedback from output 2 to input 1, there should not be any algebraic loops. However, Simulink finds a loop and gives the warning message:
Warning: Block diagram 'stateloop' contains 1 algebraic loop(s).
Found algebraic loop containing block(s):
'stateloop/State-Space'
'stateloop/Gain1' (algebraic variable)
If I divide the state-space model above to two SISO models, I will get mathematically equivalent model and there is no problems in simulation.

Best Answer

This occurs because when a portion of the output vector is direct feedthrough, Simulink makes the entire output vector direct feedthrough. The State Space block can only not be direct feedthrough if the D matrix is all zeros.
As a workaround, the algebraic loop can be broken by including a non-direct feedthrough block in the loop. Another alternative is to break the state space model into two separate models, where one has a D matrix of zeros. Signals from this portion of the model can be fed back without creating algebraic loops.