When people start looking into the simulation of switching converters, they often mix ac and transient analyses.
a transient analysis uses a cycle-by-cycle model whose internals mimic what the real integrated circuit does in reality: oscillator, flip-flops, comparators etc. With this model, you can assemble your converter via the schematic capture and run the circuit to observe switching waveforms. It is then easy to measure rms, average or peak values in different operating points. However, depending on the complexity of the model, simulation time can be long, especially if you want to simulate power-on sequences or worse, power factor correction stages (PFC).
an average model, on the other hand, is exclusively made of mathematical equations. These equations describe the average content of the main waveforms like input and output current and how changing the duty ratio affects their values. These nonlinear equations are linearized by SPICE before running the .AC analysis and you can look at various responses like the control-to-output transfer function (TF) of the power stage which is the corner stone of any stabilization exercise: apply a stimulus at the control input of the circuit and check how it propagates in the whole converter to form a response you will observe on the output. The ratio of the output to the input is the transfer function you want. When you average a waveform, the switching component naturally disappears and that is the reason why these averaged models simulate quickly. You can use them in ac analysis but also for dc bias points simulation or transient response: in that case, you will see what the average signals would look like after an input or output load step for instance.
SPICE is a linear solver in essence so regardless of the analyses, it will always linearize the component around the evaluated operating point. That is the reason why you can obtain a small-signal ac response from the nonlinear equations of an averaged model. But you could also linearize the expressions in the model and produce a small-signal model: this is what I did in my last book on transfer function. You have to do that if you want to symbolically determine transfer functions.
In your case, you could still use the cycle-by-cycle model available from LTspice. Actually, the simulation package includes a simple frequency-response analyzer or FRA that allows you to extract the transfer function you want from a cycle-by-cycle circuit:
You can see an ac sine source which is truly injecting a stimulus in the circuit and, with the help of the left-side macro, you can produce a Bode plot. I honestly don't consider this approach really useful because a) you need to make sure the ac source does not saturate the switching circuit and its amplitude may need to change as you approach the crossover point b) you need several stimulus cycles to extract values on the output, it is ok for 1-10 kHz frequencies but if you want to look at 5-20 Hz like with a PFC it is extremely long and c) I am not sure about the granularity you can get if you want to capture sharp resonances. However, it is still a good resource to many designers and I know that other SPICE packages like TINA now include a FRA also.
For ac analyses, I prefer to resort to an average model and I have posted several of them on my webpage. I used the PWM switch from Vatché Vorpérian and I built several auto-toggling versions in voltage- and control-modes. Here is an example you can download for a LTspice simulation:
And if you want to combine switching speed for transient and ac analyses, nothing can beat a piece-wise linear (PWL) engine like SIMPLIS. You can check my introductory seminar here for instance to see the differences between SPICE and their proprietary engine. There is an ac stimulus in the circuit but it's more like a flag instructing the program that an ac sweep is required. The source amplitude is always under control so that no saturation occurs and signal-to-noise ratio is kept at a good level for proper information extraction. The cool thing is that you have one circuit for both transient and ac analyses:
You can add 2nd or 3rd-order effects easily and see the impact on the small-signal response. For instance, how does the leakage inductance influences the ac response of a flyback converter (see my paper here). Another important feature of this approach is the ability to sweep any kind of converters, especially the resonant ones which do not lend themselves well to the modeling exercise. Hope this sheds some light on this interesting part of the power electronics field.
.ac
small signal analysis. More info here: ez.analog.com/design-tools-and-calculators/ltspice/w/faqs-docs/… \$\endgroup\$