Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

agent (5836)

agent
  agentzh@yahoo.cn
http://agentzh.spaces.live.com/

Agent Zhang (章亦春) is a happy Yahoo! China guy who loves Perl more than anything else.

Journal of agent (5836)

Saturday April 16, 2005
04:10 AM

Basic implementation of @assume in CIR

[ #24223 ]

=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!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.