clc
clear all
% format short g
%roundn = @(x,m) round(x*10^m)./10^m;
%% As matrizes a seguir sao matrizes de impedancias mutuas
z12 = [[.005+.003i .002+.001i .001+.001j];...
[.002+.001i .005+.003i .002+.001i];...
[.001+.001i .002+.001i .005+.003i]];
z23 = [[.006+.003i .002+.001i .002+.001i];...
[.002+.001i .006+.003i .002+.001i];...
[.002+.001i .002+.001i .006+.003i]];
%% Matrizes de admitancia mutua entre barras
n = length(z12);
y12 = inv(z12);
y13 = zeros(n,n); % y13 vazia so para efeito de calculo
y11 = y12+y13;
y21 = y12;
y23 = inv(z23);
y22 = y21+y23;
y31 = y13;
y32 = y23;
y33 = y31+y23;
Yboss = [[y11(1,:) -1.*y12(1,:) -1.*y13(1,:)];...
[y11(2,:) -1.*y12(2,:) -1.*y13(2,:)];...
[y11(3,:) -1.*y12(3,:) -1.*y13(3,:)];...
[-1.*y21(1,:) y22(1,:) -1.*y23(1,:)];...
[-1.*y21(2,:) y22(2,:) -1.*y23(2,:)];...
[-1.*y21(3,:) y22(3,:) -1.*y23(3,:)];...
[-1.*y31(1,:) -1.*y32(1,:) y33(1,:) ];...
[-1.*y31(2,:) -1.*y32(2,:) y33(2,:) ];...
[-1.*y31(3,:) -1.*y32(3,:) y33(3,:) ]]
inv(Yboss)
I can not get the inverse of this array because I get the following error
Warning: Matrix is singular to working precision. In Aula23b_b (line 27) Zboss = Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf. Inf Inf Inf