function PARAMS_init(Nt) % % Sets up initial conditions for PARAMS % global PARAMS TRU rand('state',0); randn('state',0) % make sure output is the same every time disp('random generators reset') % mesh size m = 100; % grid points Xsize= 1; % generate mesh x = (0:m-1)'*Xsize/(m-1); z = sin(3*x); % terrain height dx = Xsize/(m-1); % increment in x % set initial values S0 = ones(m,1); gap = round(0.45*m):round(0.50*m); S0(gap)=0; % initial fuel Ti = 250; Ti = 300; Ta = Ti*0.8 ; % ambient atmosphere temperature T0 = ones(m,1)*Ta; % initial temperature fire_x = round(0.25*m):round(0.28*m); % initial fire T0(fire_x) = Ti*2; dt = 0.005; % time step time = 1.2; % duration c1 = 1e-3; % diffusion c1 = 1e-2; c4 = 1800; % specific heat of fuel c2 = 3; % cooling delta2 = 250; % randomness in equation delta2 = 100; cs = 0.3; % randomness in fuel supply, between 0 and 1 Ps = 50; % spotting density Ps = 100; Ds = 0.05; % spotting distance Ds = 0.1; Ws = 0.5; % spotting caried by wind cslope = 0.005; windx = 0.1*(0.1*ones(m,1)+0.05*rand(m,1)); % effect of wind and slope vx = windx(:)+cslope*[0;(0.5/dx)*(z(3:m)-z(1:m-2));0]; T = T0(:); S = S0(:); S = S+(cs*2)*(S.*(rand(size(S))-0.5)); Smax = max(S); % OUTPUT TRU = [T;S]; PARAMS.u0 = [T;S]; PARAMS.mesh.m = m; PARAMS.mesh.x = x; PARAMS.mesh.dx = dx; PARAMS.mesh.z = z; PARAMS.dt = dt; PARAMS.Smax = Smax; PARAMS.Ti = Ti; PARAMS.time = time; PARAMS.delta2 = delta2; PARAMS.c1 = c1; PARAMS.c2 = c2; PARAMS.c3 = 1; PARAMS.Ta = Ta; PARAMS.c4 = c4; PARAMS.Ps = Ps; PARAMS.Ds = Ds; PARAMS.Ws = Ws; PARAMS.mesh.vx = vx; PARAMS.time = 0; PARAMS.stepno = 1; PARAMS.history=true; PARAMS.drawpic=true;