Wednesday, June 19, 2013

Version 0.2.1 released

Released the next version of the simulator with diode model:
http://sourceforge.net/projects/pythonpowerelec/

As always, for questions or comments, please send me an email at pythonpowerelectronics@gmail.com

Tuesday, June 18, 2013

Diode model - loops and manipulations

For any circuit, the number of independent loops is Branches-Nodes+1. The loop finder function returns excess loops for all circuits except maybe the simplest circuits. Initially, I had removed the excess loops and assumed they were linear combinations of the previous loops. But when the circuit has a ladder structure, it may so happen that some of the essential loops appear right at the end and get thrown out.

This is what I found when I was trying to figure out why the three-phase diode bridge rectifier was not working. The only way to ensure that essential loops are not deleted is to let all of them be to begin with. With row operations, some loops will be eliminated. As and how loops are eliminated, they should be completely deleted and the system should be reduced.

So, first the loop finder function (click on "View Raw" below the code box to see the code in a new window):



The difference is in the terminating condition:
if loop_iter:
As long as loop_iter is searching, let it search. So let it add as many valid loops as possible.
The number of excess loops can be pretty huge (x6).

Next comes the main circuit_solver.py. In this, another matrix has been conceived called the system_loop_map. This is to indicate which branches are stiff so as to eliminate stiff branches from as many loops as possible. The code for this has been put together in one block (click on "View Raw" below the code box to see the code in a new window):



So essentially, for every loop there is minimal information about every branch in the circuit - if it exists and if it does, is the branch stiff.



So essentially, I use system_loops_map to make the system upper triangular as far as stiff branches are concerned. The next block I am not sure if it is needed. Whether it is necessary to make sure a stiff loop is connected to the input. I'll test it and try to get rid of it. For some reason, it looks like an ugly code block.

The last part of to reduce the size of the system by getting rid of redundant loops (click on "View Raw" below the code box to see the code in a new window):


Diode model - part I

Where do I begin? Massive number of changes. So first, the diode class (clink on "View Raw" below the code box to see the code in a new window):


Similar to many of the others. In the parameter specification, the user needs to enter the voltage level of the diode and the polarity in terms of where the cathode is.

The diode resistance changes with the status whether "ON" or "OFF". The diode is ON when it is forward biased beyond a certain threshold voltage. It turns "OFF" when current becomes negative. The ON resistance, forward bias threshold voltage and the ON drop voltage can be made user defined parameters.