1function ignite_uv(gas)
2%  IGNITE_UV   Solves the same ignition problem as 'ignite2', except
3%  that function conuv is used instead of reactor.
4%
5help ignite_uv
6
7if nargin == 0
8   gas = Solution('gri30.yaml');
9end
10
11mw = molecularWeights(gas);
12set(gas,'T',1001.0,'P',oneatm,'X','H2:2,O2:1,N2:4');
13
14y0 = [temperature(gas)
15      massFractions(gas)];
16tel = [0 0.001];
17options = odeset('RelTol',1.e-5,'AbsTol',1.e-12,'Stats','on');
18t0 = cputime;
19out = ode15s(@conuv,tel,y0,options,gas,mw);
20disp(['CPU time = ' num2str(cputime - t0)]);
21
22if nargout == 0
23   % plot the temperature and OH mole fractions.
24   figure(1);
25   plot(out.x,out.y(1,:));
26   xlabel('time');
27   ylabel('Temperature');
28   title(['Final T = ' num2str(out.y(1,end)) ' K']);
29
30   figure(2);
31   ioh = speciesIndex(gas,'OH');
32   plot(out.x,out.y(1+ioh,:));
33   xlabel('time');
34   ylabel('Mass Fraction');
35   title('OH Mass Fraction');
36end
37