Saturday, May 26, 2018

YouTube playlists and lecture series on using the simulator

I reorganized my YouTube channel into playlists:
https://www.youtube.com/channel/UCxVbKNK18A_a9Ohd0Kb7kNA/playlists

So now there is a playlist for every topic rather than just a collection of videos. I am trying to break the videos up into pieces as it is easier to record them and also upload them on YouTube. A playlist ensures everything is in order inside a topic.

Recording videos has been a learning experience. I am gradually getting the hang of using recording and editing software. I use Kazam in Linux to record the screen while programming or going through slides. I use Kdenlive to edit the videos. Initially the videos needed only a clipping of the last extra seconds. Now I need to boost up the volume as I find the volume is quite low. Also as simulations will get longer, it will be needed to pause the video often and that means cut out parts that are just pauses.

The first major lecture series is one on how to use the circuit simulator web app version. How to install the circuit simulator is a separate playlist:
https://www.youtube.com/watch?v=JRKUenYBIA4&list=PL-_jTul4we2SJqPHEANecXJXDFRztsGHM

This playlist contains videos on how to install Python Power Electronics in Windows and Linux.

The lecture series on how to use the simulator should be watched after you have installed a version of the circuit simulator on your system.
https://www.youtube.com/watch?v=Vv0wYq0BPsU&list=PL-_jTul4we2TFRLC8KZcxOMrqhRzI0J3Y

The circuit chosen is a single-phase diode bridge rectifier with a dc capacitor at the output. The load consists of a constant resistor load and a switched resistor load. The first part of the lecture series describes the simulator without using any control functions. The latter part of the simulator describes how to write control functions. The main emphasis here is on the special variables that can be defined with control functions and how they are to be used.

As time goes on more detailed simulation results will be described in the videos. For now the above tutorial is to get you started with Python Power Electronics so that you can use it for your own projects. The video lecture references two short papers that are available on my website:
http://www.pythonpowerelectronics.com/contents/papers/timing_scheduler.pdf
http://www.pythonpowerelectronics.com/contents/papers/control_structure.pdf

And of course for details on the simulator and how control functions are processed or the user interface is handled, check out my book:
https://www.springer.com/gp/book/9783319739830

The book contains entire chapters on user interface, control functions and an entire example on how to simulate a reactive power compensator for a three-phase distribution system.

Making videos is fun and I will continue making them. I feel that videos engage people much more than documents or even slide shows. Stay tuned for more videos on the YouTube channel:
https://www.youtube.com/channel/UCxVbKNK18A_a9Ohd0Kb7kNA

For continuous news and updates, follow my Facebook page:
https://www.facebook.com/pythonpowerelectronics/

Wednesday, May 2, 2018

Releasing the command line version compatible with Python 3

So finally I started with migration to Python 3. Find the download link:
http://pythonpowerelectronics.com/contents/softwaredownloads.html

It wasn't too tough a migration. Mainly the print statement have become functions. So a lot of editing of these statements. Another change which I can't quite understand the necessity of was that raw_input function to get inputs from the user has been removed and an input function is available instead. A more subtle change and this is something which can cause errors to crop up much later is the nature of division.

In Python 2, dividing an integer by an integer yields an integer. So 5/2 will produce 2. In most languages it is the same. To produce exact division, you would have to write 5/2.0 or 5/(2*1.0) etc. Basically one of the operands must be a float. But in Python 3, 5/2 will produce 2.5. To produce an integer result, this would have to be an integer division 5//2.

I many of my loops I use integer division to iterate up to the mid-point of an array. I changed in a couple of places the regular division to integer division or else the for-loop throws an error because the index cannot be a float. But errors are expected later as there a number of such for loops which act on special conditions and it would take a vast number of different circuits before all these loops are discovered and changed.

The next step is to migrate the Django based web app to Python 3. Until then feel free to download and check out the CLI above with Python 3 with your circuits. And please do report errors so that I can fix bugs.