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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
%% Préparation de l'affichage graphique
% Graph : configuration de la figure
screen_size = get(0, 'ScreenSize');
figure('Name', 'MES Tracking simulation',...
'NumberTitle', 'off',...
'Position',[1 31 screen_size(3) screen_size(4)-78]);
graph_index = gcf;
set(graph_index, 'Colormap', graph_colors,...
'MenuBar', 'none',...
'ToolBar', 'figure',...
'doublebuffer', 'off');
% Graph : configuration de 'Water amount'
graph_1 = subplot(2,3,1);
graph_water_map = imagesc(water_level);
set(gca,'Units','pixels',...
'xtick',[],'ytick',[],...
'xlimmode','manual',...
'ylimmode','manual',...
'climmode','manual',...
'CLim', [0, graph_water_max]);
% water_colorbar = colorbar('YTick',[0:graph_water_max],...
% 'Location','WestOutside');
% set(water_colorbar, 'Units', 'pixels', 'Position', [35 351 10 310]);
set(graph_1,'Position',[45 351 192 310])
title('Water amount (mm/m²)', 'Color', 'Black');
% Graph : configuration de 'MES 1 amount'
graph_2 = subplot(2,3,2);
graph_MES1_map = imagesc(MES_level(:,:,1));
set(gca,'Units','pixels',...
'xtick',[],'ytick',[],...
'xlimmode','manual',...
'ylimmode','manual',...
'climmode','manual',...
'CLim', [0, graph_MES_max]);
% MES1_colorbar = colorbar('YTick',[0:graph_MES_max/10:graph_MES_max],...
% 'Location','WestOutside');
% set(MES1_colorbar, 'Units', 'pixels',...
% 'Position', [275 351 10 310]);
set(graph_2,'Position',[285 351 192 310])
title('MES 1 amount (g/m²)', 'Color', [0.9,0,0]);
% Graph : configuration de 'MES 2 amount'
graph_4 = subplot(2,3,4);
graph_MES2_map = imagesc(MES_level(:,:,2));
set(gca,'Units','pixels',...
'xtick',[],'ytick',[],...
'xlimmode','manual',...
'ylimmode','manual',...
'climmode','manual',...
'CLim', [0, graph_MES_max]);
% MES2_colorbar = colorbar('YTick',[0:graph_MES_max/10:graph_MES_max],...
% 'Location','WestOutside');
% set(MES2_colorbar, 'Units', 'pixels',...
% 'Position', [35 10 10 310]);
set(graph_4,'Position',[45 10 192 310])
title('MES 2 amount (g/m²)', 'Color', [0,0.6,0]);
% Graph : configuration de 'MES 3 amount'
graph_5 = subplot(2,3,5);
graph_MES3_map = imagesc(MES_level(:,:,3));
set(gca,'Units','pixels',...
'xtick',[],'ytick',[],...
'xlimmode','manual',...
'ylimmode','manual',...
'climmode','manual',...
'CLim', [0, graph_MES_max]);
% MES3_colorbar = colorbar('YTick',[0:graph_MES_max/10:graph_MES_max],...
% 'Location','WestOutside');
% set(MES3_colorbar, 'Units', 'pixels',...
% 'Position', [275 10 10 310]);
set(graph_5,'Position',[285 10 192 310])
title('MES 3 amount (g/m²)', 'Color', 'blue');
% Graph : configuration du graphique 'Water flow'
graph_3 = subplot(2,3,3);
t_axis = (1:iterations)*model_step/3600/24;
graph_water = plot(t_axis, water_outlet, 'Color', 'black'); %verifier les unités il faut transfo à cause pas de temps ?
set(graph_3, 'Units', 'pixels',...
'Position', [555 351 screen_size(3)-555-30 310]);
axis([0 iterations 0 graph_water_flow_max]);
set(gca,'XTick',linspace(0,model_duration/3600/24,6));
datetick('x','HH:MM''SS"', 'keepticks');
ylabel('Water flow (m³/s)');
% Graph : configuration du graphique 'MES flow'
graph_6 = subplot(2,3,6);
hold on;
graph_MES1 = plot(t_axis, MES_outlet(:,1), 'Color', [0.9,0,0]);
graph_MES2 = plot(t_axis, MES_outlet(:,2), 'Color', [0,0.8,0]);
graph_MES3 = plot(t_axis, MES_outlet(:,3), 'Color', [0,0,1]); %verifier les unités il faut transfo à cause pas de temps ?
set(graph_6, 'Units', 'pixels',...
'Position', [555 10 screen_size(3)-555-30 310]);
axis([0 iterations*model_step/3600/24 0 graph_MES_flow_max]);
set(gca,'XTick',linspace(0,model_duration,6),'XTickLabel',[]);
ylabel('MES flow (kg/s)');
%% Exécution de la simulation
for t = 1 : iterations
%... CALCUL DES NOUVELLES DONNES PUIS MIS A JOUR :
set(graph_water_map, 'CData', water_level);
set(graph_MES1_map, 'CData', MES_level(:,:,1));
set(graph_MES2_map, 'CData', MES_level(:,:,2));
set(graph_MES3_map, 'CData', MES_level(:,:,3));
set(graph_water, 'YData',water_outlet);
set(graph_MES1, 'YData',MES_outlet(:,1));
set(graph_MES2, 'YData',MES_outlet(:,2));
set(graph_MES3, 'YData',MES_outlet(:,3));
pause;
end |
Partager