Skip to content

Commit 0e5342c

Browse files
committed
Switch from use of fprintf() to redirectable mp_printf().
1 parent 7689be4 commit 0e5342c

2 files changed

Lines changed: 22 additions & 22 deletions

File tree

maxloadlim.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171

7272
while iter <= iter_max && repeat
7373
if options.verbose
74-
fprintf(1,'Beginning of iteration %d\n',iter);
74+
mp_printf(1,'Beginning of iteration %d\n',iter);
7575
end
7676
iter = iter + 1;
7777

print_maxloadlim.m

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,44 +14,44 @@ function print_maxloadlim(mpc,results)
1414

1515
% Print some global information about the parameters and results of the
1616
% maximum loadability limit problem
17-
fprintf('\n');
18-
fprintf('=======================================\n');
19-
fprintf(' Maximum loadability problem\n');
20-
fprintf('=======================================\n');
21-
fprintf('The stability margin is %.2f MW\n',results.stab_marg*results.baseMVA);
22-
fprintf('The type of bifurcation is %s (%s).\n',...
17+
mp_printf('\n');
18+
mp_printf('=======================================\n');
19+
mp_printf(' Maximum loadability problem\n');
20+
mp_printf('=======================================\n');
21+
mp_printf('The stability margin is %.2f MW\n',results.stab_marg*results.baseMVA);
22+
mp_printf('The type of bifurcation is %s (%s).\n',...
2323
results.bif.full_name,results.bif.short_name);
2424
if strcmp(results.bif.short_name,'LIB')
25-
fprintf('Generator responsible for LIB: Gen %d connected at bus %d\n',...
25+
mp_printf('Generator responsible for LIB: Gen %d connected at bus %d\n',...
2626
results.bif.gen_sll,results.gen(results.bif.gen_sll,GEN_BUS));
2727
end
28-
fprintf('\n--------------------------------------------------\n');
29-
fprintf(' Bus nb Direction Load at MLL Voltages \n');
30-
fprintf(' ------ --------- ----------- --------\n');
28+
mp_printf('\n--------------------------------------------------\n');
29+
mp_printf(' Bus nb Direction Load at MLL Voltages \n');
30+
mp_printf(' ------ --------- ----------- --------\n');
3131
for i = 1:size(results.bus,1)
32-
fprintf(' %4d %.2f %8.2f %4.3f\n',...
32+
mp_printf(' %4d %.2f %8.2f %4.3f\n',...
3333
results.bus(i,BUS_I),results.dir_mll(i),results.bus(i,PD),results.bus(i,VM));
3434
end
3535

3636
% Print some global information about the generators and their limits
3737
% First we extract the original voltage set points of the generators
3838
gen_v_set = mpc.gen(:,VG);
3939

40-
fprintf('\n');
41-
fprintf('=============================================================\n');
42-
fprintf('Reactive power production and voltages at the generators\n');
43-
fprintf('=============================================================\n');
44-
fprintf(' Bus nb Qgen Qmin Qmax Vm Vref\n');
45-
fprintf('-------- -------- -------- -------- ----- -----\n');
40+
mp_printf('\n');
41+
mp_printf('=============================================================\n');
42+
mp_printf('Reactive power production and voltages at the generators\n');
43+
mp_printf('=============================================================\n');
44+
mp_printf(' Bus nb Qgen Qmin Qmax Vm Vref\n');
45+
mp_printf('-------- -------- -------- -------- ----- -----\n');
4646
for i = 1:size(results.gen,1)
47-
fprintf(' %4d %8.2f %8.2f %8.2f %4.3f %4.3f',...
47+
mp_printf(' %4d %8.2f %8.2f %8.2f %4.3f %4.3f',...
4848
results.gen(i,GEN_BUS),results.gen(i,QG),results.gen(i,QMIN),results.gen(i,QMAX),...
4949
results.bus(results.gen(i,GEN_BUS),VM),gen_v_set(i));
5050
if results.bus(results.gen(i,GEN_BUS),BUS_TYPE) == REF
51-
fprintf(' REF');
51+
mp_printf(' REF');
5252
end
5353
if strcmp(results.bif.short_name,'LIB') && any(results.bif.gen_sll == i)
54-
fprintf(' LIB');
54+
mp_printf(' LIB');
5555
end
56-
fprintf('\n');
56+
mp_printf('\n');
5757
end

0 commit comments

Comments
 (0)