LTSpice IV: How to vary input Voltage and measure the frequency

ltspice

I am getting started with LTSpice IV and I have a couple of beginner questions:

In the following circuit, I want to do the following (separately for each simulation):

  1. Vary the amplitude of V1 from 20 volts to 200 volts in steps of 10.

  2. Vary the frequency of V1 from 60 Hz to 300 Hz in steps of 10.

In both cases, I want to measure the frequency of the voltage across R2.

Please suggest me how to do this.

schematic

simulate this circuit – Schematic created using CircuitLab

Thanks.

Best Answer

In a circuit like yours the frequency of any voltage or current will be that of the source signal, hence there is no need to retrieve it from the simulation result. If your situation is much more complex, e.g. you want to measure the frequency of some resonant ringing or the like, you will have to do this graphically from the output plot of a transient simulation.

Now to your question: If you want to vary several parameters and execute a simulation with every possible combination of these you need to make a parametric simulation. To do so, add the relevant parameters with arbitrary values to your netlist. You can do this by adding the following SPICE directive:

.PARAM + pAmplitude = 20 + pFrequency = 60

Also add the following directive to make you transient simulation a parametric one:

.STEP PARAM pAmplitude 20 200 10 Change pAmplitude from 20 to 200 in steps of 10

.STEP PARAM pFrequency 60 300 10 Change pFrequency from 60 to 300 in steps of 10

To include the parameters into your schematic simply replace the amplitude value of V1 by {pAmplitude} and the frequency by {pFrequency}.