Order Amongst Chaos: Three Phase Power
Created From Bing AI Image Generator

Order Amongst Chaos: Three Phase Power

Animated 3 Phase Sinusoidal Waves, link to code below


Nearly a decade ago, an immigration officer at the Washington Dulles Airport was looking at my papers and saw that I was coming to the country for a Masters Degree in Electrical Engineering at the Virginia Tech Bradley Department of Electrical & Computer Engineering .

To my surprise, the officer began asking me questions about the difference between Star and Delta Three phase power, and the pros/cons of each system. Not something I was expecting to be asked at the airport!

Turns out he had taught courses in that field previously. I answered the questions well enough that the officer let me through(Phew!) a lot of that thanks to the strong EE curriculum offered by Vellore Institute of Technology , where I did my Bachelors.

Now in 2023, as I am studying for my Advanced Electrical Certification from American Boat and Yacht Council (ABYC) (My third and final one for this year), I've noticed that there is a significant emphasis on three phase power for this course.

Of late, I've also been been keen to explore function animations through python, credit to Bingsen Wang, PhD , Raibatak Das , and Nicholas Hemenway for the inspiration to do the same. Will put some of their articles/posts in the references section below.

The objective of this article, is for me to

  1. revisit the topic,
  2. Learn some more python along the way.
  3. Share what I did, from resources available publicly.

1. Circuit And Assumptions

For this example, We'll use a 3 Phase Voltage connected to a 3 phase load of constant impedance. US voltage values are used to work out some numerical examples The voltages are each single phase 120V split phase sine waves with a frequency of 60Hz. The voltages are separated from each other by a phase of 120 degrees, and the load causes a further phase shift on the current produced.

Multiplying the voltages with their respective currents and summing them up results in a constant power equation (assuming a balanced load, and constant impedance).

Also, assuming a 3 Phase Load with a resistance of 2ohms, and a reactance of 2-easier to see the phase lags between the voltage and current.

2. Code And Learning

Link to Code below

https://github.com/pramitbaul1/python-code-electrification/blob/d0e27d57f0902d9356f4823fc6cd5af855b2ce83/ThreePhaseAnim.py

Sharing a few snippets of the code which was critical learning for me.

Creating the 3 phase sine wanes, 120 degrees apart (pi/3 radians)

f1 = lambda x: np.sin(x)
f2 =lambda x: np.sin(x-np.pi*2/3)
f3 =lambda x: np.sin(x-np.pi*4/3)
x = np.linspace(-np.pi*9/4, np.pi*9/4, 100)        

Setting up the x-axis Labels to show up visually as multiples of pi

ax_power.set_xticks([-np.pi*2,-np.pi*3/2, -np.pi, -np.pi/2, 0, np.pi/2, np.pi, np.pi*3/2, np.pi*2])
ax_power.set_xticklabels((r"-$2\pi$",r"-$3\pi/2$",r"-$\pi$", r"-$\pi/2$", "0", r"$\pi/2$", r"$\pi$", r"$3\pi/2$",r"-$2\pi$"))        

Defining the animated sine wave

def sine(i):
    #Plotting Voltage Waves Sequentially, adding a marker
    uVolts_plot.set_data(x[:i],u_volts[:i]) 
    dot_uVolt.set_data(x[i],u_volts[i])        

The data is plotted sequentially, though I do get a warning about how using the set data function this way is going to be removed from python soon (if anyone has ideas on how to rewrite this part let me know)

Using the FuncAnimation to animate the plot

anim = animation.FuncAnimation(fig, sine, frames=len(x), interval=50)
anim.save('basic_animation.gif')        

This function calls the sequence of data from the sine function and the figure subplots i set up to create the animation. Also put in an option to save the resulting animation as a gif (which is what I added in the article.)

References

  1. - Bingsen Wang, PhD https://www.dhirubhai.net/posts/bingsen-wang-phd-3b062b231_csi-powerelectronics-python-activity-7086287832209633280-LoGk?utm_source=share&utm_medium=member_desktop
  2. Raibatak Das -Animations with matplotlib 1: Making waves | Raibatak Das (dododas.github.io)
  3. Nicholas Hemenway -Python for Science and Engineering | Python in Plain English


Nicholas Hemenway

Electrified Powertrain Engineer

1 年

Nice animation ?? One suggestion: consider using a shared x-axis and remove the titles in favor of a y-label for each axis. Both of these will free up vertical space (which is at a premium). Otherwise good work! Looking forward to more articles ??

回复
Raibatak Das

Founder and Scientific Director, Quantilogix LLC

1 年

Very nice animation!

回复
Pramit Baul

Motorcycle SW | Transportation Electrification |EB2-NIW Recipient

1 年

120 degrees is 2pi/3 radians instead of pi/3 in the "Code and Learning" section. Thanks to Dev Baul for catching it!

Maurice Marchand

Lecturer in Marine Technology at H. L. Stoutt Community College

1 年

Congratulations Pramit. Even though that coding stuff is beyond me.??

要查看或添加评论,请登录

Pramit Baul的更多文章

社区洞察

其他会员也浏览了