% WrapperConQuantLatinHyperCubeIntialConditions % % Script delivers two plots the first is of phase space for the intial % conditions chosen by the Latin Hyper Cube method, and the second is of % the conserved quanities for intial conditions from the % LatinHyperCubeSampler code for an Interption time of 0.1 for a one patch % Lotka Volterra System. % % Requirements: % Array output from LVConservedQuant % PlotConserved % PlotPhaseSpace % IntialConditions.mat from LatinHyperCubeSampler % % Geneva Mottet UAF 7-10-18 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear all % Loads the IntialConditions.mat from LatinHyperCubeSampler load('IntialConditions.mat') clear MaxNumOfCon % Scaling and number of intial conditions NumberOfConditions = 10; MaxHostPop = 1000; MaxParaPop = MaxHostPop; % Sets the intial HA and PA HA0 = IntialConditions(1:NumberOfConditions,1)*MaxHostPop; PA0 = IntialConditions(1:NumberOfConditions,2)*MaxParaPop; % Sets loop parameters InterTime = 0.1; % Only need 0.1, not full range looplength = 1000; % Intializes for loop ConArray = [];%zeros(length(HA0),length(InterTime),1000000); AllStotal = []; AllHAtotal = []; AllPAtotal = []; for k = 1:length(HA0) HA = HA0(k); PA = PA0(k); InterruptionTime = InterTime; LVConservedQuant AllStotal(k,1:size(Stotal)) = Stotal; AllHAtotal(k,1:size(Xtotal)) = Xtotal(:,1); AllPAtotal(k,1:size(Xtotal)) = Xtotal(:,2); ConArray(k,1:size(conquant)) = conquant; end % Cleans up arrays from for loop ConArray(ConArray(:,:) == 0) = NaN; AllHAtotal(AllHAtotal(:,:) == 0) = NaN; AllPAtotal(AllPAtotal(:,:) == 0) = NaN; Version1DataConArray = ConArray; Version1DataHAtotal = AllHAtotal; Version1DataPAtotal = AllPAtotal; save('Version1DataConArray.mat') save('Version1DataHAtotal.mat') save('Version1DataPAtotal.mat') % Creates plots of phase space and conserved quanity figure('Position',[1,1,1000,1000]) subplot(1,2,1) PlotPhaseSpace subplot(1,2,2) MinY = -12; MaxY = 8; PlotConservedIntialConditions