//+---------------------------------------------------+
//|  PExprt THERMAL MODEL FOR MAGNETIC COMPONENT      |
//|         SIMPLORER(R) V6 LANGUAGE VERSION          |
//|   GENERATED BY PExprt (C) UPM-Ansoft 1992-2004    |
//|                    Version 6.0.12                 |
//+---------------------------------------------------+


MODELDEF PlanarComponents_2_th 
{
//----Electrical and Real Ports definition

PORT real out: TempMax = TempMax;

PORT real in : AvgCoreLosses = AvgCoreLosses;

PORT real in : AvgWireLosses = AvgWireLosses;

//--- 1D Thermal model description for SIMPLORER---

//---Power sources for different losses---

//---CoreLosses---

INTERN I GPcore N1:=GND,N2:=Pcore (IS:=AvgCoreLosses, PARTDERIV:=1);

INTERN R Rcore N1:=Pcore,N2:=GND (R:=1.0e+000);

//---Power sources for different windings---

//---Winding 1

INTERN I GPwind1 N1:=GND,N2:=Pwind1 (IS:=Pwind1, PARTDERIV:=1);

INTERN EQU {Pwind1:=AvgWireLosses*1.00355e-007/(1.00355e-007+1.00355e-007+3.68245e-008+3.79169e-008+3.68245e-008+3.79169e-008);}

INTERN R Rwind1  N1:=Pwind1, N2:=GND (R:=1.0e+000);

//---Winding 2

INTERN I GPwind2 N1:=GND,N2:=Pwind2 (IS:=Pwind2, PARTDERIV:=1);

INTERN EQU {Pwind2:=AvgWireLosses*1.00355e-007/(1.00355e-007+1.00355e-007+3.68245e-008+3.79169e-008+3.68245e-008+3.79169e-008);}

INTERN R Rwind2  N1:=Pwind2, N2:=GND (R:=1.0e+000);

//---Winding 3

INTERN I GPwind3 N1:=GND,N2:=Pwind3 (IS:=Pwind3, PARTDERIV:=1);

INTERN EQU {Pwind3:=AvgWireLosses*3.68245e-008/(1.00355e-007+1.00355e-007+3.68245e-008+3.79169e-008+3.68245e-008+3.79169e-008);}

INTERN R Rwind3  N1:=Pwind3, N2:=GND (R:=1.0e+000);

//---Winding 4

INTERN I GPwind4 N1:=GND,N2:=Pwind4 (IS:=Pwind4, PARTDERIV:=1);

INTERN EQU {Pwind4:=AvgWireLosses*3.79169e-008/(1.00355e-007+1.00355e-007+3.68245e-008+3.79169e-008+3.68245e-008+3.79169e-008);}

INTERN R Rwind4  N1:=Pwind4, N2:=GND (R:=1.0e+000);

//---Winding 5

INTERN I GPwind5 N1:=GND,N2:=Pwind5 (IS:=Pwind5, PARTDERIV:=1);

INTERN EQU {Pwind5:=AvgWireLosses*3.68245e-008/(1.00355e-007+1.00355e-007+3.68245e-008+3.79169e-008+3.68245e-008+3.79169e-008);}

INTERN R Rwind5  N1:=Pwind5, N2:=GND (R:=1.0e+000);

//---Winding 6

INTERN I GPwind6 N1:=GND,N2:=Pwind6 (IS:=Pwind6, PARTDERIV:=1);

INTERN EQU {Pwind6:=AvgWireLosses*3.79169e-008/(1.00355e-007+1.00355e-007+3.68245e-008+3.79169e-008+3.68245e-008+3.79169e-008);}

INTERN R Rwind6  N1:=Pwind6, N2:=GND (R:=1.0e+000);

//---Temperature node for magnetic component

INTERN I GTempMax N1:=GND, N2:=TempMaxprev (IS:=(AvgCoreLosses*28.3757+Pwind1*-1314.65+Pwind2*1457.71+Pwind3*-1636.62+Pwind4*-1010.37+Pwind5*1126.93+Pwind6*1770.29), PARTDERIV:=1);

INTERN R RTempMax N1:=TempMaxprev, N2:=GND (R:=1.0e+006);

INTERN VM SensTmax N1:=TempMaxprev, N2:=GND;

INTERN EQU {SensT:=SensTmax.V/(t+1.0e-012);}

INTERN E ETempOut N1:=GND, N2:=TempMax (EMF:=SensT,PARTDERIV:=1);

INTERN R RTempMaxOut N1:= TempMax, N2:= GND (R:=1.0e+000);

INTERN C CavgTempMax N1:=TempMaxprev, N2:= GND (C:=1.0e+000, V0:=);

INTERN VM SensTmaxOut N1:= TempMax, N2:= GND;

INTERN EQU {TempMax:=SensTmaxOut.V;}

//---End of the Thermal Model of The Magnetic Component
}