AnswerBun.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!

Related Questions

Using the fast adders circuits in FPGA

1  Asked on February 1, 2021 by yogi-bear

     

Crosstalk in PCB layout

1  Asked on February 1, 2021 by walid24

       

problem assigning a zero-length array port in vhdl

1  Asked on February 1, 2021 by kjgregory

 

Basic ternary circuit to light three LED’s?

5  Asked on January 31, 2021 by isynthetixx

   

Digital gain control with a digital pot?

4  Asked on January 31, 2021 by vini_i

 

ESD clamping voltage in SIMCard interface too high

1  Asked on January 30, 2021 by cbagusjk

   

where is the /models folder in the eagle directory?

0  Asked on January 30, 2021 by user2

   

SPDT Switch in Logisim

2  Asked on January 30, 2021 by shriekyphantom

   

STM32F4 SPI Tx Data Register Problem

0  Asked on January 30, 2021 by ihk

   

Raising Amperage

3  Asked on January 29, 2021 by terrel-ross

   

Schematic for a lipo battery bleeder overcharge protector

2  Asked on January 28, 2021 by dylan-873

         

PCB Design Review: Impedance Matching & Termination Resistors

2  Asked on January 28, 2021 by codemonkey

   

Ask a Question

Get help from others!

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