代码在MATLABR2014环境下测试Lm=45e-6;Lr=15e-6;Cr=94e-9;Np=9;Ns=4;Uo=60;Io=25;K=Lm/Lr;fr=1/(2*pi()*(Lr*Cr)^0.5);fs=1/(2*pi()*((Lr+Lm)*Cr)^0.5);Rac=Uo/Io*8/pi()^2*(Np/Ns)^2;Q=2*pi()*fr*Lr/Rac;X=0.01:0.01:2;fornum=1:1:length(X)G(num)=Ns/Np*K*X(num)^2/(((1+K)*X(num)^2-1)^2+(Q*K*X(num)*(X(num)^2-1))^2)^0.5;X(num)=X(num)*fr/1000;end[GmaxGindex]=max(G);axes1=axes()plot(X,G,'r');gridon;hold(axes1);datacursormodeon;line_fr_x=[fr/1000;fr/1000];line_fr_y=[0;1];e=get(axes1,'YLim');line_fr_y(2,1)=e(2);line(line_fr_x,line_fr_y,'color','g');line_fmax_x=[1;1];line_fmax_x(1,1)=X(Gindex);line_fmax_x(2,1)=X(Gindex);line_fmax_y=[0;1];e=get(axes1,'YLim');line_fmax_y(2,1)=e(2);line(line_fmax_x,line_fmax_y);line_fs_x=[1;1];line_fs_x(1,1)=fs/1000;line_fs_x(2,1)=fs/1000;line_fs_y=[0;1];line_fs_y(2,1)=e(2);line(line_fs_x,line_fs_y,'color','g');