El Diumenge, 26 de maig de 2013, en/na al davis va escriure: > On Saturday 25 May 2013, Orestes Mas wrote: > > All elements are in series, so clearly I(Vg)=-I(L1) > > But instead, the first output value of I(Vg) is -900kA, and > > should be zero. Current through the inductor is OK. > > > > This does not happen if "UIC" is removed from TRAN command. > > Why? Are voltage independent sources using initial > > conditions internally? > > "It's Not A Bug, It's A Feature!" > > Spice avoids the problem by not printing anything for time=0 > when you do UIC. Gnucap plainly shows that UIC is screwed up, > as it implements bug-for-bug compatibility. > > UIC does not give reasonable results, by design. It just makes > all voltages zero, jam sets capacitor and inductors initial > conditions without regard to consequences. Think of it as > jamming a bunch of ideal voltage and current sources into the > circuit. > > The purpose of UIC is so you can do a transient analysis on a > circuit that does not have a stable DC operating point. > > In this case, with option short=10u, it is shorting the 9 volt > voltage source, and correctly reporting a current of 900 > kiloamps.
I must confess I'm a bit lost here, due to the fact I'm not aware of some simulator internals. I know that to do transient simulations one must use transient sources, perhaps a PWL 0,0 1n,8 in this case. But the students tend to use DC source + UIC to simulate step responses as they seems to consider this way "conceptually easier". This problem arose when I was reviewing a student's exercise where she printed out the current through the DC source along with the inductor's current. I simply used UIC because I wanted to start with zero current in the inductor. If I don't do that the simulator calculates the DC operating point on its own and But wait... Are you meaning that if one wants to do a transient simulation should use only transient sources? perhaps a PWL 0,0 1n,8 in this case? > > > Ah, I nearly forgot it: I'm using Gnucap 2009.12.07 RCS > > 26.136. Not tested with stable release. > > You might want to upgrade .. the latest snapshot is 2013.04.23 > RCS 26.138. Yes, I know, and I'll do, but we've about 300 students here and definitely I don't want to upgrade their simulator version (and teacher's one) until the term is over. -- Thanks Orestes. _______________________________________________ Help-gnucap mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-gnucap
