Should the names of components be case in-sensitive in expressions? #43
-
Should the names of components be case in-sensitive? In a lot of Spice simulators, they are, so if you're using a netlist generated by some program, you might have mixed case between circuit elements and expressions. I personally had to deal with this. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @DeadTomGC , Spice#.Behavioral will (or should) copy the behavior from the circuit and simulation it is working with. To make the name of entities/components case-insensitive, you have to specify an var ec = new EntityCollection(StringComparer.OrdinalIgnoreCase);
var circuit = new Circuit(ec); // Only necessary if you want circuit operations In order to have case-insensitive node-names, you would have to specify a comparer for nodes in the I took the liberty to open an issue in Spice# here. |
Beta Was this translation helpful? Give feedback.
-
I started off using that parser, but it didn't support the features I needed most for the work I was doing since it wasn't quite up-to-date. but I still appreciate all the work that's gone into all 4 of the associated projects. I've learned a lot from all of them. |
Beta Was this translation helpful? Give feedback.
Hi @DeadTomGC ,
Spice#.Behavioral will (or should) copy the behavior from the circuit and simulation it is working with.
To make the name of entities/components case-insensitive, you have to specify an
IEqualityComparer<string>
when creating theEntityCollection
that stores the components. Any simulation that is run using this collection will use that comparer.In order to have case-insensitive node-names, you would have to specify a comparer for nodes in the
BiasingParameters
of a simulation. However, after looking into your question I can see t…