TransWikia.com

Correct usage of curly braces in Spice

Electrical Engineering Asked by QF0 on November 8, 2020

When are you required to use {} braces around an expression, and when can you optionally use braces? I realise that this is simulator-specific, and different simulators seem to have different requirements. I think that the original ‘correct’ answer would have been that only parameter names, or alternatively expressions which include a parameter name, should have braces around them, but I’m not sure, and any sim-specific replies would be useful.

One Answer

The usage for SPICE 3f3 is defined by the manual for SPICE 3f3. The usage for LTSPICE is defined by the manual for LTSPICE. The usage for PSPICE is defined by the manual for PSPICE.

These are three different programs and their authors have defined different syntax for mathematical expressions.

You should not expect LTSPICE or PSPICE to follow the SPICE 3f3 syntax, or to match each other.

Ngspice is actually based on the SPICE 3f5 code-base, so it is more likely (but not guaranteed) that ngspice syntax will be similar to SPICE 3f3.

It's unfortunate, but something that you'll have to live with, that there is no official standard defining SPICE syntax, and particularly in the area of mathematical expressions different SPICEs have different syntax.

The 'correct' usage is presumably defined by Spice 3f3 or similar, but the stuff I can find online is not clear what 3f3 requires.

After reading the Spice 3f3 manual I believe the reason for this is simply that Spice 3f3 doesn't allow parameter substitutions in many of the places that newer SPICEs do. For example, you can not use a math expression to define the BETA parameter of a BJT.

There is an "interactive interpreter" that allows you to use expressions to modify model parameters using expressions through a command-line interface after loading the model, but no syntax to allow using such expressions in the initial circuit definition in the SPICE "deck".

Answered by The Photon on November 8, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP