clear all

startup

fcorr=0.5; epsnr=1.e-4;   % decrease fcorr if convergense problems (fcorr=0.5)

Tinit=linspace(360,510,30);    % gives upper steady-state ;  To = 511.565

Tss1=ssnr(Tinit,fcorr,epsnr); % steady-state vector

t_start=0;
t_end=9000;
tspan=[t_start t_end];

[tid,T]=ode15s('reguleringsim',tspan,Tss1);  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Cvec=[];
for i=length(tid):-1:1
   c=concprof(tid(i),T(i,:)');
   Cvec(i,:)=c(:)';
end 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

figure(1)                                      
plot(tid,T(:,1))

figure(2)                                      
plot(tid,T(:,30))

figure(3)
plot(tid,Cvec(:,30))