# Calculating Impedance in OnScale

By Marshall Williams 24 September 2020

Electrical impedance profiles are one of the fundamental metrics for analysing the performance of transduction devices and are usually the first metric investigated when performing comparisons with experimental data.

Extracting impedance vs frequency is a very straight-forward process in OnScale. Traditionally this was done by manual manipulation of the time-histories in Review, however, this process is now much simpler with the introduction of the impedance calculation in the Post Processor.

## How to calculate impedance in OnScale

To calculate the electrical impedance of a device, you must ensure you have set-up a piezoelectric simulation, with an active and ground electrodes in the correct place to create a potential difference, and hence charge in the material.

From here you must request time histories in pout for the voltage and charge signals on the electrodes for the impedance calculations to be performed, for example:

pout
histname electrode vq all

Once the simulation has been run, you can calculate impedance either by using Review or the Post Processor. Here is an article which walks through both of these methods.

## Theory

The three main equations used to calculate impedance are: In Equation 1, V is the Voltage, I is the current, and Z is the impedance. Equation 2 shows the relationship of charge to current – the time derivative of charge therefore equation 3, showing the time integral of charge also holds true. The electrical impedance frequency domain is then calculated using Equation 4, which divides the FFT of the voltage by the FFT of the current. The points on the electrical impedance graph are separated by a small frequency step, ∆f. If you call the total number of frequency points on the graph NF, Equations 5, 6, and 7 show how the NF, ∆f, and fMAX are calculated: In OnScale, NF is half the size of time samples NT (Nyquist Thereom). The frequency step in the FFT result is calculated using Equation 6. The maximum frequency of the electrical impedance graph is determined by taking the inverse of the time step from the time histories. The FFT process typically y pads NT to ensure a power of 2, 3, or 5 for efficiency (e.g., NT of 1000 is raised to 1024 points).

When zero padding is added, both NF and ∆f change for any given time history. If the padding is 3, NT is increased by a factor of 3; that is, there are three times as many points in the time-domain signal but ∆t remains the same. For the equations above, NF would be 3 times bigger; fMAX would remain the same, as it depends only on the initial time step, ∆t, which is constant; and ∆f would decrease by a factor of 3, as NT was increased by that much.

Thus, although there are now 3 times as many points, the frequency step between points is reduced yielding a much smoother frequency domain output. Figure 1 shows a sample charge time history. Figure 2 and 3 shows a comparison of the FFT with and without zero padding.  ## You may also like…

### Simulating Spinning Bodies

By 11 January 2023
OnScale Theory

By 26 July 2022
OnScale Theory

By 16 June 2022