Current and Dependent Sources in EMTP-based Programs

Benedito Donizeti Bonatto * Hermann Wilhelm Dommel Department of Electrical and Computer Engineering Department of Electrical and Computer Engineering The University of British Columbia The University of British Columbia 2356 Main Mall, Vancouver, B.C., V6T 1N4, Canada 2356 Main Mall, Vancouver, B.C., V6T 1N4, Canada [email protected]

Abstract - This paper presents the fundamental concepts If the equations of the dependent sources are linear, they for the implementation of current and voltage dependent can be added directly to the system of the nodal equations sources in EMTP-based programs. These current and used in EMTP-based programs, if a linear equation solver for voltage dependent sources can be used to model many unsymmetric matrices is used. Another approach is based on electronic and electric circuits and devices, such as the compensation method, which is chosen here because operational , etc., and also ideal transformers. nonlinear equations can easily be handled as well. As long as the equations of the dependent sources are This paper provides the fundamental equations for the linear, they could be added directly to the network implementation of dependent sources, as well as of equations, but the matrix will then become unsymmetric. ungrounded independent sources, in EMTP-based programs. Another alternative discussed here in more detail is based on the compensation method, which can also handle nonlinear effects with a Newton-Raphson II. COMPENSATION METHOD algorithm. Nonlinear effects arise with the inclusion of saturation or limits in the dependent sources. The The compensation method has long been used in EMTP- implementation of independent sources, which can also based programs for solving the equations of nonlinear be connected between two ungrounded nodes, is also elements with the Newton-Raphson iterative method. If the presented. A practical example is given to illustrate the nonlinear elements are not too numerous, this approach solution methods. confines the iterations to a relatively small system of equations, compared to the nodal equations for the entire Keywords: EMTP, current controlled system. (CCVS), current controlled (CCCS), voltage When there are M nonlinear elements in a circuit, the controlled voltage source (VCVS), voltage controlled current following system of equations, (1) to (6), allows the source (VCCS), dependent source, compensation method. simultaneous solution of the nonlinear equations with the rest of the linear network [2],[3], which is then represented by its M-phase Thevenin equivalent circuit, as illustrated in Fig.1: I. INTRODUCTION -v+r×iv+=0 (1) EMTP-based programs are widely used in the electric [ OPEN] [ THEV] [ ] [ ] power industry and in universities for the analysis of power system transients. Since the publication of [1], many have where: contributed to the development of models, which have been documented in [2] and elsewhere. v éOPEN1ù As far as the authors know, dependent sources of all êú vOPEN types have not been implemented in any EMTP-based [v]=ê2ú (2) programs, leading to the motivation for the development of OPEN êMú this work. Dependent sources expand the capabilities of êú v EMTP-based programs for modeling many electric and ëêOPENMûú electronic circuits and devices. With a voltage controlled voltage source, for example, it becomes easy to simulate ér11r12Lr1Mù operational amplifiers. These can then be used to set up êú control circuits with analog-computer block diagrams, which r21r22Lr2M [r]=êú (3) is an alternative to the state-space representation of control THEV êMMOMú circuits and their simultaneous solution with the power êú network discussed in [4]. ëêrM1rM2 LrMMûú

* Receiving a scholarship from CAPES – Brasília / Brazil. [v ] OPEN [rTHEV] [i] [v]

i1

i2

i3

i4 ...

iM

vOPEN_1 vOPEN_ M RM R4 R3 R2 R1

... vM ... v4 v3 v2 v1

vs(M) vs(4) vs(3) vs(2) vs(1)

Fig. 1 – M-phase Thevenin equivalent circuit.

éi1ù c êú k i2 [i]=êú (4) i êMú k R êú k v ëêiMûú k

vsource(k)

év1ù

êú dk v2 [v]=êú (5) êMú êú Fig. 2 –Representation of branch equation kas a voltage ëêvMûú source in series with a resistance.

and (6) are the branch equations of the nonlinear elements:

ck vk = f k ([v],[i],t,etc....) k = 1,...M (6) ik

