The state-space model ss can be given as StateSpaceModel, where a and b represent the state and input matrices in either the continuous-time system or the discrete-time system:
continuous-time system
discrete-time system
The controllability Gramian:
continuous-time system
discrete-time system
For asymptotically stable systems, the Gramian can be computed as the solution of a Lyapunov equation: