InductionLoop.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:em_examples 作者: geoscixyz 项目源码 文件源码
def plot_InducedCurrent_FD(self,Ax,Is,fi):

        FS = 20

        R = self.R
        L = self.L

        Imax = np.max(-np.real(Is))

        f = np.logspace(0,8,101)


        Ax.grid('both', linestyle='-', linewidth=0.8, color=[0.8, 0.8, 0.8])
        Ax.semilogx(f,-np.real(Is),color='k',linewidth=4,label="$I_{Re}$")
        Ax.semilogx(f,-np.imag(Is),color='k',ls='--',linewidth=4,label="$I_{Im}$")
        Ax.semilogx(fi*np.array([1.,1.]),np.array([0,1.1*Imax]),color='r',ls='-',linewidth=3)
        handles, labels = Ax.get_legend_handles_labels()
        Ax.legend(handles, labels, loc='upper left', fontsize=FS)

        Ax.set_xlabel('Frequency [Hz]',fontsize=FS+2)
        Ax.set_ylabel('$\mathbf{- \, I_s (\omega)}$ [A]',fontsize=FS+2,labelpad=-10)
        Ax.set_title('Frequency Response',fontsize=FS)
        Ax.set_ybound(0,1.1*Imax)
        Ax.tick_params(labelsize=FS-2)
        Ax.yaxis.set_major_formatter(FormatStrFormatter('%.1e'))

        #R_str    = '{:.3e}'.format(R)
        #L_str    = '{:.3e}'.format(L)
        #f_str    = '{:.3e}'.format(fi)
        #EMF_str  = '{:.2e}j'.format(EMFi.imag)
        #I_str    = '{:.2e} - {:.2e}j'.format(float(np.real(Isi)),np.abs(float(np.imag(Isi))))

        #Ax.text(1.4,1.01*Imax,'$R$ = '+R_str+' $\Omega$',fontsize=FS)
        #Ax.text(1.4,0.94*Imax,'$L$ = '+L_str+' H',fontsize=FS)
        #Ax.text(1.4,0.87*Imax,'$f$ = '+f_str+' Hz',fontsize=FS,color='r')
        #Ax.text(1.4,0.8*Imax,'$V$ = '+EMF_str+' V',fontsize=FS,color='r')
        #Ax.text(1.4,0.73*Imax,'$I_s$ = '+I_str+' A',fontsize=FS,color='r')

        return Ax
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号