Escolar Documentos
Profissional Documentos
Cultura Documentos
model = 1; % define the model 0 - Linear Ion Drift ; 1 - Simmons Tunnel Barrier;
2 - Team model ; 3 - Nonlinear Ion Drift model
win = 0; % define the window type : 0 - No window; 1 - Jogelkar window ; 2 -
Biolek window ; 3 - Prodromakis window ; 4- Kvatinsky window (Team model only)
iv = 0; % IV_relation=0 means linear V=IR. IV_relation=1 means nonlinear
V=I*exp{..}
%Genaral parameters
num_of_cycles = 20;
amp = 1;
freq = 2e6;
w_init = 0.5; % the initial state condition [0:1]
D = 3e-09;
V_t = 0;
P_coeff = 2;
J = 1;
Roff = 2e5;
Ron = 100;
if (model==0)
tspan=[0 num_of_cycles/freq]; %%time length of the simulation
points=2e5; %%number of sampling points
W0=w_init*D; %define the initial value of W
tspan_vector = linspace(tspan(1),tspan(2),points); % Create vector of
initial values
I = amp*sin(freq*2*pi*tspan_vector); %%can also use square wave
generated by : (square(tspan_vector));
W=zeros(size((tspan_vector)));
W_dot=zeros(size((tspan_vector)));
delta_t=tspan_vector(2)-tspan_vector(1); %%define the step
size
end
end
figure(2);
plot(tspan_vector,W/D,'r');
title('W/D as func of time');
xlabel('time[sec]');
legend('W/D');
end
points=2e5;
tspan=[0 num_of_cycles/freq];
t = linspace(tspan(1),tspan(2),points);
curr = amp*sin(freq*2*pi*t);
X=zeros(1,points);
X_dot=zeros(1,points);
delta_t=t(2)-t(1);
X(1)=w_init*D;
for i=2:(length(t))
if curr(i)> 0
X_dot(i)=c_off*sinh(curr(i)/i_off)*exp(-exp((X(i-1)-a_off)/X_c-
abs(curr(i))/b)-X(i-1)/X_c);
else
X_dot(i)=c_on*sinh(curr(i)/i_on)*exp(-exp(-(X(i-1)-a_on)/X_c-
abs(curr(i))/b)-X(i-1)/X_c);
end
X(i)=X(i-1)+delta_t*X_dot(i);
if (X(i) < 0)
X(i) = 0;
X_dot(i)=0;
elseif (X(i) > D)
X(i) = D;
X_dot(i)=0;
end
end
R=Roff.*X./D+Ron.*(1-X./D);
V=R.*curr;
figure(1);
plot(V(20e3:end),curr(20e3:end));
title('I-V curve');
xlabel('V[volt]');
ylabel('I[amp]');
figure(2);
plot(t,X/D,'r');
title('X/D as func of time');
xlabel('time[sec]');
legend('X/D');
end
%% Team model
if (model==2)
points=2e5;
tspan=[0 num_of_cycles/freq];
t = linspace(tspan(1),tspan(2),points);
curr = amp*sin(freq*2*pi*t);
X=zeros(1,points);
X_dot=zeros(1,points);
delta_t=t(2)-t(1);
X(1)=w_init*D;
for i=2:(length(t))
% case this is an ideal window
if (win == 0)
if (X(i) < 0)
X(i) = 0;
X_dot(i)=0;
elseif (X(i) > D)
X(i) = D;
X_dot(i)=0;
end
end
figure(1);
plot(V(20e3:end),curr(20e3:end));
title('I-V curve');
xlabel('V[volt]');
ylabel('I[amp]');
figure(2);
plot(t,X/D);
title('X/D as func of time');
xlabel('time[sec]');
legend('X/D');
end
for i=2:points
% case this is an ideal window
if ((win==0) || (win==4))
W_dot(i)=a*V(i)^q;
W(i)=W(i-1)+W_dot(i)*delta_t;
end
curr(i)=W(i)^n*beta*sinh(alpha*V(i))+c*(exp(g*V(i))-1);
end
figure(1);
plot(V(20e3:end),curr(20e3:end));
title('I-V curve');
xlabel('V[volt]');
ylabel('I[amp]');
figure(2);
plot(t,W,'r');
title('W/D');
xlabel('time[sec]');
legend('W/D');
end
%% VTEAM model
if (model==4)
points=2e5;
tspan=[0 num_of_cycles/freq];
t = linspace(tspan(1),tspan(2),points);
v = amp*sin(freq*2*pi*t);
X=zeros(1,points);
X_dot=zeros(1,points);
delta_t=t(2)-t(1);
X(1)=w_init*D;
for i=2:(length(t))
% case this is an ideal window
if (win == 0)
if (X(i) < 0)
X(i) = 0;
X_dot(i)=0;
elseif (X(i) > D)
X(i) = D;
X_dot(i)=0;
end
end
figure(1);
plot(v(20e3:end),curr(20e3:end));
title('I-V curve');
xlabel('V[volt]');
ylabel('I[amp]');
figure(2);
plot(t,X/D);
title('X/D as func of time');
xlabel('time[sec]');
legend('X/D');
end