|
发表于 2020-12-18 15:51:59
|
显示全部楼层
- clear;
- clc;
- % Series resonant circuit model of montional osillation
- syms wm fm Lm Cm Rm Q real;
- fm=4.00e6;Cm=5.0e-15;Rm=400.0;% Designer specified parameters:motional resonant frequency
- %,motional capacitance and motional resistance
- wm=2*pi*fm;% Calculate motional resonant angular frequency
- Lm=wm^-2/Cm;% Calculate motional inductance
- Q=1/(wm*Cm*Rm);% Calculate quality factor
- % Ocillator circuit model
- syms Rf C3 C1 C2 Cload gm real;
- Rf=1e6;
- %gm=34.5e-3;
- C3=5.0e-12;C1=16.0e-12;C2=16.0e-12;
- Cload=C1*C2/(C1+C2);
- % Actual ocillation angular frequency
- syms w wa f;
- %w=wm*(1+Cm/(2*(C3+Cload)));% Calculate actual ocillation angular frequency
- w=wm*sqrt(1+Cm/(C3+Cload));% Calculate actual ocillation angular frequency
- f=w/(2*pi);
- wa=wm*sqrt(1+Cm/C3);% Calculate anti ocillation angular frequency
- fa=wa/(2*pi);
- % The mount of frequeancy pulling above wm
- syms p real;
- p=(w-wm)/wm;
- % Motional impedance
- syms Zm;
- Zm=Rm+1i*2*p/(w*Cm);
- % Oscilator circuit impedance
- syms Zc Z1 Z2 Z3 R1 R2 R3;
- %Z1=1/(1i*w*C1);Z2=1/(1i*w*C2);Z3=1/(1i*w*C3+1/Rf);% Rf
- %Z1=1/(1i*w*C1);Z2=1/(1i*w*C2);Z3=1/(1i*w*C3);% For lossless circuit
- R1=inf;R2=inf;R3=inf;
- Z1=1/(1i*w*C1+1/R1);Z2=1/(1i*w*C2+1/R2);Z3=1/(1i*w*C3+1/R3);% For lossy circuit
- Zc=(Z1*Z3+Z2*Z3+gm*Z1*Z2*Z3)/(Z1+Z2+Z3+gm*Z1*Z2);
- % Transconductances
- syms gm_crit gm_max gm_opt Rneg Rneg_max real;
- Rneg=real(Zc);
- gm_opt=solve(diff(Rneg),gm);
- gm_opt=double(gm_opt(2));
- %gm_opt=w*(C1+C2+C1*C2/C3);
- Rneg_max=double(subs(Rneg,'gm',gm_opt));
- %Rneg_max=-1/(2*w*C3*(1+(C1+C2)*C3/(C1*C2)));
- gm_crit_max=double(solve(Rneg==-Rm,gm));
- %gm_crit_max=solve(Rneg==-Rm,gm);
- gm_crit=gm_crit_max(1);
- %gm_crit=(w*(C1*C2+C2*C3+C3*C1)^2)/(Q*Cm*C1*C2);
- gm_max=gm_crit_max(2);
- %Actual gm and Rneg
- gm=0.1e-3:0.1e-4:500.0e-3;
- Rneg=double(subs(Rneg,'gm',gm));
- figure(10);
- semilogx(gm,Rneg,'r-');grid on
- xlabel('gm(S)');
- ylabel('Negative Resistance(ohm)');
- title(['Negative Resistance VS. gm',newline,'fm=',num2str(fm/1000000,'%.f'),'MHz']);
- hold on
- xlim=get(gca,'Xlim');
- plot(xlim,[min(Rneg),min(Rneg)],'b-')
- plot(xlim,[-Rm,-Rm],'m-');
- % plot(xlim,[-200,-200],'c-');
- ylim=get(gca,'Ylim');
- plot([gm_crit,gm_crit],ylim,'k--');
- plot([gm_opt,gm_opt],ylim,'k--');
- plot([gm_max,gm_max],ylim,'k--');
- % plot([10.84e-3,10.84e-3],ylim,'k--');
- % plot([40.37e-3,40.37e-3],ylim,'k--');
- clear xlim ylim;
- text(gm_crit,-Rm,['(gm_crit,-Rm)',newline,'(',num2str(1000*gm_crit,'%.2f'),'m,',num2str(-Rm,'%.0f'),')',newline,newline],'Interpreter','none');
- text(gm_opt,Rneg_max,['(gm_opt,Rneg_max)',newline,'(',num2str(1000*gm_opt,'%.2f'),'m,',num2str(Rneg_max,'%.0f'),')',newline,newline],'Interpreter','none');
- text(gm_max,-Rm,['(gm_max,-Rm)',newline,'(',num2str(1000*gm_max,'%.2f'),'m,',num2str(-Rm,'%.0f'),')',newline,newline],'Interpreter','none');
- legend('Negative Resistance','Max Negative Resistance','Motional Resistance','Location','Best');
- syms Cc;
- ww=wm*sqrt(1+Cm/Cc);
- ff=ww/(2*pi);
- Cc=-(w*imag(Zc))^-1;
- Cc=double(subs(Cc,'gm',gm));
- figure(20)
- semilogx(gm,Cc,'b-');grid on
- axis([0.1e-3,1000.0e-3,C3-1e-12 C3+Cload+1e-12]);
- xlabel('gm(S)');
- ylabel('Capacitance(F)');
- title(['Capacitance VS. gm',newline,'fm=',num2str(fm/1000000,'%.f'),'MHz']);
- hold on
- xlim=get(gca,'Xlim');
- plot(xlim,[max(Cc),max(Cc)],'c-');
- plot(xlim,[min(Cc),min(Cc)],'m-');
- ylim=get(gca,'Ylim');
- plot([gm_crit,gm_crit],ylim,'k--');
- plot([gm_opt,gm_opt],ylim,'k--');
- plot([gm_max,gm_max],ylim,'k--');
- clear xlim ylim;
- text(10e-5,max(Cc),[' Cload+C3:',newline,' ',num2str(1e12*(Cload+C3),'%.1f'),'p',newline,newline],'Interpreter','none');
- text(10e-5,min(Cc),[' C3:',newline,' ',num2str(1e12*C3,'%.1f'),'p',newline,newline],'Interpreter','none');
- text(gm_crit,min(ylim),[' gm_crit:',newline,' ',num2str(1e3*gm_crit,'%.2f'),'m',newline,newline],'Interpreter','none');
- text(gm_opt,min(ylim),[' gm_opt:',newline,' ',num2str(1e3*gm_opt,'%.2f'),'m',newline,newline],'Interpreter','none');
- text(gm_max,min(ylim),[' gm_max:',newline,' ',num2str(1e3*gm_max,'%.2f'),'m',newline,newline],'Interpreter','none');
- legend('Cc','Cload+C3','C3','Location','Best')
- %A=2*Rm*w*C3*(C1*C2+C2*C3+C1*C3)/C1/C2
- %semilogx(gm,subs(imag(Zc),'gm',gm),'r-');grid on
复制代码
|
|