clear

q0 = [0;0];

C1 = 220*10^-6;
C2 = 100*10^-6;

t0 = 0;
tf = 1;
N = 1000;

[t,q] = rk4fixed('twotankelectrical',[t0 tf],q0,N);
subplot(2,1,1);
plot(t,q); title('Charge vs. Time');
xlabel('Time (sec)'); ylabel('Charge (C)');

Vc1 = q(:,1)/C1;
Vc2 = q(:,2)/C2;

subplot(2,1,2);
plot(t,Vc1,t,Vc2,'-'); title('Capacitor Voltage vs. Time');
xlabel('Time (sec)'); ylabel('Capacitor Voltage (volts)');