Spice definition of resistor/capacitor

capacitorresistorsspicetransient

I am trying to understand a Spice definition of a circuit and transient analysis on it. I have kind of "inherited" this and can't ask the original creator; my Spice memories from university are pretty rusty, and online manuals have not been of much help.

What I don't understand is the first segment here (snippet of whole file):

.define c1 6926.0 6233.4 7618.6
.define r1 0.16661 0.149949 0.183271
....
il   0 98 dc 0 ac 0 pwl (0s 1720.0a ... 6233s 1718.0a 6925s 1728.0a 7618s 1718.0a ....)
...
c01  1 0 [c1] ic= 89.974
r01  1 2 [r1]

In the third segment, I understand that capacitor c01 is defined as lying between nodes 1 and 0 and has initial conditions as given; resistor r01 is situated between nodes 1 and 2.
In the second segment, a piecewise linear current source is defined, with ampere values associated with timestamps.

What does the first segment define? The values next to the capacitor seem to be the timestamps from the current source, but why are they used for defining the capacitor/resistor?

I can provide other details as needed, but didn't want to clutter the post too much with useless information.

EDIT: The suggestion given below in comments is good, but my original question still stands. Is this not standard Spice, since no manual mentions it?

Best Answer

Google search found that Micro-Cap Spice simulator does allow for .define keyword to be used.

I understand that .define could be omitted from the code you showed with the following change:

il   0 98 dc 0 ac 0 pwl (0s 1720.0a 692s 1726.0a 1385s 1716.0a 2077s 1720.0a 2770s 1726.0a 3463s 1724.0a 4155s 1712.0a 4848s 1720.0a 5540s 1724.0a 6233s 1718.0a 6925s 1728.0a 7618s 1718.0a ....)
...
c01  1 0 [6926.0 6233.4 7618.6] ic= 89.974
r01  1 2 [0.16661 0.149949 0.183271]

However, I've never seen this kind of syntax with square brackets (it neither seems to be supported by Micro-Cap). My guesses for this syntax are:

  • Parameters value to be swept in simulation. If this is the case then I'd expect the simulator to sweep the value of \$r01\$ for each value of \$c01\$
  • As suggested by Andy Aka this could be a part of Monte-Carlo analysis syntax. However, if there are no additional Monte-Carlo commands in this file - I'd say that this is not the case.
  • Some kind of randomization syntax - the value of the component will be generated randomly from the distribution characterized by the numbers in the brackets.

I can try to narrow down the options (or provide additional ones) if you provide some more information.

Hope this helps.