%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Chapter 6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%             For plotting the graphs represented in Chapter 6            %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Figure 17
% ss=1, w=10 000, TA=298.15, A varies
% ss = 1 --- length of temperature-inhomogeneous region 
% A = 0; 0.05; 0.2; 0.5 --- gradients
% w = 10000 --- angular frequency 
% TA = 298.15 --- absolute temperature of the region A

% type this commands each after each: 
% open main_temp_P.c, set A to 0.0, TA to 298.15, build and run
% in a command window set ss to 1, M to 100 (for example), the number 
% of steps to 1000 (for example) 
% s_0=from_C_to_Matlab;
% set A to 0.05, build and run, ss to 1, M to 100, the number of steps to 
% 1000 
% s_0_05=from_C_to_Matlab;
% set A to 0.2, build and run, ss to 1, M to 100, the number of steps to 
% 1000 
% s_0_2=from_C_to_Matlab;
% set A to 0.5, build and run, ss to 1, M to 100, the number of steps to 
% 1000
% s_0_5=from_C_to_Matlab;

% run this section

hold on
p0=plot(s_0,'LineWidth', 2.5);
p1=plot(s_0_05,'Color','m','LineWidth', 2.5);
p2=plot(s_0_2,'Color','g','LineWidth', 2.5);
p3=plot(s_0_5,'Color','r','LineWidth', 2.5);
hold off

figure_width  = 4.52083333333333;
figure_height = 3.55729166666667;
FontSize = 11*1.5;
FontName = 'MyriadPro-Regular';

set(gcf, 'units', 'centimeters', 'pos', [0 0 figure_width figure_height])
set(gcf, 'PaperPositionMode', 'auto');
set(gcf, 'Color', [1 1 1]); % Sets figure background
set(gca, 'Color', [1 1 1]); % Sets axes background
set(gcf, 'Renderer', 'painters');   
    
hTitle  = title ('$\omega = 10000$ s$^{-1}$\,, $T_A = 298.15$ K','interpreter','latex');
hXLabel = xlabel('\theta (-)');
hYLabel = ylabel('\Pi (-)');
 
hLegend = legend({'$A = 0.00$ m$^{-1}$','$A = 0.05$ m$^{-1}$','$A = 0.20$ m$^{-1}$','$A = 0.50$ m$^{-1}$'}, ...
'Position',[0.787363676810627 0.146806268519677 0.107613469985358 0.133946830265849], ...
'interpreter','latex','FontSize'   , FontSize );

set(gca, 'FontName', FontName);
set([hTitle, hXLabel, hYLabel], 'FontName', FontName);
set([hLegend, gca], 'FontSize', FontSize - 4);
set([hXLabel, hYLabel], 'FontSize', FontSize);
set( hTitle, 'FontSize', FontSize, 'FontWeight', 'bold');

set(gca, ...
  'Box'         , 'off'   , ...
  'TickDir'     , 'out'  , ...
  'TickLength'  , [.02 .02] , ...
  'XMinorTick'  , 'on'     , ...
  'YMinorTick'  , 'on'     , ...
  'LineWidth'   , 1.0);

print(gcf, '-r300', '17.png', '-dpng');

%% Figure 18 
% ss=1, w=10 000, TA=357.78, A varies
% ss = 1 --- length of temperature-inhomogeneous region 
% A = 0; -0.05; -0.2; -0.5 --- gradients
% w = 10000 --- angular frequency 
% TA = 357.78 --- absolute temperature of the region A

% type this commands each after each: 
% open main_temp_P.c, set A to 0.0, TA to 357.78, build and run
% in a command window set ss to 1, M to 100 (for example), the number 
% of steps to 1000 (for example) 
% s_0b=from_C_to_Matlab;
% set A to -0.08, build and run, ss to 1, M to 100, the number of steps to 
% 1000 
% s_0_05b=from_C_to_Matlab;
% set A to -0.2, build and run, ss to 1, M to 100, the number of steps to 
% 1000 
% s_0_2b=from_C_to_Matlab;
% set A to -0.5, build and run, ss to 1, M to 100, the number of steps to 
% 1000
% s_0_5b=from_C_to_Matlab;

% run this section
 
hold on
p0=plot(s_0b,'LineWidth', 2.5);
p1=plot(s_0_05b,'Color','m','LineWidth', 2.5);
p2=plot(s_0_2b,'Color','g','LineWidth', 2.5);
p3=plot(s_0_5b,'Color','r','LineWidth', 2.5);
hold off

figure_width  = 4.52083333333333;
figure_height = 3.55729166666667;
FontSize = 11*1.5;
FontName = 'MyriadPro-Regular';
 
