% WrapperConQuantLatinHyperCubeBothPatchesSamePlot % % Script delivers plots with both patches on one plot for one set of intial % conditions for each sub plot. The intial condition come from the Latin % Hyper Cube method sampler. The LatinHyperCubeSampler output is used to % create pairs of intial conditions. Both patches are constructed in % parallel and have an Interption time of 0.1 and run the Lotka Volterra % System. % % Requirements: % Array output from LVConservedQuant % PlotConservedPatchA % PlotPhaseSpacePatchA % PlotConservedPatchB % PlotPhaseSpacePatchB % IntialConditions.mat from LatinHyperCubeSampler % % Geneva Mottet UAF 7-18-18 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear all % Loads the IntialConditions.mat from LatinHyperCubeSampler load('IntialConditions.mat') clear MaxNumOfCon % Scaling and number of intial conditions RowsOfPlots = 4; ColumnOfPlots = 3; NumberOfConditions = RowsOfPlots*ColumnOfPlots; MaxHostPop = 1000; MaxParaPop = MaxHostPop; % Sets the intial HA and PA HA0 = IntialConditions(1:NumberOfConditions,1)*MaxHostPop; PA0 = IntialConditions(1:NumberOfConditions,2)*MaxParaPop; HB0 = IntialConditions(1:NumberOfConditions,3)*MaxHostPop; PB0 = IntialConditions(1:NumberOfConditions,4)*MaxParaPop; % Sets loop parameters InterruptionTime = 0.1; % Only need 0.1, not full range looplength = 1000; % Intializes for loop ConArray = [];%zeros(length(HA0),length(InterTime),1000000); AllSAtotal = []; AllSBtotal = []; AllHAtotal = []; AllPAtotal = []; AllHBtotal = []; AllPBtotal = []; for k = 1:length(HA0) HA = HA0(k); PA = PA0(k); HB = HB0(k); PB = PB0(k); LVConservedQuant AllSAtotal(1:size(SAtotal),k) = SAtotal; AllSBtotal(1:size(SBtotal),k) = SBtotal; AllHAtotal(1:size(XAtotal),k) = XAtotal(:,1); AllPAtotal(1:size(XAtotal),k) = XAtotal(:,2); AllHBtotal(1:size(XBtotal),k) = XBtotal(:,1); AllPBtotal(1:size(XBtotal),k) = XBtotal(:,2); ConArrayA(1:size(conquantA),k) = conquantA; ConArrayB(1:size(conquantB),k) = conquantB; MyTitle(k) = cellstr(['HA = ', num2str(HA0(k),'%.0f'),'HB = ', num2str(HB0(k),'%.0f'),' PA = ',num2str(PA0(k),'%.0f'),' PB = ',num2str(PB0(k),'%.0f')]); end % Cleans up arrays from for loop ConArrayA(ConArrayA(:,:) == 0) = NaN; ConArrayB(ConArrayB(:,:) == 0) = NaN; AllHAtotal(AllHAtotal(:,:) == 0) = NaN; AllPAtotal(AllPAtotal(:,:) == 0) = NaN; AllHBtotal(AllHBtotal(:,:) == 0) = NaN; AllPBtotal(AllPBtotal(:,:) == 0) = NaN; Version2DataConArrayA = ConArrayA; Version2DataConArrayB = ConArrayB; Version2DataHAtotal = AllHAtotal; Version2DataPAtotal = AllPAtotal; Version2DataHBtotal = AllHBtotal; Version2DataPBtotal = AllPBtotal; save('Version2DataConArrayA.mat') save('Version2DataConArrayB.mat') save('Version2DataHAtotal.mat') save('Version2DataPAtotal.mat') save('Version2DataHBtotal.mat') save('Version2DataPBtotal.mat') % Plotting each patch's phase space and conserved quanities MaxValue = 2500; PlotPhaseSpaceBothPatches