Sunday, May 5, 2013

Current Source

This current source turned out to be a little more tricky that I thought because I was looking for an elegant solution, something with cool network tricks or that uses object oriented programming inheritance techniques. Ended up using the easiest way - model the current source as a voltage source in series with a resistance. The end result is a little dirty - calculate one temporary value to update another temporary value. This is evident from the glitches in the first quarter cycle. Will have to test how this works particularly in an inductive-capacitive circuit. So nothing final yet.

Been a while since I released a version, so I am going to release it soon. Also, the next step will be to move on to version 0.2.0 which will look at structural changes to the code that will bring in error messages and directions of usage.

Anyway, here is the code (click on "view raw" below the code box to see it in a new window):



No comments:

Post a Comment