Simulating simple electric circuits

Bjoern Schliessmann usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Fri May 11 17:02:01 EDT 2007


Dave Baum wrote:
 
> Sounds reasonable.  Depending on the size of your network, I might
> not worry too much about precomputing and saving information.  

Thanks. Yes, I'm actually testing it presently without any
optimizations and it runs very well.

> If your circuit has loops in it (where the output of a later relay
> circles back to an earlier relay's coil), then it is possible for
> the circuit to oscillate, so you might have to be careful about
> this.  

That's no substancial problem, with real relay circuits this happens
sometimes too :) (even in the systems I'm modelling)

After all, I'm quite pleased now with how well the last approach I
mentioned works. I've been able to model a medium complex switching
sequence today, and it worked flawlessly.

(The only problem I have now arises when I make relays react
delayed, using Twisted's reactor.callLater. Sometimes, a relay gets
current and loses it shortly after, but the event loop in rare
cases executes the status change functions the other way round ("no
current", then "current"). I've been trying to fix that by
detection if a timer already runs. Anyhow, the inconsistencies only
vanish if I let the relays react delayless again. I'm going to have
to look into this further ...)


Regards,


Björn

P.S.: If anyone happens to be interested in details, just ask, I'll
post some code.

-- 
BOFH excuse #319:

Your computer hasn't been returning all the bits it gets from the
Internet.




More information about the Python-list mailing list