i i =v / R v Rk source(k) source(k) source(k) k If the branch equations in (6) are linear, as in the case of k dependent sources, they can be represented in the form of a voltage source behind an impedance, as illustrated in Fig. 2, or in the form of a current source in parallel with an dk impedance, as shown in Fig. 3. In this paper, it is assumed that the branch impedances are not coupled, and that they Fig. 3 –Representation of branch equation kas a current are resistive ( Rk). source in parallel with a resistance. III. DEPENDENT SOURCES as:

vj=Rinij (13) This section presents the necessary equations for implementing current and voltage dependent sources in EMTP-based programs. The following assumptions are vk=Wij+Routik (14) made: 1. A Thevenin equivalent circuit can be calculated where: where the dependent source is to be connected, and R=Input resistance of branch j . also where the controlling current or controlling in voltage is to be measured. In cases where this Rout=Output resistance of the dependent source in branch calculation fails, the connection of large resistors in k . parallel may make a Thevenin equivalent circuit W=Gain over the controlling or measured current, possible. 2. Proper precautions are taken to handle extremely applied as dependent source at branch k . large numbers and zero values. The following models are derived: Current Controlled From (7), (8), (13) and (14), one can also obtain the Voltage Source (CCVS), Current Controlled Current Source following equations: (CCCS), Voltage Controlled Voltage Source (VCVS) and -v+ri+... Voltage Controlled Current Source (VCCS). In all cases, the OPENj j11 equations from the Thevenin equivalent circuit are the same, (15) namely, for the controlling branch ...+( rjj+Rin) ij+rjkik+...+rjMiM=0

-vOPEN+rj1i1+... -v+ri+... j OPENk k11 (7) (16) ...+rjjij+rjkik+...+rjMivM+j=0 ...+( rkj+W) ij+( rkk+Rout) ik+...+rkMiM=0 and for the dependent source branch For an ideal current controlled voltage source, Rin=0

-vOPEN+rk1i1+... and Rout=0, from which results: k (8) ...+rkjij+rkkik+...+rkMivM+k=0 -vOPEN+rj1i1+... j (17) where: ...+rjjij+rjkik+...+rjMiM=0 v = voltage v for i = 0 (open circuit). OPEN k k k r=Thevenin resistance (self resistance of branch k). -v+ri+... kk OPENk k11 (18) rkj=Thevenin resistance (coupling or mutual resistance ...+( rkj+W) ij+rkkik+...+rkMiM=0 between branches k and j).

A. Current Controlled Voltage Source (CCVS) B. Current Controlled Current Source (CCCS)

Assume that the controlling current is measured through The necessary equations for the implementation of a current controlled current source are (7) and (8) as well as: a branch between nodes a and b in a circuit, such that v j vj=Rinij (19) is its branch voltage and i j is its branch current, i.e.,

v j = va - vb (9) vRk=outBij+Routik (20) i j = iab (10) where: and that the dependent source, CCVS, is connected B=Gain over the controlling or measured current, between nodes c and d with branch voltage applied as dependent source at branch k . v = v - v (11) From the equations above and from (7) and (8), one can k c d also obtain the following equations: and branch current

ik = icd . (12) -v+ri+... OPENj j11 Then the necessary equations for the implementation of (21) this current controlled voltage source are (7) and (8) as well ...+( rjj+Rin) ij+rjkik+...+rjMiM=0 v i = 0 (29) OPENK rk1 j -+i1+... RoutRout -v+ri+... r OPENj j11 ækj öærkkö rkM (30) ...+ç+B÷ij+ç+1÷ik+...+iM=0 ...+rjjij+rjkik+...+rjMiM=0 èRoutøèRoutø Rout (22) Equations (29) and (30) can be used to model ideal operational amplifiers. For an ideal current controlled current source, Rin=0 and Rout®¥, resulting in:

D. Voltage Controlled Current Source (VCCS) -vOPEN+rj1i1+... j (23) ...+ri+ri+...+ri=0 The necessary equations for the implementation of a jjjjkkjMM voltage controlled current source are (7) and (8) as well as:

