% Answer the questions to run the model from start to end. global PARAMS TRU PARAMS_init % This is fixed so that the run is the same always! % Based on Jan Mandel's code, modified slightly. disp('Run initializion or load from file? ') lgi = input(' 1 = Load from file, 0 = Run initialization ') if(lgi); if(exist('INIT.mat','file')); load INIT; else disp('No INIT.mat file found. Running Initialization '); lgi=0; end end if(~lgi) % Initialize and do the run TRU = PARAMS.u0; Nt = input('How many interations to run in Fire Model? (Default = 100) '); if(isempty(Nt)); Nt = 100, end TRU = forward_1d(TRU,Nt,1); % J.Mandel's code, modified to suit my needs save INIT PARAMS TRU disp(' ') disp(' ') disp('How Variable are the Data? ') sdT = input('Input the standard deviation for the Temperature Obs. (20) '); if(isempty(sdT)); sdT = 20; disp('sd(Temp) = 20'); end disp(' ') sdS = input('Input the standard deviation for the Fuel Supply Obs. (.1)'); if(isempty(sdS)); sdS = .1; disp('sd(Supply) = 0.1'); end; disp(' ') disp(' ') disp('Now, some questions about the Prior Distribution') disp(' ') disp('Prior Distribution variance is a multiple of the Observation. Var') tau = input('TAU: Inflation Factor for Prior Variance (Default: tau=1) '); if(isempty(tau)); tau = 1, end disp(' ') disp('Is there spatial correlation ( T(i), T(j) )?') rng = input('Spatial Range Parameter (Default: rng = .2, high corr.) '); if(isempty(rng) || rng<0); rng = .2, end disp(' ') disp('Are Temp and Supply at the same location correlaeted?') corTS = input('Default: cor( T(j), S(j) ) = -.25 '); if(isempty(corTS)); corTS = -.25, end disp(' ') COV_init disp(' ') disp(' ') disp('What Ensemble size do you want? ') n1 = input('Input Total Ensemble Size (Nens = 100)'); if(isempty(n1)); Nens = 100, end Nens = n1; disp(' ') disp('How many of these ensemble members are based on') disp('the truth shifted left and right? ') n2 = input('Number at each of 3 shifts left and right '); if(isempty(n2)); n2 = 3, end n1 = Nens - n2*6; ens0 = ENSEMBLE0_init(n1,n2); save INIT; end disp(' ') disp(' ') disp('The following variables have been saved in INIT.mat') disp('in the current directory'); whos