% % Cib current sim % http://okawa-denshi.jp/techdoc/ % % t Param %%%%%%%%%%%%%%% dt=0.0002e-9; ts=1e-9; t=[-ts:dt:ts]; n=length(t); % D Para %%%%%%%%%%%%%%%% K=1.380658e-23; eq=1.60e-19; Is=0.00000000000001; T=301; % Cib Para %%%%%%%%%%%%%% Cib=5e-12; % sim Para %%%%%%%%%%%%%% Istep=0.01; vBE=zeros(1,n); ib=zeros(1,n); ibb=[zeros(1,n/2-0.5) Istep.*ones(1,n/2+0.5)]; iCib=zeros(1,n); for j=2:n-1 ib(j)=Is*(exp(eq/K/T*vBE(j-1))-1); iCib(j)=ibb(j)-ib(j); vBE(j)=vBE(j-1)+dt*iCib(j)/Cib; end subplot(2,1,1) plot(t,ibb,t,ib,t,iCib),grid on; xlabel('t[s]') ylabel('i[A]') title('ib Tran') axis([-0.1*ts,0.7*ts,-0.5*Istep,1.5*Istep]) subplot(2,1,2) plot(t,vBE),grid on; xlabel('t[s]') ylabel('vBE[V]') axis([-0.1*ts,0.7*ts,-0.1,1])