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!

Related Questions

Bldc motor braking

1  Asked on December 26, 2021 by tec-hub


Boost converter to high voltages (20 kV+)

1  Asked on December 24, 2021 by the-amateur


Tuning of a PID loop for heater element

1  Asked on December 24, 2021 by elagil


Problems getting correct readings from ACS71020

3  Asked on December 24, 2021 by felipemb


Proper use of the ENC28J60 Ethernet controller

1  Asked on December 24, 2021 by sukkopera


Why is this circuit using a branched 5V wire?

1  Asked on December 24, 2021


Current adder or voltage adder

3  Asked on December 24, 2021


how to reproduce a matching network of a vendor

3  Asked on December 22, 2021 by legen-diary


Using LM2596 step down with LiPo

2  Asked on December 22, 2021 by quang-minh-l


Ask a Question

Get help from others!

© 2022 All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir