#!/usr/bin/env octave

%
%   o---------------
%   Ue    | R1     | C1
%        | |      ---
%        | |      ---
%         | I1     | I2
%         -------------------o Ua
%         | R2     | C2
%        | |      ---
%        | |      ---
%         | I3     | I4
%   o------------------------o
%
%
%   I1+I2 = I3+I4
%   R1*C1*I1*s = I2
%   R2*C2*I3*s = I4

%                    Ue == Ue
%   R1*(I3+I4-I2)+R2*I3 == 1/C1*1/s*I2 + R2*I3
%   => I3*(1+T2*s) = I2(1+1/T1*1/s))

%   Ua = R2*I3
%   Ue = 1/C1*1/s*I2 + R2*I3

%   G = Ua/Ue = ...


R1 = 100;	% ohm
C1 = 0.001;	% farad
R2 = 10000;	% ohm
C2 = 0.1;	% farad

% adjsut
C1 = C1*2*pi;
C2 = C2*2*pi;

T1 = R1*C1;
T2 = R2*C2;

G = tf([T1 1], [T1+T1*T2/(C1*R2) 1+T1/(C1*R2)]);
bode(G, 0.1:0.1:1000);
pause;
