All pastes #49195 Raw Edit

Miscellany

public text v1 · immutable
#49195 ·published 2006-04-12 18:13 UTC
rendered paste body
clear
clc
format long
n = 5;
Cdl = 33;
E = 10;
Rm = 2;
Re = 1;
Rct = 0.5;  % Ohm
kf = 1 ; % [forward reaction rate, Inv(s)] range: 1 a 1e-5 
kb = 0.01 ; % [backward reaction rate, Inv(s)] range: 1 a 1e-5
Do = 100 ; % [diffusion quoeficient of the oxidated compound, m^2 Inv(s)]
Dr = 30 ; % [diffusion quoeficient of the reduced compound, m^2 Inv(s)]
omega = [0.02 0.0159]; % [frequencies, Hz]
Zact = Re + 1./(j*omega.*Cdl + 1./(Rct));
m = n+1 ;
A=zeros(m,m);
for N = 1:m
    for Zint = 1:3   
        for W = 1:length(omega)
           if Zint == 1 
              Z(N,Zint,W) = Re ;
           elseif Zint == 3
              Z(N,Zint,W) = Rm ;
           end
           if Zint == 2
              Z(N,Zint,:) = Zact;  
           end
       end
    end
end
Z(:,:,:);
A(:,:,:);
B=zeros(m,1);
B(:,1)=E;
for W = 1:length(omega)
C(:,:,W)=rank(A(1,1,:)+B(:,1));
D(:,:,W)=rank(A(1,1,:));
E(:,:,W)=rank(B(:,1));
F(:,:,W)=D(:,:,W)+E(:,:,W);
end
C
F