Monday, July 21, 2014

Revised nodal analysis

When must nodal analysis take place?
  1. When there are inductors with sufficient energy and that energy might be abruptly interrupted.
  2. When does an inductor have sufficient energy? When it has been in at least one non stiff loop in the previous iteration. This way, the circuit is power independent.
The code is below (click on "view raw" below the code box to see the code in a new window):

The process is as follows:

  1. In the beginning, a new branch event is assumed by default whenever a branch event occurs.
  2. Look if there are any inductors that have previously been in non stiff loops.
  3. If so, nodal analysis is required.
  4. Following nodal analysis, check if there is a continuity event with branch currents from nodal analysis being different from the branch currents from previous iteration of loop analysis.
  5. If so, execute the determine_state function to check if any of the elements will change their state. If any of the elements do change state, the respective branches will have branch events.
  6. Check if there are any branch events that had not occurred in the previous iteration. If so, go back to step 2.
  7. This will repeat until no new branch events occur.

In nodal analysis, there has been one significant change. In order to perform nodal analysis, it is essential to calculate the node voltages. So the entire circuit has to be solved. However, the branch currents will be calculated only if:
  1. At a node, check if there has been an branch which has a "hard" event.
  2. A hard event is when a switch turns on or when it turns off while carrying a non negligible current. When a switch or a diode turns off when the current goes negative, that is a soft event. When a diode turns on when it is forward biased, it is a soft event.
  3. If a single branch incident at a node has a "hard" event, the currents of all the branches incident at the node will have to calculated. If not, the branch currents remain at their initial values - either zero or a current it is an inductor.
The code is below (click on "view raw" below the code box to see the code in a new window):

There has been another tag created called function_purpose. When determining state, function purpose will only calculate branch currents at nodes where there has been a "hard" event. But while calculating currents before the next loop analysis, all branch currents will be recalculated.

No comments:

Post a Comment