clear;
R1 = 16E3;  % Widerstand in Ohm
R2 = 22E4;  % Widerstand in Ohm
R4 = 2.2E3; % Widerstand in Ohm
C2  = 1E-7; % Kapazitaet in Farad
C3  = 1E-7; % Kapazitaet in Farad
N  = 200;   % Anzahl der Frequenzwerte
f  = logspace(1, 3, N);  
           % Frequenz in Herz
UE = 1E-1; % Eingangsspannung in V

V = [0; UE; UE; 0];

for m=1:N
  XC2   = 1/(j*2*pi*f(m)*C2);
  XC3   = 1/(j*2*pi*f(m)*C3);
  M     = [ 1     1    1  -1;
           R1     0    0  R4;
           R1   -XC2   0   0;
            0 R2+XC2 -XC3  0];
  I     = (M^-1) * V;
  UA(m) = R2*I(2);
end;

subplot(2,1,1); loglog(f, abs(UA), 'LineWidth', 3); 
set(gca,'FontSize',24); 
xlabel('Frequenz in Hz'); ylabel('Betrag von Ua in V'); 
subplot(2,1,2); semilogx(f, angle(UA), 'LineWidth', 3); 
set(gca,'FontSize',24); 
xlabel('Frequenz in Hz'); ylabel('Phase von Ua in V'); 

