# AC sweep

The AC sweep feature is a frequency analysis of a periodic system. It uses the steady-state determination algorithm to compute the transfer function of a periodic system at different frequencies of a user-defined frequency sweep range. For each frequency, the following steps are performed:

• apply the (sinusoidal) AC sweep perturbation (see figure below to add this component in the circuit) to the periodic system,
• determine the steady-state operation of this perturbed system,
• compute the system response at this perturbation frequency.

The perturbation frequencies are defined by specifying:

• the frequency sweep range with the start and the end-frequency,
• the sweep type: linear or logarithmic,
• the start and the end-magnitude of the sinusoidal perturbation,
• the number of points within this range.

Once executed, the transfer function between the perturbation signal $S_p$ and the selected output variable $S_o$ is then available in the Results tab. The transfer function is computed such as: $20 \log\left( S_o / S_p\right)$

Important

The AC analysis on a range with low or very low frequencies should be carefully considered with the minimum time step which is set: it can lead to a very high number of points per period to be simulated for the steady state detection. For example, an analysis @10Hz with a minimum time step of 1e-10s could lead to an analysis of 1e9 points.

## Python API

The AC Sweep is entirely accessible from the Python API to automate transfer function analysis.

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 # Load modules from aesim.simba import DesignExamples, ACSweep # Load AC Sweep Design Example buck_converter = DesignExamples.DCDC_Buck_Converter_ACSweep() # Create the AC Sweep Test bench and assign the perturbation device buck_converter_acsweep = ACSweep() buck_converter_acsweep.Design = buck_converter; buck_converter_acsweep.Device = buck_converter.Circuit.GetDeviceByName("Control") buck_converter_acsweep.Fmin = 100; buck_converter_acsweep.Fmax = 1E5; buck_converter_acsweep.MagMin = 0.03; buck_converter_acsweep.MagMax = 0.05; buck_converter_acsweep.NumberOfPoints = 41; # Create and run the job job = buck_converter_acsweep.NewJob(); status = job.Run(); # Retrieve Transfer Function mag_sim = job.GetSignalByName('Rload - Voltage Magnitude').DataPoints phase_sim = job.GetSignalByName('Rload - Voltage Angle').DataPoints