diff --git a/Sim_0_data.m b/Sim_0_data.m index 01e6d0e41665222a9c3114d5eaa2962db53bd6cb..4e8caebe9b26957995d19dadf0c99af049d0d6f9 100644 --- a/Sim_0_data.m +++ b/Sim_0_data.m @@ -113,8 +113,8 @@ pe=0.5; % electricity price [$/kWh] mixer_ERD=1; % PRO Draw outlet mixer adjustment (only if 2nd ERDs) (mixer_ERD=1 --> all flow to ERD2 no turbine needed) %% display figures -fig=[1,0,0,0,0,0,0,0,1,0,0]; % f(i)=1 --> figure i will be displayed -%fig=[0,0,0,0,0,0,0,0,0,0,0]; % f(i)=1 --> figure i will be displayed +%fig=[1,0,0,0,0,0,0,0,1,0,0]; % f(i)=1 --> figure i will be displayed +fig=[0,0,0,0,0,0,0,0,0,0,0]; % f(i)=1 --> figure i will be displayed %% model specific changes: % co-current diff --git a/Skript.m b/Skript.m index dc7d9fee8927e2d058c61a756e446a4f6a469c45..dd695017ee29c3e105d3ce19b3a7d75f43551d72 100644 --- a/Skript.m +++ b/Skript.m @@ -1,28 +1,34 @@ -%% Matlab file for the Paper 2024: +%% Matlab skript for the Paper 2024: +% % - reproduce the simulations % - reproduce optimisation results % - reproduce all figures.png (converted to .eps using LibreOfficeDraw) % - test average computation time +% %% Numerical Simulations -% figures for SWRO, PRO and the ERD -% original .m file from: C:>User>bav1839>Documents>MATLAB>Counter-current-solver +% +% Create figures form chapter: Numerical simulations +% close all; -[Output1, Output2, time]=fun_1(1,0,'sol',1e6,1e-6), +[Output1, Output2, time]=fun_1(1,0,'sol',1e4,1e-4), +% %figure(1); set(gcf,'color','w'); f = gcf; exportgraphics(f,'Figure_6.png'); %figure(2); set(gcf,'color','w'); f = gcf; exportgraphics(f,'Figure_7.png'); %figure(3); set(gcf,'color','w'); f = gcf; exportgraphics(f,'Figure_8_ERD.png'); % %% Average simulation time: -% manually disable figures first -T=zeros(1,100); +% +% IMPORTANT: manually comment out line: 116<->117 in "SIM_0_data" +% +T=zeros(1,100); for i=1:length(T) -[Sim_3b_output1, Sim_3b_output2, time]=fun_1(1,.32,'sol',1e6,1e-6); +[Output1, Output2, time]=fun_1(1,0,'sol',1e4,1e-4); T(i)=time; end -mean(T) -%5.9319 +mean(T) %= 0.9600 +% %% Optimisation-1(blue) c1=datetime("now"); diff --git a/fun_1.m b/fun_1.m index 09672585be3488acb23aed312869e224bedebbe7..406a9d28f58bf1a9b8ca095d5c53ec82da1e2141 100644 --- a/fun_1.m +++ b/fun_1.m @@ -1,4 +1,4 @@ -function [output1, output2, output3] = fun(input,option_data,obj,option_mesh,option_BVP) +function [output1, output2, output3] = fun_1(input,option_data,obj,option_mesh,option_BVP) %% fun Solves BVP for SWRO-PRO hybrid system using bvp5c % % fun(input,option_data,obj,option_mesh,option_BVP) will solve the @@ -29,6 +29,10 @@ function [output1, output2, output3] = fun(input,option_data,obj,option_mesh,opt tic; %% Read data if option_data == 0; DATA = @(x)Sim_0_data(input); end + + + + % Simulations if option_data == 0.11; DATA = @(x)Sim_11_data(input); end if option_data == 0.12; DATA = @(x)Sim_12_data(input); end