I am not sure I know what is going on. I expected to obtain the controllable canonical form in this example, but I am not. May be I am not using it correctly.

Given A,B, I wanted to transfer the state space to controllable canonical form

http://www.maplesoft.com/support/help/Maple/view.aspx?path=DynamicSystems%2FSSTransformation

In this form, the A matrix will have 1 on the super diagonal, and the last row will have the coefficients of the charaterestic polynomial in reverse order with a minus sign. The B matrix will have all zeros, except for the last entry. This is what the example on the above page actually shows.

But when I tried it on my A,B, I do not get this form for the new B matrix. Here is a MWE

restart;

with(DynamicSystems):

A:=Matrix([[0,0,1,0],[0,0,0,1],[-2,-1,0,0],[1,-1,0,0]]);

B:=Matrix([[0],[0],[1],[0]]);

C:=Matrix([[0,0,0,0]]):

D0:=Matrix([[0]]):

sys:=StateSpace(A,B,C,D0): #just to see the polynomial

CharacteristicPolynomial(sys, s);

SSTransformation(A,B,C,D0,form=ControlCanon,output=['A','B']);

The above should be

I am sure I am doing something wrong, but what?

Maple 18.01, windows 7