-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_nf.m
79 lines (71 loc) · 2.26 KB
/
plot_nf.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
% Run Solver
tic;
space_grid = 100;
time_step = 10000;
[s,t,h,Q,S,N,u] = nf_solver(space_grid,time_step);
toc;
%% Plotting
set(groot,'defaulttextinterpreter','latex');
set(groot, 'defaultAxesTickLabelInterpreter','latex');
set(groot, 'defaultLegendInterpreter','latex');
% Making plots
figure('Name','Evolution of Drainage');
subplot(3,1,1);
plot(t,h);
xlabel('time, \emph{t} (years)');
ylabel('lake height, \emph{h} (m)');
title('Lake height over time');
subplot(3,1,2);
plot(t,Q(1,:),'DisplayName','Lake Exit');
hold on;
plot(t,Q(end,:),'--','DisplayName','Channel Exit');
xlabel('time, \emph{t} (years)');
ylabel('channel flow rate, \emph{Q} $(m^{3} s^{-1})$');
title('Flow over time');
legend('Location','northwest');
subplot(3,1,3);
plot(t,S(1,:),'DisplayName','Lake Exit'); % now plotting area at lake
hold on;
plot(t,S(end,:),'DisplayName','Channel Exit');
xlabel('time, \emph{t} (years)');
ylabel('channel cross-sectional area, \emph{S} $(m^2)$');
title('Channel area over time');
legend('Location','northwest');
figure('Name', 'Colormaps');
subplot(4,1,1);
imagesc(t,s,N);
xlabel('time, \emph{t} (years)');
ylabel('position along channel, \emph{x} (km)');
title('Effective Pressure Colormap');
cbarN = colorbar;
cbarN.Label.Interpreter = 'latex';
cbarN.TickLabelInterpreter = 'latex';
ylabel(cbarN, "effective pressure, \emph{N} (Pa)")
subplot(4,1,2);
imagesc(t,s,Q);
xlabel('time, \emph{t} (years)');
ylabel('position along channel, \emph{x} (km)');
title('Channel Flow Colormap');
cbarQ = colorbar;
cbarQ.Label.Interpreter = 'latex';
cbarQ.TickLabelInterpreter = 'latex';
ylabel(cbarQ, "channel flow rate, \emph{Q} $(m^3 s^{-1})$")
subplot(4,1,3);
imagesc(t,s,S);
xlabel('time, \emph{t} (years)');
ylabel('position along channel, \emph{x} (km)');
title('Channel Cross-sectional Area Colormap');
cbarS = colorbar;
cbarS.Label.Interpreter = 'latex';
cbarS.TickLabelInterpreter = 'latex';
ylabel(cbarS, "channel cross-sectional area, \emph{S} $(m^2)$")
subplot(4,1,4);
imagesc(t,s,u,[-100,1000]);
xlabel('time, \emph{t} (years)');
ylabel('position along channel, \emph{x} (km)');
title('Glacier Velocity Colormap');
cbaru = colorbar;
cbaru.Label.Interpreter = 'latex';
cbaru.TickLabelInterpreter = 'latex';
ylabel(cbaru, "glacier basal velocity, \emph{u} $(m y^{-1})$");
%set(gca,'ColorScale','log');