loop in netlist

Discussion in 'Homework Help' started by yoyo1987, Aug 17, 2014.

  1. yoyo1987

    Thread Starter New Member

    Apr 24, 2014
    hi everyone,
    I built a circuit with netlist in PSPICE, and I put it in a library.
    I cascaded a few of these circuits like this:

    xsub1 1 2 FILE
    xsub2 2 3 FILE
    xsub3 3 4 FILE

    my question is, is there a way to use a loop (something like a "for" in programing)

    so that I would be able to cascade 100 of these circuits without needing to write them all manually?

  2. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    I don't think Spice has that feature, but perhaps you could use a Print loop in any dialect of Basic to create the text, then copy/paste it into the netlist?
  3. MrAl

    Distinguished Member

    Jun 17, 2014

    I dont think spice has that feature either, but depending on the complexity of the circuit and what kind of circuit it is, you may be able to use network theory itself to mimic the behavior of several circuits acting together. It really depends highly on what kind of circuit it is though, and if it can be decomposed into a two port network for example it may be possible even for more complex circuits.

    If you show your circuit we may be able to come up with something. For example, to mimic the behavior of 1000 LED's in series all it takes is one LED model symbol in the schematic and one or two dependent sources. To do the same with the LED's in parallel, the equivalent circuit is arranged a little differently, but in either case it only takes one instance of the model itself and a few other things added that are common in spice.