# Electronic – How to implement AC analysis in a resonant circuit in LTspice

ltspice

In previous LTspice simulations, I've set the AC amplitude of the voltage source to 1 and then carried on with the .ac spice directive. How do I setup the AC analysis for this circuit?

Do I set the AC amplitude to 1 for each voltage source or only my 100V DC source? Does setting the AC amplitude to 1 for a particular source set that source as the input voltage?

Do I set the AC amplitude to 1 for each voltage source or only my 100V DC source?

For AC analysis, the switches are not activated at all, the will be replaced by the Roff value of the switch$$\ ^* \$$.

Does setting the AC amplitude to 1 for a particular source set that source as the input voltage?

No. From the help file:

For AC analysis, the value of AC is used as the amplitude of the source at the analysis frequency.

For all the sources you don't fill in a value, 0V or 0A is used. So, all sources are applied, either with the zero value or the user entered value.

What do you want to achieve with the AC analysis?

If you want to know the frequency response of the resonant circuit plus load: remove the switches and connect V1 directly and run the AC analysis from LTspice.

If you really want to know the behaviour with the switches included, I think you need to do the more elaborated way: duplicate the circuit and add a small AC source in series to V1 in one of the circuits and compare the results of both circuits for different frequencies running a lot of transient analyses.

$$\ ^* \$$ I figured that out by playing around: I removed everything except for V1 and S1 and V6 and connected S1 with 2 equal resistors to GND. Setting the vertical axis of the plot window to linear and playing around with setting different values for the AC amplitude for V1 and V6, I found that only changing the aplitude of V1 changed the voltage between the resistors, but not to the value I expected. Next, I plotted the current through the resistors and found the current equals the AC setting for V1 divided by the sum of the Roff of the switch and the 2 resistors.