0
\$\begingroup\$

Setup

I am trying to run a parameter sweep in LTspice in order to generate STDP curves for a memristor.

I'm doing this by sweeping a time-delta parameter dT between -50 and +50 ms, in order to run 100 transient analyses with the "post-synaptic" voltage source shifted w.r.t. to the "pre-synaptic" at each one. enter image description here

.param dT=-50m
.step param dT -50m 50m 1m

The pulse that is seen around 200 ms is to read the current through one of the probes of the device I'm measuring.

The problem

I would like to sample each of the simulations by taking the current at one of the electrodes of my device at 206 ms, in order to compile them into a classical STDP graph with dT as x-axis and current as y-axis. enter image description here

Solution:

.meas res find ix(u1:te) at 206m did the trick to be able to measure the current through the device. I was then able to plot my quantity of interest by View > Spice Error Log > Right click on res > Plot step'ed .meas data . enter image description here

\$\endgroup\$
6
  • 1
    \$\begingroup\$ I haven't read what you wrote well enough to feel I understand all of it. But have you looked at the .MEAS card, yet? \$\endgroup\$
    – jonk
    Sep 20, 2021 at 9:44
  • 1
    \$\begingroup\$ I have and I was thinking of using .MEAS <probe> AT 206m. Does that make sense? \$\endgroup\$ Sep 20, 2021 at 10:36
  • 1
    \$\begingroup\$ @ThomasTiotto You're on the right track, but you'll have to use something in the lines of .meas <probe> find <quantity> at 206m, where <quantity> can be either time or any signal or math with signals (i.e. v(out)**2). Then open up the error log, RClick and select plot step'ped data (or similar). \$\endgroup\$ Sep 20, 2021 at 15:17
  • \$\begingroup\$ @aconcernedcitizen .meas <probe> find <quantity> at 206m did the trick. I was then able to plot my quantity of interest by View > Spice Error Log > Plot step'ed .meas data \$\endgroup\$ Sep 21, 2021 at 7:54
  • \$\begingroup\$ @ThomasTiotto If you omit find <quantity> and just write .meas <name> when <condition>, it is implied that it's using .meas <name> find time when <condition>. That's why <quantity> explicitly uses <quantity> for finding. \$\endgroup\$ Sep 21, 2021 at 13:29

1 Answer 1

1
\$\begingroup\$

Solution:

.meas res find ix(u1:te) at 206m did the trick to be able to measure the current through the device. I was then able to plot my quantity of interest by View > Spice Error Log > Right click on res > Plot step'ed .meas data . enter image description here

\$\endgroup\$
1
  • \$\begingroup\$ You can accept your own answer, too. It will let future people know, when searching for similar problems, that this problem has an accepted solution. \$\endgroup\$ Sep 24, 2021 at 12:58

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.