KB: Parameterize values of circuit elements with formula in mixed-signal simulation

Altium Designer Altium Designer
Starting in version: 22 Up to Current

Values of circuit elements such as resistance can be expressed as a formula referencing other parameters in Text Frame object in mixed-signal simulation schematic.

Solution Details

User defined parameters/formulas can be specified by placing a text frame object with its first line '.nsx' which is compiled as a part of Spice netlist to be simulated.  Place » Text Frame with its first line '.nsx' which is compiled as a part of Spice netlist to be simulated.  Following standard Spice syntax, a line starting with '.param' indicates parameter declaration, and if line change is desired for multiple parameters, the lines following can be prepended with plus character '+'.
https://www.altium.com/documentation/altium-designer/working-with-spice-netlist#!areas-of-spice-user-code

If you prefer to keep the schematics clean, you may opt to define them as global parameters in Simulation Dashboard panel, under Analysis Setup & Run section, Settings button, on Global Parameters tab:
https://www.altium.com/documentation/altium-designer/configuring-running-simulation#!global-parameters

Starting with AD22.6, there is an sample project bundled at the time of installation at the path C:\Users\Public\Documents\Altium\AD22\Examples\Simulation Quick Start, where, for example, 5_Changing the gain.SchDoc contains the usage of such parameterization.
https://www.altium.com/documentation/altium-designer/new?version=22#!key_highlights_22_6:~:text=Circuit%20Simulation%20Improvements-,Simulation%20Examples,-A%20set%20of

Below section of our manual describes all functions/operators supported: https://www.altium.com/documentation/altium-designer/configuring-running-simulation#available-functions

A few words of caution on the use of Spice user code in the text frame object is that commands such as .op, .tran, .ac, .control are ignored intentionally, as it can interfere with those specified in Simulation Dashboard panel.  Users who need such an advanced control over the SPICE better type it into a netlist and run the netlist directly.  Please refer to another article how this is done: https://www.altium.com/documentation/knowledge-base/altium-designer/run-mixed-signal-simulation-off-of-netlist-generated-externally-to-compare-the-results-from-other-engines-directly

If you find an issue, select the text/image and pressCtrl + Enterto send us your feedback.
Was this article helpful?