Basic implementation of @assume in CIR

agent on 2005-04-16T09:10:29

=from 2005.4.15.2:15.PM =to ...4.15.2:50.PM

This morning I promptly implement the new_layer and bye_layer functions for CirSys.pm and later add the @assume and @end_assume directives to the CIR language. For simplicity, I didn't introduce an ad hoc module specially designed to deal with math model in the current version (0.07) of CirSys. I plan to move most of the code concerning equation and variable management in CirSys.pm into an independent module named Math::Model in the next version. The core of the CirSys library thus will be cleaned up.

Currently wire definitions and element declarations are prohibited within @assume blocks. For example, the following CIR code is considered invalid at this moment:

@assume A, B: Vs2 Resistor R1, R2 B, C: R1, R2 @end_assume

However, this will eventually work in the next version of dc CirSys when I implement the ->destroy method for the Wire and Elem classes respectively. It can't be too difficult, I think.

With basic @assume support on hand, I'm able to get all the 60 test cases gleaned earlier working in my tester now. But I can't promise any further that subsequent circuit problems for Thevenin's Theorem will also work without complete support of assuming and backtracking.

There's no doubt that the CIR language is getting more and more mature. :P See you tomorrow!