Bij+ik=0 (24) vj=Rinij (31)

vRk=outGvj+Routik (32) C. Voltage Controlled Voltage Source (VCVS) where: The necessary equations for the implementation of a G=Gain over the controlling or measured voltage, voltage controlled voltage source are (7) and (8) as well as: applied as dependent source at branch k .

vj=Rinij (25) From the equations above and from (7) and (8), one can also obtain the following equations: v=Av+Ri=ARi+Ri (26) kjoutkinjoutk v r OPENJ æöj1 -+ç÷i1+... where: RinèøRin (33) A=Gain over the controlling or measured voltage, ærjj+Rinö rjkrjM applied as dependent source at branch k . ...+ç÷ij+ik+...+iM=0 èRinø RinRin From the equations above and from (7) and (8), one can also obtain the following equations: v æö OPENK rk1 v æör -GvOPEN++çGrj1-÷i1+... OPENJ j1 j RR -+ç÷i1+... outèoutø RinèøRin (27) ærkjöærR+ ö ...+Gr-i+Gr-kkouti+...(34) ærjj+Rinö rjkrjM çjj÷jçjk÷k ...+ç÷ij+ik+...+iM=0 èRoutøèRout ø èRinø RinRin ærkMö ...+çGrjM-÷iM=0 èRoutø v OPENK ærk1ö -vOPEN++çrj1-÷i1+... j AèAø For an ideal voltage controlled current source, ærkjö rR+ ækkoutö Rin®¥ and Rout®¥, resulting in: ...+çrjj-÷ij+çrjk-÷ik+... (28) èAøèA ø

i j = 0 (35) ærkMö ...+çrjM-÷iM=0 èAø -Gv+G+ri... OPENj j11 (36) If A®¥ , R®¥, and R®0 for an ideal in out ...+Grjjirj+( Gjk-1) ik+...+GrjMiM=0 voltage controlled voltage source, we obtain: IV. IDEAL TRANSFORMERS -vOPEN+rk1i1+... k (43) Even though an ideal transformer model has already been ...+rkkik+...+rkMivM+k=0 implemented in EMTP-based programs with a special connection of 8 resistances and an extra node [2], it can also v=Ri+Ri (44) be implemented as a special dependent source. The koutsourceoutk necessary equations for the implementation of an ideal where: transformer are (7) and (8) as well as: isource= independent current source at branch k , which

vj 1 can be a linear or nonlinear function of time, etc.. = (37) vn From the equations above, one can also obtain the k following equation:

ij =-n (38) vOPEN r ik K k1 -+i1+... where: RoutRout (45) 1nk n===reciprocal of the turns ratio of the ideal ærkk+Routö rkM ...+ik+...+iM+isource=0 anj ç÷ èRoutø Rout transformer. From the equations above and from (7) and (8), one can easily obtain: For the ideal current source, Rout®¥, resulting in:

ik + isource = 0 (46) ij+nik=0 (39) Of course, there is a much easier way to represent an independent current source between nodes c and d directly v in the nodal equations of the EMTP: inject the current source OPENK ærk1ö -vOPEN++çrj1-÷i1+... into node c and with a negative sign into node d [2]. j nènø

ærkjöærkkö ...+çrjj-÷ij+çrjk-÷ik+...(40) B. Independent Voltage Source ènøènø The necessary equations for the implementation of an ærkMö ...+çrjM-÷iM=0 independent voltage source are: ènø

-vOPEN+rk1i1+... Equations (39) and (40) can be used to model an ideal k (47) transformer in EMTP-based programs. ...+rkkik+...+rkMivM+k=0

v=v+Ri (48) V. INDEPENDENT SOURCES ksourceoutk

It may be useful in a circuit or device model to have an where: independent current or independent voltage source connected vsource = independent voltage source at branch k , which between two ungrounded nodes. This can be accomplished can be a linear or nonlinear function of time, etc.. by the same technique used for the implementation of From the equations above, one can also obtain the dependent sources, but using only one equation in this case. following equation:

