working with chains of some rational MIMO transfer functions. get some very different results based on order of multiplication. without knowing too much of what's going on under the hood, wonder if someone can explain if this is expected or not:
sample tfs:
>> a1 = tf({[2 24],[12];[1 48 0],[2 24]},{[-1 24],[-1 24];[-4 96],[-1 24]});
>> a2 =a1; a3 = a1; a4 = a1;
this produces the expected series answer, nicely simplified
>> a1*a2*a3*a4
so does this, doing one multiplication at a time:
>> a1*a2;ans*a3;ans*a4
since matrix multiplication is associative, (and since the tfs are identical) this should also work
>>a3*a4;a2*ans;a1*ans
but the result is very different
also happens with different, unequal tfs. is there something about having the more complex tf as the second term for the multiply?
checking against ML2015. ML doesn't try to do any rational simplfication, so it's a bit of a mess with very high polynomial order doing any of the above steps. using minreal between each step keeps it on track and the answer matches the expected analytical result multiplying in any direction.