-
-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
W(CSW) is not working #2
Comments
@cvgaviao , It is not a bug. There are indeed missing parameters. Current controlled switches require definition of controlling source and modelcard (
|
Also SPICE notation should be used for SPICE-only devices. For example SPICE doesn't support measurement units (like Ohm) and has a different prefix system ( |
(Edited: Sorry, I was typing my response at the same time as ra3xdh was typing his, and didn't see his before submitting mine) Several things here:
So instead of putting all of your parameters into the W device's dialog box (W, W_Line_2, etc.), put them into a ".MODEL Section" element with the contents ".model myswitch csw (It=0.01 Ih=0 RON=100Ohm ROFF=10MEGOhm)" and then change your W device specification in Qucs-s to have a first line that contains the name of a voltage source whose current should be used to determine the switch state, and a second line with "myswitch" on it. (You could stuff 'em both on the same line, I suppose). Qucs-s will then generate a legal ngspice line for the switch. If you want to run it in Xyce, you'll need to modify the switch model card to be of type "iswitch" and use a set of legal parameters for Xyce's switch (which will be different than ngspice's). |
Actually, standard SPICE3F5 ignores everything after a number that it doesn't recognize as a multiplier. So specifying a resistor as "1MEGOhm", "1MEGFarad", "1MEGHenry" or "1MEGBogus" are all the same as specifying it as "1MEG". Xyce also follows this rule. I assume, since ngspice is based on SPICE3F5, that it probably also follows this behavior. It is still safer just to leave off units, so they can't be misinterpreted. For example, if you specify a huge capacitor as a "1Farad" cap, it'll actually be interpreted by SPICE as a 1e-15 because it'll see the "f" and think "femto." This same issue is why Xyce doesn't support "a" as an "atto" multiplier --- many legacy netlists and model cards have units of Amp specified in current sources and device parameters on the assumption that SPICE would just ignore it, and so we can't let "a" mean "1e-18" or all of those old netlists will be unrunnable. The 1M vs. 1MEG thing is really important, though --- because SPICE netlist parsing is case-insensitive, "1M" and "1m" both mean 1e-3. |
Tried to use the spice switch W in a small circuit. And couldn't find a way to make it to work with both ngspice and xyce.
I used the format that is indicated in the Ngspice manual:
But both xyce and ngspice complains about it.
Relay.txt
The text was updated successfully, but these errors were encountered: