# Parametric PSpice Circuit of Energy Saving Lamp Emulating Current Waveform
## Materials and Methods
### PSpice Model for Emulating the Current Drawn from an ESL  
The proposed circuit model accounts for the change of the current drawn from a lamp when the _rms_ voltage, \(V_{1}\), on the mains varies within the range allowed by the regulation (\(\pm 10\%\) of \(V_{nom}\)). More specifically, the model emulates the variation of the value of the _rms_, \(I_{1}\), and the change in the phase shift, \(\gamma_{1}\), of the fundamental frequency current, \(i_{1}\)(t). The model also emulates the variation of the _rms_ of any other current harmonic, \(I_{k}\), while it neglects any variation of the phase offset, \(\gamma_{k}\) (that is the phase offset at nominal voltage is considered). A graphical representation of the proposed circuit that accounts for the previous interpolation functions is reported in Figure 9.  
The components in the subcircuits called \"Active\", \"Reactive\", and \"kth harmonic\" emulate the behaviour of, respectively, \(I_{P1}\), \(I_{Q1}\), and \(I_{k}\) in Equation (14). According the circuit model in the figure and the equations in (14), the following equations are valid:  
\[ \begin{array}{c}\overbrace{i_{aP1}(t)+i_{bP1}(t)}^{circuit}=i_{P1}(t)= \sqrt{2}I_{P1}\cos(\omega t)=\sqrt{2[a_{P1}+b_{P1}V_{1}]}\cos(\omega t)\\ i_{aQ1}(t)+i_{bQ1}(t)=i_{Q1}(t)=\sqrt{2}I_{Q1}\cos(\omega t+\frac{\pi}{2})= \sqrt{2}\big{[}a_{Q1}+b_{Q1}V_{1}\big{]}\cos(\omega t+\frac{\pi}{2})\\ i_{ak}(t)+i_{bk}(t)=i_{k}(t)=\sqrt{2}I_{k}\cos(k\omega t+\gamma_{k})=\sqrt{2}[ a_{k}+b_{k}V_{1}]\cos(k\omega t+\gamma_{k})k=2,\ 3,\ \ldots K\end{array}  \tag{18}\]  
Figure 8: Normalized current harmonics and THD error, when the LED light bulb is feed with 237 V.  
Figure 9: Proposed linear equivalent circuit of a generic ESL. Then \(i_{aP1}(t)\) accounts for the constant term \(a_{P1}\), \(i_{bP1}(t)\) accounts for the linear term \(b_{P1}\) and so on:  
\[ \begin{array}{c}i_{aP1}(t)=\sqrt{2}a_{P1}\cos(\omega t)\\ i_{bP1}(t)=\sqrt{2}b_{P1}V_{1}\cos(\omega t)\\ i_{aQ1}(t)=\sqrt{2}a_{Q1}\cos(\omega t+\frac{\pi}{2})\\ i_{bQ1}(t)=\sqrt{2}b_{Q1}V_{1}\cos(\omega t+\frac{\pi}{2})\\ i_{ak}(t)=\sqrt{2}a_{k}\cos(k\omega t+\gamma_{k})\\ i_{bk}(t)=\sqrt{2}b_{k}V_{1}\cos(k\omega t+\gamma_{k})\end{array}  \tag{19}\]  
In the previous equations, the currents \(i_{aP1}(t)\), \(i_{aQ1}(t)\) and \(i_{ak}(t)\) are independent from \(V_{1}\) since they arise from the constant terms in (14). Therefore, their waveforms are emulated by means of independent current generators in the equivalent circuit (Figure 9). It is useful to recall that, when a constant term is negative (for example \(a_{k}<0\)) the related generator (\(i_{ak}(t)\) in such an example) is in antiphase with the overall current it belongs to (\(i_{k}(t)\) in such an example). Consequently, according to Remark 2, the other term (\(b_{k}\) in such an example) is definitively positive because the related current (\(i_{bk}(t)\) in such an example) has to be in phase with the overall current. Moreover, the amplitude of the \"in-phase\" current (\(i_{bk}(t)\)) is greater than the amplitude of the \"antiphase\" current (\(i_{ak}(t)\)) according to Remark 1. The voltage independent generator, \(v_{Fk}\), with an element in series are responsible for emulating the current \(i_{bk}(t)\). The voltage independent generator has an angular frequency \(k\) times greater than the mains voltage and the same amplitude:  
\[v_{Fk}(t)=\sqrt{2}V_{1}\cos\Bigl{(}k\omega t+\gamma_{k}+sign(b_{k})d\frac{ \pi}{2}\Bigr{)} \tag{20}\]  
where \(\gamma_{k}\) is the phase offset of the \(k\)th harmonic current according to Equation (6); \(d\) can assume only two values \(+1\) or \(-1\), it depends on the component selected by the switches. When the circuit component adopted is an inductor then \(d=1\), otherwise, when it is chosen a capacitor \(d=-1\). It is worth noting that this voltage generator does not emulate the \(k\)th voltage harmonic on the mains but it is a fictitious generator belonging to the lamp model.