Power Systems Electromagnetic Transients Simulation

Appendix H: FORTRAN Code for EMT Simulation

H.1 DC Source, Switch and RL Load

In this example a voltage step (produced by a switch closed on to a d.c. voltage source) is applied to an RL Load. Results are shown in section 4.4.2. The RL load is modelled by one difference equation rather than each component separately.

!====================================================================PROGRAM EMT_Switch_RL!====================================================================IMPLICIT NONEINTEGER, PARAMETER:: RealKind_DP = SELECTED_REAL_KIND(15,307)INTEGER, PARAMETER:: Max_Steps = 5000REAL (Kind = RealKind_DP), PARAMETER :: pi = 3.141592653589793233D0REAL (Kind = RealKind_DP) :: R,L,TauREAL (Kind = RealKind_DP) :: DeltaT,Time_SecREAL (Kind = RealKind_DP) :: K_i,K_vREAL (Kind = RealKind_DP) :: R_switch,G_switchREAL (Kind = RealKind_DP) :: V_sourceREAL (Kind = RealKind_DP) :: I_inst,I_historyREAL (Kind = RealKind_DP) :: i(Max_Steps),v(Max_Steps),v_load(Max_Steps)REAL (Kind = RealKind_DP) :: R_ON,R_OFFREAL (Kind = RealKind_DP) :: G_eff,Finish_TimeINTEGER :: k,m,ON,No_Steps!  Initalize Variables!---------------------Finish_Time = l.0D-3 ! SecondsR = 1.0D0            ! OhmsL = 50.00D-6         ! HenriesV_source = 100.0     ! VoltsTau = L/R            ! SecondsDeltaT  = 50.0D-6    ! Seconds<a name="1293"></a><a name="IDX-396"></a>R_ON  = 1.0D-10     ! OhmsR_OFF = 1.0D10      ! OhmsR_Switch = R_OFF    ! OhmsON = 0              ! Initially switch is openm = 1i(m) = 0.0Time_Sec = 0.0v(m) =100.0v_load(m) = 0.0K_i = (1-DeltaT*R/(2*L))/(1+DeltaT*R/(2*L))K_v = (DeltaT/(2*L))/(1+DeltaT*R/(2*L))G_eff = K_vG_switch = 1.0/R_switchOPEN (unit=10,status='unknown',file='SwitchRL1.out')No_Steps= Finish_Time/DeltaTIF(Max_Steps

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Switching Power Supplies
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.