Sie sind auf Seite 1von 3

% 20/11/2017 Macro para calculo do V0 com refor�o de corrente V0_K=-V0+I0*K*Z0_LT

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

define_macro (V0_K,

save false as G_USEOLSTRING


save false as G_USEOLINTEGER
save false as G_USEOLREAL
save true as G_USEOLCOMPLEX

% Factor de refor�o de tens�o


save 0.4 as k

check_branch_newbus ($1, $2, $3, g_ierr)


check_branch_exists ($1, $2, $3, g_exists)

if (g_ierr <> 0 or not g_exists) then


save 0 as G_OLCOMPLEX
else

save base_kv $1 as my_base_kv_text


save my_base_kv_text/1.732051 as my_base_kv_text
save vz*my_base_kv_text $1 as v0
% save baseamps $1 $2 $3 as my_base_ka_text
% save my_base_ka_text/1000 as my_base_ka_text
save base_mva/my_base_kv_text/3 as my_base_ka_text
save (iz)*my_base_ka_text $1 $2 $3 as i0
% save baseohms $1 $2 $3 as my_base_ohm_text
save 3*my_base_kv_text*my_base_kv_text/base_mva as my_base_ohm_text
save ZKMZ*my_base_ohm_text $1 $2 $3 as z0_linha
save (i0*k*z0_linha) as ref
save ref-v0 as v0_ref
save polar(v0_ref) as G_OLCOMPLEX
endif

define_macro (ol_style_earth_fault_dir,

save true as G_USEOLSTRING


save false as G_USEOLINTEGER
save false as G_USEOLREAL
save false as G_USEOLCOMPLEX

% Get the direction of an outward arrow from bus #k


save outward_arrow_dir $1 $2 $3 arrow_direction
% ARROW_DIRECTION now stores an integer that tells us in what direction
% an outward arrow at bus #k will point.
% If ARROW_DIRECTION = 1, outward arrow at bus #k towards #m will point right, y
% If ARROW_DIRECTION = 2, outward arrow at bus #k towards #m will point up, x
% If ARROW_DIRECTION = 3, outward arrow at bus #k towards #m will point left, w
% If ARROW_DIRECTION = 4, outward arrow at bus #k towards #m will point down, z

if (arrow_direction = 1) then % OUTWARD ARROW is RIGHT, y


%save "EIIOL:y" FWD_ARROW
save "--->" FWD_ARROW
%save "EIIOL:w" REV_ARROW
save "<---" REV_ARROW
elseif (arrow_direction = 2) then % OUTWARD ARROW is UP, x
%save "EIIOL:y" FWD_ARROW
save "--->" FWD_ARROW
%save "EIIOL:w" REV_ARROW
save "<---" REV_ARROW

elseif (arrow_direction = 3) then % OUTWARD ARROW is LEFT, w


%save "EIIOL:w" FWD_ARROW
save "<---" FWD_ARROW
%save "EIIOL:y" REV_ARROW
save "--->" REV_ARROW

elseif (arrow_direction = 4) then % OUTWARD ARROW is DOWN, z


%save "EIIOL:w" FWD_ARROW
save "<---" FWD_ARROW
%save "EIIOL:y" REV_ARROW
save "--->" REV_ARROW
else
save ' ' FWD_ARROW
save ' ' REV_ARROW
endif

% Direction as evaluated by earth dir elements.


% Use -60 as MTA
save -60 ef_mta
save 3*iz $1 $2 $3 ef_IOP
save VZ $1 ef_VOP
save ZKMZ $1 $2 $3 as z0_linha_pu
save 3*( (ef_IOP*k*z0_linha_pu)-ef_VOP ) as ef_VOP
save ef_iop * conjg(ef_vop*cmplx(cos(ef_mta),sin(ef_mta))) ef_operv
% if (abs(forward(ef_operv)) <= 0) then
if (real(ef_operv) <= 0) then
save strcat('67N: REV ',REV_ARROW) G_OLSTRING
%save '67N: REV' G_OLSTRING
else
save strcat('67N: FWD ',FWD_ARROW) G_OLSTRING
%save '67N: FWD' G_OLSTRING
endif
%endif
)

OL_Bus_Text_Display 1 On
OL_Bus_Text_Value 1 BUS_ID
OL_Bus_Text_Format 1 '%s'
OL_Bus_Text_Display 2 Off
OL_Bus_Text_Value 2 ' '
OL_Bus_Text_Format 2 ' '
OL_Bus_Text_Display 3 Off
OL_Bus_Text_Value 3 ' '
OL_Bus_Text_Format 3 ' '
OL_Bus_Text_Display 4 Off
OL_Bus_Text_Value 4 ' '
OL_Bus_Text_Format 4 ' '
%OL_FBus_Text_Display All Off

%OL_Branch_Text_Display 1 On
%OL_Branch_Text_Value 1 IZ
%OL_Branch_Text_Format 1 '3I0:%.1f@%.0fA'
OL_Branch_Text_Display 1 On
OL_Branch_Text_Value 1 "ol_style_earth_fault_dir(#k, #m, #c)"
OL_Branch_Text_Format 1 '%s'
OL_Branch_Text_Display 2 On
OL_Branch_Text_Value 2 "V0_K(#k, #m, #c)"
OL_Branch_Text_Format 2 'V0_REF=%.2f@%.1fkV'
%OL_Branch_Text_Display 3 On
%OL_Branch_Text_Value 3 IZ
%OL_Branch_Text_Format 3 '3I0:%.1f@%.0fA'
OL_Branch_Text_Display 3 On
OL_Branch_Text_Value 3 "ol_style_earth_fault_dir(#k, #m, #c)"
OL_Branch_Text_Format 3 '%s'
OL_Branch_Text_Display 4 On
OL_Branch_Text_Value 4 "V0_K(#k, #m, #c)"
OL_Branch_Text_Format 4 'V0_REF=%.2f@%.1fkV'
OL_Branch_Text_Display 5 Off
OL_Branch_Text_Value 5 ' '
OL_Branch_Text_Format 5 ' '
OL_Branch_Text_Display 6 Off
OL_Branch_Text_Value 6 ' '
OL_Branch_Text_Format 6 ' '

%OL_FBus_Text_Display All Off


%OL_Branch_Text_Display All Off
OL_Shunt_Text_Display All Off
OL_XFMR_Text_Display All Off
OL_Fault_Text_Display All On
OL_Tie_Text_Display All Off
OL_MOV_Text_Display All Off

refresh
return

Das könnte Ihnen auch gefallen