The Switch-Resistor Circuit Analysis Program

Providing input to the program

The program for analyzing switch-resistor circuits takes as input a textual 'netlist' file, in a 'spice'-like format. That means:

You can create such a text-file with your familiar text editor ('notepad'??), or with a real schematic editor. I used Micro-Cap for this purpose. You can cut-n-paste the created text into the text-box below.

If appropriate for your circuit, you choose a small value for the max nr switches set. (For the 'rotary switch' example this would be 1, indicating that you intend to close only one switch at a time. This saveguards you for an explosion of the amount of program output.

Your beginners example is:

R1   1 2 1K
R2   2 0 1K
Vin  1 0
Vout 2 0
  

And the example circuits from the circuits page: rotary switch, logarithmic ladder, 2-stage pot.

Run the program

Sorry, APPLET tag not understood!

Capture the program output

After pressing the compute button, the program will create its textual output in a new window.

It will provide some feedback on the read circuit. If no errors are detected, a line of ===== is printed, followed by the computed circuit behavior. There is a header line with names, and one subsequent line with numbers for every switch open/close combination. Although the formatting might seem to be messed-up, all these lines together form a table. Table entries per line are separated by tab characters, allowing cut-n-paste of a properly formatted table in a real text editor.

The program assumes a source-resistance for Vin of 0 ohm, and no load resistance connected to Vout. You might want to add such resistances to the circuit.
To avoid numeric exceptions in processing the output, two precautions are implemented:

To create graphical output, you copy the data into Excel as follows:

So far with this Excel course....

Success with your own circuits!

(An interesting site with free software tools for Electrical Engineering is Greg's downloadpage.)


Jos van Eijndhoven, January 2004,
Back to the Switch-Resistor page, Back to my home page
-- For this program I used SUN's Java2 SDK (1.4.2), and a great freeware JCreator LE (2.5) development tool