% check thermodynamic consistency using detailed balance on C1-O-IF loop

% -------------------------------INCOMPLETE------------------------------
clear;

V = transpose(-120:1:60); % unit mV

% ORDER:	
% rc3	11
% rc2	12
% rc1	13
% C1IF	2
% O     3
% IF	4

kz = [10497.185	0.50706381	191.70076	-1.3158778
9297.8308	0.50917999	255.85819	-1.3158786
8475.4819	0.5255337	360.04895	-1.3158784
3.79E-07	-5.1369881	8.3473003	0.068245486
9178	0.90001141	0.036526774	-0.80682811
91.780009	0.90001134	3.79E-07	-5.1369881];



alpha = calc_alpha_matrix(kz,V*1e-3);
beta = calc_beta_matrix(kz,V*1e-3);

c1oif_fwd = alpha(:,3).*alpha(:,4).*alpha(:,5);
cloif_bwd = beta(:,3).*beta(:,4).*beta(:,5);

err = norm(c1oif_fwd./cloif_bwd)

