Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # coding: utf-8
- # In[62]:
- import math
- # Xd = 1.8
- # Xq = 1
- # Xid = 0.3
- # Ug = 1
- # s = 1
- # cosfi = 0.85
- #####################naiti Id Iq Eq Eiq EQ
- # Xd = 2.04
- # Xq = 0.189
- # Xid = 0.271
- # Ug = 1
- # s = 1
- # cosfi = 0.8
- ##########################
- Xd = 1.670
- Xq = 0.173
- Xid = 0.258
- Ug = 1
- s = 1
- cosfi = 0.85
- # In[63]:
- Pg = s * cosfi
- Qg = s * (1-cosfi*cosfi)**0.5
- EQ = ( (Ug + Qg*Xq/Ug)**2 + (Pg*Xq/Ug)**2 )**0.5
- # In[64]:
- z = Pg*Xq/(Ug**2+Qg*Xq)
- LamdaG = math.atan(z)/math.pi*180
- LamdaR = math.atan(z)
- # In[65]:
- Id =( Ug*math.cos(LamdaR) - EQ) / Xq
- Iq = Ug*math.sin(LamdaR) / Xq
- Eq = EQ - (Xd - Xq)*Id
- Eiq = EQ - (Xid - Xq)*(Id)
- # In[66]:
- I = (Iq**2+Id**2)**0.5
- print(Pg,Qg,EQ,LamdaG,'||',I,Id, Iq,'||', Eq, Eiq)
- # In[67]:
- Uq = Ug * math.cos(LamdaR)
- Ud = Ug * math.sin(LamdaR)
- # In[68]:
- import numpy as pn
- import matplotlib.pyplot as plt
- import seaborn as sns
- # In[69]:
- sns.set()
- def t(nameIq):
- s = nameIq+' = '+str(eval(nameIq))[0:6];
- return s;
- conn_style=[
- t('Id'), t('Iq'), t('I'),t('Uq'),t('Ud'), t('Ug'),t('EQ'),t('Eq'),
- ]
- # In[70]:
- ss=-0.02
- #Lamda =39.1/180*3.14
- x=Eq*math.cos(LamdaR); y=Eq*math.sin(LamdaR); plt.text(x, y, "Eq")
- plt.quiver(0,-ss*2,x,y-ss*2, scale_units='xy', angles='xy', scale=1, color='r')
- x=EQ*math.cos(LamdaR); y=EQ*math.sin(LamdaR); plt.text(x, y, "EQ")
- plt.quiver(0,ss,x,y+ss, scale_units='xy', angles='xy', scale=1, color='g')
- x = Ug*math.cos(LamdaR)**2; y = Ug*math.cos(LamdaR)*math.sin(LamdaR); plt.text(x*0.8, y*1.3, "Uq")
- plt.quiver(0,ss,x,y+ss, scale_units='xy', angles='xy', scale=1, color='c')
- x = Ug*math.cos(math.pi/2 - LamdaR)*math.sin(LamdaR); y =-Ug*math.cos(math.pi/2-LamdaR)*math.cos(LamdaR); plt.text(x*0.8, y*1.3, "Ud")
- plt.quiver(0,ss,x,y+ss, scale_units='xy', angles='xy', scale=1, color='c')
- x = Ug; y = 0; plt.text(x*1, y*1.3, "U")
- plt.quiver(0,ss,x,y+ss, scale_units='xy', angles='xy', scale=1, color='c')
- fi = math.acos(cosfi)
- I = (Iq**2+Id**2)**0.5
- x=Iq*math.cos(LamdaR); y=Iq*math.sin(LamdaR); plt.text(x*0.8, y*1.3, "Iq")
- plt.quiver(0,0,x,y, scale_units='xy', angles='xy', scale=1, color='YELLOW')
- x=-Id*math.sin(LamdaR); y=Id*math.cos(LamdaR); plt.text(x*0.8, y*1.3, "Id")
- plt.quiver(0,0,x,y, scale_units='xy', angles='xy', scale=1, color='YELLOW')
- #y=-I*(1-cosfi*cosfi)**0.5*math.cos(Lamda); x=I*cosfi; plt.text(x, y, "I")
- #plt.quiver(0,0,x,y, scale_units='xy', angles='xy', scale=1, color='YELLOW')
- x = (-Id*math.sin(LamdaR)+Iq*math.cos(LamdaR)); y=(+Iq*math.sin(LamdaR)+Id*math.cos(LamdaR)); plt.text(x, y, "I")
- plt.quiver(0,0,x,y, scale_units='xy', angles='xy', scale=1, color='YELLOW')
- x = Ug*math.cos(math.pi/2 - LamdaR)*math.sin(LamdaR); y =-Ug*math.cos(math.pi/2-LamdaR)*math.cos(LamdaR); plt.text(x*0.8, y*1.3, "Ud")
- plt.quiver(0,ss,x,y+ss, scale_units='xy', angles='xy', scale=1, color='c')
- m=-0.12
- for i in range(8):
- plt.text(0, 1.4+m*i, conn_style[i])
- plt.xlabel("U = 1; S = 1 – значения взяты в относительных единицах")
- plt.ylabel("U = 1; S = 1 – (о.е.)")
- plt.title("Иллюстративная диаграмма синхронной машины")
- plt.xlim(-0.1,2.5)
- plt.ylim(-1,1.5)
- plt.show
Add Comment
Please, Sign In to add comment