-
Notifications
You must be signed in to change notification settings - Fork 1
/
cmpBETA.m
55 lines (40 loc) · 1.07 KB
/
cmpBETA.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
function cmpBETA(run_solver)
% plotting flow variables
% plot fx for individual n
n = 1;
function fx = run_helper(b)
% export beta to an AMPL .dat file
setPARAM('beta', b)
% start solver
runAMPL('MDPNonlinearEqn.run')
% load data
fx = readFLOW('DATA/FX.m', n);
end
%% run the solver and import data
if run_solver
% set default values for solver
setDEFAULT()
b1 = .99; b2 = .97;
fx1 = run_helper(b1);
fx2 = run_helper(b2);
% save flows
save('DATA/FXbb.mat', 'b1', 'b2', 'fx1', 'fx2')
else
% load saved flows
load('DATA/FXbb.mat', 'b1', 'b2', 'fx1', 'fx2')
end
% plot flows
figure; grid off; box off
plotFX(fx1)
title(['\beta = ', num2str(b1, '%.2f')])
export_fig(['FIGURES/FXb', num2str(b1, '%.3f')], '-pdf', '-jpg', '-r150')
figure; grid off; box off
plotFX(fx2)
title(['\beta = ', num2str(b2, '%.2f')])
export_fig(['FIGURES/FXb', num2str(b2, '%.3f')], '-pdf', '-jpg', '-r150')
figure; grid off; box off
plotFF(fx2, fx1)
title(['\beta = ', num2str(b2, '%.2f')])
export_fig(['FIGURES/FXb', num2str(b1, '%.3f'), 'b', num2str(b2, '%.3f')],...
'-pdf', '-jpg', '-r150')
end