1
\$\begingroup\$

I would like to use a parametric symbol for the period value of the PULSE component in LTSpice but so far I have been unsuccessful. currently my source is:

PULSE(-15 15 0 0.1e-6 0.1e-6 0.4e-6 1e-6)

And I would like to for example change number '6' into a parameter, so then I could change that parameter if I wanted to. I tried the following but it did not work:

.PARAM f=6
PULSE(-15 15 0 0.1e-{f} 0.1e-{f} 0.4e-{f} 1e-{f})

Any solution or workaround is appreciated.

\$\endgroup\$
  • \$\begingroup\$ You can't directly modify just the exponent. The number parser won't work like that. Instead, use the available functions as part of an expression that computes the values. \$\endgroup\$ – jonk Oct 23 '19 at 13:09
1
\$\begingroup\$

What @jonk said is true, but you can "cheat" a bit by using a parametric divisor, something like this:

PULSE(-15 15 0 {0.1u/x} {0.1u/x} {0.4u/x} {1u/x})
.param x=1
.step param x list 1 10 1000

Alternately, you can make it a bit more readable by making the rest of the values parametric:

PULSE(-15 15 {td} {tr} {tf} {Ton} {T})
.param T=1u/x Ton=0.4*T tr=0.1*T tf=tr td=0 x=1

This is just one way of doing it.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Thank you for the solution (: \$\endgroup\$ – Ams Oct 23 '19 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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