0
\$\begingroup\$

I'm trying to post-process a value computed by a measure statement in ngspice (rev 26) as described in the manual:

.measure tran osct TRIG v(out) VAL=1.65 RISE=10 TARG v(out) VAL=1.65 RISE=11
.measure tran oscf param='1/osct'

osct gets measured correctly but the second one fails with:

Error: measure 'oscf'
no such function as 'param=1/osct'
meas tran oscf param=1/osct failed!

Is this a bug, syntax change, or am I simply doing this wrong?

\$\endgroup\$
0

2 Answers 2

1
\$\begingroup\$

This is a syntax error. A good way to debug syntax errors is change the input and get it to work, then find out what doesn't work. Throw in a + instead of a / and see if that works. Depending on the spice package, using maths in statements may or may not work. BTW Ltspice would handle this.

\$\endgroup\$
0
\$\begingroup\$

Read the manual, 15.4.10 par('expression'). The .meas statement for PAR='xx' requires xx to be either a .param or an expression containing nothing but constants and/or .params. In your '1/osct', osct is a value computed during the last simulation and this is explicitly forbidden.

Using the MEAS syntax (no dot) in a .control section is also possible and superior in many cases.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.