%plot of G_b(eta) for fire-diffuse-fire model
clear

set(0,                           ...
   'defaultaxesfontsize', 20,   ...
   'defaultaxeslinewidth', 1.2, ...
   'defaultlinelinewidth', 2.0, ...
   'defaultpatchlinewidth', 0.7); 

  etvals = 4000;
deta = 0.015;
 
N = 1000;
n = [1:N]'*ones(1,etvals);
eta = ones(N,1)*[1:etvals]*deta;
bvals = [0.025,0.1,0.25];

for bn = 1:3
   b = bvals(bn); 
    

f=b*exp(-n./(4*eta)- n.*eta)./(sqrt(4*pi*n.*eta));
fs=sum(f);

figure(1)
plot([1:etvals]*deta,fs,'linewidth',2)
hold on
xlabel('\delta\tau ','fontsize',22)
ylabel('\theta = g_\beta(\delta\tau)','fontsize',22)
text(1,.031,'\beta = 0.025','fontsize',20)
text(0.18,0.0073,'\beta = 0.25','fontsize',20)
text(0.18,0.024,'\beta = 0.1','fontsize',20)
axis([0 4 0 0.06])
 
figure(2)
plot(fs,1./([1:etvals]*deta),'linewidth',2)
hold on
ylabel('1/\delta\tau','fontsize',22)
xlabel('\theta = c^*L/\sigma','fontsize',22)
text(0.0062,3,'\beta = 0.25','fontsize',20)
text( 0.02,5,'\beta = 0.1','fontsize',20)
text( 0.03,8,'\beta = 0.025','fontsize',20)
axis([0 0.06 0 12])

end

