-
Notifications
You must be signed in to change notification settings - Fork 150
/
nme_legacy_dcline_dc.m
34 lines (31 loc) · 1.23 KB
/
nme_legacy_dcline_dc.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
classdef nme_legacy_dcline_dc < mp.nme_legacy_dcline & mp.form_dc
% mp.nme_legacy_dcline_dc - Network model element for legacy DC line for DC formulation.
%
% Adds non-voltage state variables ``Pdcf`` and ``Pdct`` to the network
% model and builds the parameter :math:`\KK`.
% MATPOWER
% Copyright (c) 2019-2024, Power Systems Engineering Research Center (PSERC)
% by Ray Zimmerman, PSERC Cornell
%
% This file is part of MATPOWER.
% Covered by the 3-clause BSD License (see LICENSE file for details).
% See https://matpower.org for more info.
methods
function obj = add_zvars(obj, nm, dm, idx)
%
ndc = obj.nk;
dme = obj.data_model_element(dm);
switch idx{1}
case 1 % flow at "from"
nm.add_var('z', 'Pdcf', ndc, dme.p_fr_start, dme.p_fr_lb, dme.p_fr_ub);
case 2 % flow at "to"
nm.add_var('z', 'Pdct', ndc, dme.p_to_start, -Inf, Inf);
end
end
function obj = build_params(obj, nm, dm)
%
build_params@mp.nme_legacy_dcline(obj, nm, dm); %% call parent
obj.K = speye(obj.nk * obj.nz);
end
end %% methods
end %% classdef