PyAMS  (the software under revision)

PyAMS.Analog.Basic.Transformer


Ideal linear electrical Transformer

Information

The transformer is a two port. The left port voltage v1, left port current i1, right port voltage v2 and right port current i2 are connected by the following relation:

         | Vp |         | Lp   M  |  | Ip' |
         |    |    =    |         |  |     |
         | Vs |         | M    Ls |  | Is' |

LpLs, and M are the primary, secondary, and coupling inductances respectively.

Parameters

NameDefaultDescription
Lp1Primary inductance [H]
Ls1Secondary inductance [H]
M1Coupling inductance [H]

PyAMS definition

from PyAMS import Signal
from PyAMS import ddt

#Transformer with two ports
class Transformer:
     def __init__(self, P1, P2,S1, S2):
         self.Vp = Signal('out','voltage',P1, P2)
         self.Ip = Signal('in','current',P1, P2)
         self.Vs = Signal('out','voltage',S1, S2)
         self.Is = Signal('in','current',S1, S2)
         self.Lp=1.0         # Lp  Primary inductance Value
         self.Ls=1.0         # Ls  Secondary inductance Value
         self.M=1.0          # M  Coupling inductance Value
     def analog(self):
         self.Vp+=self.Lp*ddt(self.Ip)+self.M*ddt(self.Is)
         self.Vs+=self.Ls*ddt(self.Is)+self.M*ddt(self.Ip)

Documentation generated by PyAMS