clear all

bda = 3 ;
cda = 1 ;

kappa1 = 2 ;
kappa2 = 1 ;
kappa3 = 3 ;

ca = 5   / sqrt (25 + cda^2) ;
sa = cda / sqrt (25 + cda^2) ;

A = [ ca   0   1    0   1   0  0  0  0   0   0     0 ;
     -sa   0   0    1   0   1  0  0  0   0   0     0 ;
      0    0 -5-cda 1 -cda -1  0  0  0   0   0     0 ;
      0   ca   0    0  -1   0  1  0  0   0   0     0 ;
      0   sa   0    0   0  -1  0  1  0   0   0     0 ;
      0    0   0    0   0  -2  0 -1  0   0   0     0 ;
     -ca   0   0    0   0   0 -1  0  1   0   0     0 ;
      sa   0   0    0   0   0  0 -1  0   1   0     0 ;
      0    0   0    0   0   0  0 -1  0  -2   0     0 ;
      0  -ca   0    0   0   0  0  0 -1   0   1     0 ;
      0  -sa   0    0   0   0  0  0  0  -1   0     1 ;
      0    0   0    0   0   0  0  0 cda -1 -3-cda -1 ;
      0    0   1    0   0   0  0  0  0   0   1     0 ;
      0    0   0    1   0   0  0  0  0   0   0     1 ;
      0    0   0    0   0   0  0  0  0   0   2    -10
    ] ;

B = [   -1      0  0      -kappa1        ;
         0      0  0         0           ;
     5+cda-bda  0  0  kappa1*(5+cda-bda) ;
         0      0  0         0           ;
         0      1  0       kappa2        ;
         0      1  0       kappa2        ;
         0      0  0         0           ;
         0      0  1       kappa3        ;
         0      0 -1      -kappa3        ;
         0      0  0         0           ;
         0      0  0         0           ;
         0      0  0         0           ;
        -1      0  0      -kappa1        ;
         0      1  1   kappa2+kappa3     ;
       -bda    -3 -7  -kappa1*bda-3*kappa2-7*kappa3
   ] ;   

X = A \ B 
