1
\$\begingroup\$

I traced the following curve thanks to the "meas" command and the "step" command.

enter image description here

As the curve are pretty linear I would like to get an approximation of the curve.

I just need 2 points to have the slope x) It seems to be possible to get the last point of the iteration of the step command but how can I get the first or an other point ? How can I access the table which allows LTspice to trace this plot ? In order to get the slope ?

Here is my simulation :

enter image description here

And Here is how I get the above curves that I want to get the slope :) The meas. treatement is already done.

enter image description here

\$\endgroup\$
1
  • \$\begingroup\$ I also found the commands... and just posted them \$\endgroup\$
    – Voltage Spike
    Aug 20, 2021 at 17:54

2 Answers 2

2
\$\begingroup\$

I'm afraid the only way is through exporting the datapoints (make that window active, File > Export data as text). That's because that plot can only exist after all the steps have been simulated. The good news is that you can delete the first line, which will have the names of the variables, and use that in a PWL file for later simulations.


[Edit]

OP wants the derivative w.r.t. to the measured points, which can only be done after all the runs, so .meas can't be used to store the result of .step #1, then #2, and then difference. That would be applicable to a time- or frequency-dependent measurement, but not here. Therefore the export is the only way for calculating the slope, be it externally or through another run with the exported data as datapoints, as suggested in both answers.

\$\endgroup\$
2
\$\begingroup\$

You can use equations with the .meas command and take measurements at two different times and then subtract them. (blah and blah2 are just variable names that you create, the time to do this at after the AT command this finds the votlage of the rmsdiodecurrent node at 2 seconds and 3 seconds and then subtracts them. There are also other powerful commands to find votlages and report the time or vice versa)

.meas TRAN blah FIND V(rmsdiodecurrent) AT 2.0
.meas TRAN blah FIND V(rmsdiodecurrent) AT 3.0
.meas DELTA param (blah-blah2)

Another option would be to find the slope by using as dirivative with .meas equation or a b-source with an equation (then creating another node). Here is an example of a b-source (which uses nodes)

enter image description here

Data can be exported to a csv file then imported into excel or another program

\$\endgroup\$
10
  • 2
    \$\begingroup\$ The finite difference is a better option for the slope. +1. The export will be better for ther post-processing. \$\endgroup\$ Aug 20, 2021 at 17:03
  • \$\begingroup\$ BTW Is it possible to export automatically via an LTspice command a csv file ? I do not think that I will do this for my app but it could be usefull a next time :) \$\endgroup\$
    – Jess
    Aug 20, 2021 at 17:59
  • \$\begingroup\$ I though it was the correct answer but that seems not to be the case ? The graphic I showed you is not dependant on the time. It is a function of an absciss "x" which change at each step with the step command. I do not think that I can use the FIND keywords isn't it ? I will try after eating thank you :) \$\endgroup\$
    – Jess
    Aug 20, 2021 at 18:02
  • \$\begingroup\$ The output of the .meas commands always go to the .log output file, which is a text file in the project directory. \$\endgroup\$
    – Voltage Spike
    Aug 20, 2021 at 18:04
  • 1
    \$\begingroup\$ @Jess I'm afraid I jumped a bit to conclusions, mea culpa: the finite difference is very handy, but only for time (or frequency) dependent measurements. What you need is a difference for the measured points, and .meas can't handle memorizing points from .step to .step. Therefore the only way to do this is through exporting. I've undeleted my answer, fwiw. \$\endgroup\$ Aug 20, 2021 at 19:10

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.