-v+ri+... A. Independent Current Source OPENK k11 (49) ...+( r+R) i+...++riv =0 Assuming that the independent current source is kkoutkkMMsource connected between nodes c and d with branch voltage In an ideal voltage source, Rout=0, resulting in: vk = vc - vd (41) and branch current -v+ri+... OPENK k11 ik = icd (42) (50) then the necessary equations for the implementation of an ...+rkkik+...++rkMivMsource=0 independent current source are: Another approach for voltage sources between Indeed, in theory this noninverting circuit ungrounded nodes frequently used in EMTP-based programs should result in: is the insertion of an ideal transformer between the two voutputæRfö ungrounded nodes, with a voltage source to ground on the =1+ (51) ç÷ other side. vinputèRgø VI. POSSIBLE APPLICATIONS VII. CONCLUSIONS 1. Current and voltage sensors; 2. Operational amplifiers; The implementation of current and voltage dependent 3. Ideal Transformers; sources in EMTP-based programs has been presented, as 4. User-defined coupled branches in a circuit; well as the implementation of independent sources which 5. Modeling of electronic components, where the may be connected between two ungrounded nodes. It is physical behavior would need to be represented by based on the compensation method, which is already being nonlinear equations; used to solve nonlinear equations associated with nonlinear 6. Instantaneous solution of linear and nonlinear elements in electric or electronic circuits with Newton- control systems; Raphson iteration schemes. The method looks promising for 7. User-defined linear and nonlinear functions; future work in detailed modeling of circuits and devices. 8. User-defined modeling of linear and nonlinear Future improvements will consider the implementation of devices, limited only by the creativity and ingenuity saturation or limits for the elements or sources presented in of the user. this paper. Fig. 4 and Fig. 5 illustrate the solution method with an example of a noninverting amplifier circuit, which consists of VIII. ACKNOWLEDGEMENTS a sinusoidal voltage source, an ideal operational amplifier and 2 resistors ( Rf and Rg). The ideal operational The authors would like to thank for the financial support amplifier was modeled using (29) and (30), whereas the of CAPES – Brasília / Brazil, which granted a scholarship to sinusoidal voltage source and the resistors are part of the Mr. Benedito Donizeti Bonatto, and also to acknowledge the network, represented through a Thevenin equivalent circuit. help of Mr. Jesús Calviño-Fraga for indicating the need for modeling operational amplifiers in his technical report [5], If R=2R, then v=3v, as shown in Fig. 5. fg outputinput which motivated the authors to develop the methods presented in this paper.

IX. REFERENCES

Rf [1] H.W. Dommel, "Digital Computer Solution of Electro– v magnetic Transients in Single- and Multiphase vinput output Networks", IEEE Transactions on Power Apparatus and o vinput=1.0 0 (V) Rg Systems, vol. PAS-88, April 1969, pp. 388-399. f=60 (Hz) [2] H.W. Dommel, EMTP Theory Book, Second Edition, Microtran Power System Analysis Corporation, Fig. 4 – Circuit with ideal operational amplifier. Vancouver, British Columbia, Canada, 1992, latest update 1996. 4 [3] MicroTranÒ Reference Manual, Transients Program for 3 Voutput Power and Power Electronics Circuits, Microtran Power 2 System Analysis Corporation, Vancouver, B.C., Canada, August 1997. 1

Vinput 0 [4] A.E.A. Araujo, H.W. Dommel and J.R. Martí,

Voltage ( V ) "Simultaneous Solution of Power and Control Systems -1 Equations", IEEE Transactions on Power Systems, Vol. -2 8, No. 4, November 1993, pp. 1483-1489.

-3 [5] Jesús Calviño-Fraga, “Modeling Operational Amplifiers -4 0 5 10 15 20 25 30 35 40 45 50 Using MicroTran”, Technical Report for the Graduate Time ( ms ) Course “Advanced Power System Analysis”, The Fig. 5 – Simulation results of circuit with ideal operational University of British Columbia, Vancouver, British amplifier (noninverting amplifier circuit). Columbia, Canada, April 1998.