set(gcf, 'units', 'centimeters', 'pos', [0 0 figure_width figure_height])
set(gcf, 'PaperPositionMode', 'auto');
set(gcf, 'Color', [1 1 1]); % Sets figure background
set(gca, 'Color', [1 1 1]); % Sets axes background
set(gcf, 'Renderer', 'painters');   
    
hTitle  = title ('$\omega = 10000$ s$^{-1}$\,, $T_A = 357.78$ K','interpreter','latex');
hXLabel = xlabel('\theta (-)');
hYLabel = ylabel('\Pi (-)');
 
hLegend = legend({'$A = \; \ \ \, 0.00$ m$^{-1}$','$A = - 0.08$ m$^{-1}$','$A = - 0.20$ m$^{-1}$','$A = - 0.50$ m$^{-1}$'}, ...
'Position',[0.787363676810627 0.146806268519677 0.107613469985358 0.133946830265849], ...
'interpreter','latex','FontSize'   , FontSize );

set(gca, 'FontName', FontName);
set([hTitle, hXLabel, hYLabel], 'FontName', FontName);
set([hLegend, gca], 'FontSize', FontSize - 4);
set([hXLabel, hYLabel], 'FontSize', FontSize);
set( hTitle, 'FontSize', FontSize, 'FontWeight', 'bold');

set(gca, ...
  'Box'         , 'off'   , ...
  'TickDir'     , 'out'  , ...
  'TickLength'  , [.02 .02] , ...
  'XMinorTick'  , 'on'     , ...
  'YMinorTick'  , 'on'     , ...
  'LineWidth'   , 1.0);

%print(gcf, '-r300', '18.png', '-dpng');

%% Figure 19
% A=0.5, w=10 000, TA=298.15, ss varies
% A = 0.5 --- gradient
% w = 10000 --- angular frequency 
% TA = 298.15 --- absolute temperature of region A
% ss = 0; 0.25; 0.5; 0.75; 1 --- length of temperature-inhomogeneous region  

% type this commands each after each: 
% open main_temp_P.c, set A to 0.5, TA to 298.15, build and run
% in a command window set ss to 0.25, M to 100 (for example), the number 
% of steps to 250 (for example) 
% ss_025=from_C_to_Matlab;
% run, ss to 0.5, M to 100, the number of steps to 500 
% ss_050=from_C_to_Matlab;
% run, ss to 0.75, M to 100, the number of steps to 750 
% ss_075=from_C_to_Matlab;
% run, ss to 1, M to 100, the number of steps to 1000
% ss_1=from_C_to_Matlab;

% run this section

t=0:0.002:4*pi;
ss_0=-2000*sin(t);

hold on
p0=plot(ss_0,'LineWidth', 2.5);
p1=plot(ss_025,'Color','m','LineWidth', 2.5);
p2=plot(ss_050,'Color','g','LineWidth', 2.5);
p3=plot(ss_075,'Color','r','LineWidth', 2.5);
p4=plot(ss_1,'Color', [0.5 0 0.5],'LineWidth', 2.5);
hold off

figure_width  = 4.52083333333333;
figure_height = 3.55729166666667;
FontSize = 11*1.5;
FontName = 'MyriadPro-Regular';
 
set(gcf, 'units', 'centimeters', 'pos', [0 0 figure_width figure_height])
set(gcf, 'PaperPositionMode', 'auto');
set(gcf, 'Color', [1 1 1]); % Sets figure background
set(gca, 'Color', [1 1 1]); % Sets axes background
set(gcf, 'Renderer', 'painters');   
    
hTitle  = title ('$A = 0.50$ m$^{-1}$\,, $\omega = 10000$ s$^{-1}$\,, $T_A = 298.15$ K','interpreter','latex');
hXLabel = xlabel('\theta (-)');
hYLabel = ylabel('\Pi (-)');
 
hLegend = legend({'$0.00L$','$0.25L$','$0.50L$','$0.75L$', '$1.00L$'}, ...
'Position',[0.787363676810627 0.146806268519677 0.107613469985358 0.133946830265849], ...
'interpreter','latex','FontSize'   , FontSize );

set(gca, 'FontName', FontName);
set([hTitle, hXLabel, hYLabel], 'FontName', FontName);
set([hLegend, gca], 'FontSize', FontSize - 4);
set([hXLabel, hYLabel], 'FontSize', FontSize);
set( hTitle, 'FontSize', FontSize, 'FontWeight', 'bold');

set(gca, ...
  'Box'         , 'off'   , ...
  'TickDir'     , 'out'  , ...
  'TickLength'  , [.02 .02] , ...
  'XMinorTick'  , 'on'     , ...
  'YMinorTick'  , 'on'     , ...
  'LineWidth'   , 1.0);

%print(gcf, '-r300', '19.png', '-dpng');

