Pankaj(ADS)

Featured post

Python Codes for Electric Potential

Python Codes for Electric Potential Code:- import numpy as np import math import matplotlib.pyplot as plot ''' Calculating Elect...

Thursday 23 July 2020

Python-State Space Analysis(3-phase I.M)

0 comments
Python Program -(3-phase Induction Motor)

State Space Analysis


Python Code:-
import numpy as np
import scipy as sp
import math
import matplotlib.pyplot as plot
'''------------Pankaj Aswal-------------
            Induction Motor
    *---------*State space Anaysis*----------
---------------------------------------
'''

pi= math.pi
th = 0
n_1 = 2
n_2 = 3
K_0 = 0.5
K_t = (n_1)/(n_2) 
a = (K_t) * np.array([[[math.cos(th), math.cos(th - (2*pi)/3), math.cos(th - (4*pi)/3)],[math.sin(-th), math.sin(-th + (2*pi)/3),math.sin(-th + (4*pi)/3)],[K_0, K_0 , K_0]]]) 
b = (K_t) * np.array([[[0,0,1],[0,1,0],[1,0,0]]])
x = np.rad2deg(a,b)
print(x)
i_r = (x[0])*2*pi
print("i_r: ", i_r)
i_b = (x[0])*2*pi*(1/3)
print("i_b: ", i_b)
i_y = (x[0])*2*pi*(2/3)
print("i_y: ", i_y)
origin = [0],[0]
plot.quiver(i_r[:,1],i_b[:,0],i_y[:,-1],color=['r','b','g'])
plot.show()

Output
1.>>> 
============= RESTART: D:/Desktop/Python(TUT)/InductionMotor.py =============
[[[ 38.19718634 -19.09859317 -19.09859317]
  [  0.          33.07973373 -33.07973373]
  [ 19.09859317  19.09859317  19.09859317]]]
i_r:  [[ 240.         -120.         -120.        ]
 [   0.          207.84609691 -207.84609691]
 [ 120.          120.          120.        ]]
i_b:  [[ 80.        -40.        -40.       ]
 [  0.         69.2820323 -69.2820323]
 [ 40.         40.         40.       ]]
i_y:  [[ 160.          -80.          -80.        ]
 [   0.          138.56406461 -138.56406461]
 [  80.           80.           80.        ]]
2.Scope


No comments:

Post a Comment