Skip to content

Commit b7b0110

Browse files
committed
Update addgen2mpc() to expand fixed reserve parameters to keep sizes compatible.
1 parent 7491421 commit b7b0110

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ Change history for MOST
55
since version 1.1
66
-----------------
77

8+
#### 11/10/22
9+
- Update `addgen2mpc()` to expand fixed reserve parameters to keep sizes
10+
compatible.
11+
812
#### 9/29/22
913
- Silence near singular matrix warnings in some tests that began with
1014
MATLAB R2022b.

lib/addgen2mpc.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,17 @@
8888
error('addgen2mpc: GEN_TYPE must be a string (or cell array of strings) indicating the fuel type of the new generators');
8989
end
9090

91+
%% expand reserves parameters, if present
92+
if isfield(mpco, 'reserves')
93+
ngr = size(mpco.reserves.cost, 1);
94+
%% expand zones
95+
mpco.reserves.zones(end, ng+nr) = 0;
96+
if ngr == ng %% expand cost and qty
97+
mpco.reserves.cost(ng+nr, 1) = 0;
98+
if isfield(mpco.reserves, 'qty')
99+
mpco.reserves.qty(ng+nr, 1) = 0;
100+
end
101+
end
102+
end
103+
91104
NewGenIdx = ( ng + 1 : size(mpco.gen,1) )';

lib/mostver.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
v = struct( 'Name', 'MOST', ...
2020
'Version', '1.2-dev', ...
2121
'Release', '', ...
22-
'Date', '29-Sep-2022' );
22+
'Date', '10-Nov-2022' );
2323
if nargout > 0
2424
if nargin > 0
2525
rv = v;

0 commit comments

Comments
 (0)