diff --git a/API/controlsClass.m b/API/controlsClass.m index 31ab76887..d32a9e829 100644 --- a/API/controlsClass.m +++ b/API/controlsClass.m @@ -33,6 +33,8 @@ % Which procedure RAT should execute. Can be 'calculate', 'simplex', 'de', 'ns', or 'dream'. % calcSldDuringFit : logical, default: false % Whether SLD will be calculated during fit (for live plotting etc.) + % numSimulationPoints : whole number, default: 500 + % The number of points used for a reflectivity simulation where no data is present. % resampleMinAngle : float, default: 0.9 % The upper threshold on the angle between three sampled points for resampling, in units of radians over pi. % resampleNPoints : whole number, default: 50 @@ -93,6 +95,7 @@ procedure = procedures.Calculate.value parallel = parallelOptions.Single.value calcSldDuringFit = false + numSimulationPoints = 500 resampleMinAngle = 0.9 resampleNPoints = 50 display = displayOptions.Iter.value @@ -170,6 +173,14 @@ end obj.updatePlotFreq = val; end + + function set.numSimulationPoints(obj,val) + validateNumber(val, 'numSimulationPoints must be a whole number', true); + if (val < 2) + throw(exceptions.invalidValue('numSimulationPoints must be greater or equal to 2')); + end + obj.numSimulationPoints = val; + end function set.resampleMinAngle(obj,val) validateNumber(val, 'resampleMinAngle must be a number'); @@ -462,6 +473,7 @@ 'nMCMC', {obj.nMCMC},... 'propScale', {obj.propScale},... 'nsTolerance', {obj.nsTolerance},... + 'numSimulationPoints', {obj.numSimulationPoints},... 'resampleMinAngle', {obj.resampleMinAngle},... 'resampleNPoints', {obj.resampleNPoints},... 'nSamples', {obj.nSamples},... @@ -528,15 +540,17 @@ % The parameters that can be set when using calculate procedure are % 1) parallel % 2) calcSldDuringFit - % 3) resampleMinAngle - % 4) resampleNPoints - % 5) display + % 3) numSimulationPoints + % 4) resampleMinAngle + % 5) resampleNPoints + % 6) display % The default values for Calculate defaultParallel = parallelOptions.Single.value; defaultCalcSldDuringFit = false; - defaultMinAngle = 0.9; - defaultNPoints = 50; + defaultNumSimulationPoints = 500; + defaultResampleMinAngle = 0.9; + defaultResampleNPoints = 50; defaultDisplay = displayOptions.Iter.value; % Creates the input parser for the calculate parameters @@ -544,18 +558,20 @@ p.PartialMatching = false; addParameter(p,'parallel', defaultParallel, @(x) isText(x) || isenum(x)); addParameter(p,'calcSldDuringFit', defaultCalcSldDuringFit, @islogical); - addParameter(p,'resampleMinAngle', defaultMinAngle, @isnumeric); - addParameter(p,'resampleNPoints', defaultNPoints, @isnumeric); + addParameter(p,'numSimulationPoints', defaultNumSimulationPoints, @isnumeric); + addParameter(p,'resampleMinAngle', defaultResampleMinAngle, @isnumeric); + addParameter(p,'resampleNPoints', defaultResampleNPoints, @isnumeric); addParameter(p,'display', defaultDisplay, @(x) isText(x) || isenum(x)); properties = varargin{:}; % Parses the input or raises invalidOption error - errorMsg = 'Only parallel, calcSldDuringFit, resampleMinAngle, resampleNPoints and display can be set while using the Calculate procedure'; + errorMsg = 'Only parallel, calcSldDuringFit, numSimulationPoints, resampleMinAngle, resampleNPoints and display can be set while using the Calculate procedure'; inputBlock = obj.parseInputs(p, properties, errorMsg); % Sets the values the for Calculate parameters obj.parallel = inputBlock.parallel; obj.calcSldDuringFit = inputBlock.calcSldDuringFit; + obj.numSimulationPoints = inputBlock.numSimulationPoints; obj.resampleMinAngle = inputBlock.resampleMinAngle; obj.resampleNPoints = inputBlock.resampleNPoints; obj.display = inputBlock.display; @@ -575,9 +591,10 @@ % 6) updatePlotFreq % 7) parallel % 8) calcSldDuringFit - % 9) resampleMinAngle - % 10) resampleNPoints - % 11) display + % 9) numSimulationPoints + % 10) resampleMinAngle + % 11) resampleNPoints + % 12) display % The simplex default values defaultXTolerance = 1e-6; @@ -588,8 +605,9 @@ defaultUpdatePlotFreq = 20; defaultParallel = parallelOptions.Single.value; defaultCalcSldDuringFit = false; - defaultMinAngle = 0.9; - defaultNPoints = 50; + defaultNumSimulationPoints = 500; + defaultResampleMinAngle = 0.9; + defaultResampleNPoints = 50; defaultDisplay = displayOptions.Iter.value; % Parses the input for simplex parameters @@ -603,13 +621,14 @@ addParameter(p,'updatePlotFreq', defaultUpdatePlotFreq, @isnumeric); addParameter(p,'parallel', defaultParallel, @(x) isText(x) || isenum(x)); addParameter(p,'calcSldDuringFit', defaultCalcSldDuringFit, @islogical); - addParameter(p,'resampleMinAngle', defaultMinAngle, @isnumeric); - addParameter(p,'resampleNPoints', defaultNPoints, @isnumeric); + addParameter(p,'numSimulationPoints', defaultNumSimulationPoints, @isnumeric); + addParameter(p,'resampleMinAngle', defaultResampleMinAngle, @isnumeric); + addParameter(p,'resampleNPoints', defaultResampleNPoints, @isnumeric); addParameter(p,'display', defaultDisplay, @(x) isText(x) || isenum(x)); properties = varargin{:}; % Parses the input or raises invalidOption error - errorMsg = 'Only xTolerance, funcTolerance, maxFuncEvals, maxIterations, updateFreq, updatePlotFreq, parallel, calcSldDuringFit, resampleMinAngle, resampleNPoints and display can be set while using the Simplex procedure.'; + errorMsg = 'Only xTolerance, funcTolerance, maxFuncEvals, maxIterations, updateFreq, updatePlotFreq, parallel, calcSldDuringFit, numSimulationPoints, resampleMinAngle, resampleNPoints and display can be set while using the Simplex procedure.'; inputBlock = obj.parseInputs(p, properties, errorMsg); % Sets the values the for simplex parameters @@ -621,6 +640,7 @@ obj.updatePlotFreq = inputBlock.updatePlotFreq; obj.parallel = inputBlock.parallel; obj.calcSldDuringFit = inputBlock.calcSldDuringFit; + obj.numSimulationPoints = inputBlock.numSimulationPoints; obj.resampleMinAngle = inputBlock.resampleMinAngle; obj.resampleNPoints = inputBlock.resampleNPoints; obj.display = inputBlock.display; @@ -640,11 +660,12 @@ % 6) numGenerations % 7) parallel % 8) calcSldDuringFit - % 9) resampleMinAngle - % 10) resampleNPoints - % 11) display - % 12) updateFreq - % 13) updatePlotFreq + % 9) numSimulationPoints + % 10) resampleMinAngle + % 11) resampleNPoints + % 12) display + % 13) updateFreq + % 14) updatePlotFreq % The default values for DE defaultPopulationSize = 20; @@ -655,8 +676,9 @@ defaultNumGenerations = 500; defaultParallel = parallelOptions.Single.value; defaultCalcSldDuringFit = false; - defaultMinAngle = 0.9; - defaultNPoints = 50; + defaultNumSimulationPoints = 500; + defaultResampleMinAngle = 0.9; + defaultResampleNPoints = 50; defaultDisplay = displayOptions.Iter.value; defaultUpdateFreq = 1; defaultUpdatePlotFreq = 20; @@ -672,15 +694,16 @@ addParameter(p,'numGenerations', defaultNumGenerations, @isnumeric); addParameter(p,'parallel', defaultParallel, @(x) isText(x) || isenum(x)); addParameter(p,'calcSldDuringFit', defaultCalcSldDuringFit, @islogical); - addParameter(p,'resampleMinAngle', defaultMinAngle, @isnumeric); - addParameter(p,'resampleNPoints', defaultNPoints, @isnumeric); + addParameter(p,'numSimulationPoints', defaultNumSimulationPoints, @isnumeric); + addParameter(p,'resampleMinAngle', defaultResampleMinAngle, @isnumeric); + addParameter(p,'resampleNPoints', defaultResampleNPoints, @isnumeric); addParameter(p,'display', defaultDisplay, @(x) isText(x) || isenum(x)); addParameter(p,'updateFreq', defaultUpdateFreq, @isnumeric); addParameter(p,'updatePlotFreq', defaultUpdatePlotFreq, @isnumeric); properties = varargin{:}; % Parses the input or raises invalidOption error - errorMsg = 'Only populationSize, fWeight, crossoverProbability, strategy, targetValue, numGenerations, parallel, calcSldDuringFit, resampleMinAngle, resampleNPoints, display, updateFreq, and updatePlotFreq can be set while using the Differential Evolution procedure'; + errorMsg = 'Only populationSize, fWeight, crossoverProbability, strategy, targetValue, numGenerations, parallel, calcSldDuringFit, numSimulationPoints, resampleMinAngle, resampleNPoints, display, updateFreq, and updatePlotFreq can be set while using the Differential Evolution procedure'; inputBlock = obj.parseInputs(p, properties, errorMsg); % Sets the values the for DE parameters @@ -692,6 +715,7 @@ obj.numGenerations = inputBlock.numGenerations; obj.parallel = inputBlock.parallel; obj.calcSldDuringFit = inputBlock.calcSldDuringFit; + obj.numSimulationPoints = inputBlock.numSimulationPoints; obj.resampleMinAngle = inputBlock.resampleMinAngle; obj.resampleNPoints = inputBlock.resampleNPoints; obj.display = inputBlock.display; @@ -711,9 +735,10 @@ % 4) nsTolerance % 5) parallel % 6) calcSldDuringFit - % 7) resampleMinAngle - % 8) resampleNPoints - % 9) display + % 7) numSimulationPoints + % 8) resampleMinAngle + % 9) resampleNPoints + % 10) display % The default values for NS defaultnLive = 150; @@ -722,8 +747,9 @@ defaultNsTolerance = 0.1; defaultParallel = parallelOptions.Single.value; defaultCalcSldDuringFit = false; - defaultMinAngle = 0.9; - defaultNPoints = 50; + defaultNumSimulationPoints = 500; + defaultResampleMinAngle = 0.9; + defaultResampleNPoints = 50; defaultDisplay = displayOptions.Iter.value; % Creates the input parser for the NS parameters @@ -735,13 +761,14 @@ addParameter(p,'nsTolerance', defaultNsTolerance, @isnumeric); addParameter(p,'parallel', defaultParallel, @(x) isText(x) || isenum(x)); addParameter(p,'calcSldDuringFit', defaultCalcSldDuringFit, @islogical); - addParameter(p,'resampleMinAngle', defaultMinAngle, @isnumeric); - addParameter(p,'resampleNPoints', defaultNPoints, @isnumeric); + addParameter(p,'numSimulationPoints', defaultNumSimulationPoints, @isnumeric); + addParameter(p,'resampleMinAngle', defaultResampleMinAngle, @isnumeric); + addParameter(p,'resampleNPoints', defaultResampleNPoints, @isnumeric); addParameter(p,'display', defaultDisplay, @(x) isText(x) || isenum(x)); properties = varargin{:}; % Parses the input or raises invalidOption error - errorMsg = 'Only nLive, nMCMC, propScale, nsTolerance, parallel, calcSldDuringFit, resampleMinAngle, resampleNPoints and display can be set while using the Nested Sampler procedure'; + errorMsg = 'Only nLive, nMCMC, propScale, nsTolerance, parallel, calcSldDuringFit, numSimulationPoints, resampleMinAngle, resampleNPoints and display can be set while using the Nested Sampler procedure'; inputBlock = obj.parseInputs(p, properties, errorMsg); % Sets the values the for NS parameters @@ -751,6 +778,7 @@ obj.nsTolerance = inputBlock.nsTolerance; obj.parallel = inputBlock.parallel; obj.calcSldDuringFit = inputBlock.calcSldDuringFit; + obj.numSimulationPoints = inputBlock.numSimulationPoints; obj.resampleMinAngle = inputBlock.resampleMinAngle; obj.resampleNPoints = inputBlock.resampleNPoints; obj.display = inputBlock.display; @@ -770,9 +798,10 @@ % 6) adaptPCR % 7) parallel % 8) calcSldDuringFit - % 9) resampleMinAngle - % 10) resampleNPoints - % 11) display + % 9) numSimulationPoints + % 10) resampleMinAngle + % 11) resampleNPoints + % 12) display % The default values for Dream defaultNSamples = 50000; @@ -783,8 +812,9 @@ defaultAdaptPCR = false; defaultParallel = parallelOptions.Single.value; defaultCalcSldDuringFit = false; - defaultMinAngle = 0.9; - defaultNPoints = 50; + defaultNumSimulationPoints = 500; + defaultResampleMinAngle = 0.9; + defaultResampleNPoints = 50; defaultDisplay = displayOptions.Iter.value; % Creates the input parser for the Dream parameters @@ -798,13 +828,14 @@ addParameter(p,'adaptPCR', defaultAdaptPCR, @islogical); addParameter(p,'parallel', defaultParallel, @(x) isText(x) || isenum(x)); addParameter(p,'calcSldDuringFit', defaultCalcSldDuringFit, @islogical); - addParameter(p,'resampleMinAngle', defaultMinAngle, @isnumeric); - addParameter(p,'resampleNPoints', defaultNPoints, @isnumeric); + addParameter(p,'numSimulationPoints', defaultNumSimulationPoints, @isnumeric); + addParameter(p,'resampleMinAngle', defaultResampleMinAngle, @isnumeric); + addParameter(p,'resampleNPoints', defaultResampleNPoints, @isnumeric); addParameter(p,'display', defaultDisplay, @(x) isText(x) || isenum(x)); properties = varargin{:}; % Parses the input or raises invalidOption error - errorMsg = 'Only nSamples, nChains, jumpProbability, pUnitGamma, boundHandling, adaptPCR, parallel, calcSldDuringFit, resampleMinAngle, resampleNPoints and display can be set while using the DREAM procedure'; + errorMsg = 'Only nSamples, nChains, jumpProbability, pUnitGamma, boundHandling, adaptPCR, parallel, calcSldDuringFit, numSimulationPoints, resampleMinAngle, resampleNPoints and display can be set while using the DREAM procedure'; inputBlock = obj.parseInputs(p, properties, errorMsg); % Sets the values the for Dream parameters @@ -816,6 +847,7 @@ obj.adaptPCR = inputBlock.adaptPCR; obj.parallel = inputBlock.parallel; obj.calcSldDuringFit = inputBlock.calcSldDuringFit; + obj.numSimulationPoints = inputBlock.numSimulationPoints; obj.resampleMinAngle = inputBlock.resampleMinAngle; obj.resampleNPoints = inputBlock.resampleNPoints; obj.display = inputBlock.display; diff --git a/compile/fullCompile/makeCompileArgsFull.m b/compile/fullCompile/makeCompileArgsFull.m index df986e814..5bb701be0 100644 --- a/compile/fullCompile/makeCompileArgsFull.m +++ b/compile/fullCompile/makeCompileArgsFull.m @@ -85,6 +85,7 @@ ARGS_1_2.procedure = coder.typeof('X',[1 maxArraySize],[0 1]); ARGS_1_2.parallel = coder.typeof('X',[1 maxArraySize],[0 1]); ARGS_1_2.calcSldDuringFit = coder.typeof(true); +ARGS_1_2.numSimulationPoints = coder.typeof(0); ARGS_1_2.resampleMinAngle = coder.typeof(0); ARGS_1_2.resampleNPoints = coder.typeof(0); ARGS_1_2.display = coder.typeof('X',[1 maxArraySize],[0 1]); diff --git a/compile/reflectivityCalculation/makeCompileArgs.m b/compile/reflectivityCalculation/makeCompileArgs.m index 4e6f9a413..5b462b65c 100644 --- a/compile/reflectivityCalculation/makeCompileArgs.m +++ b/compile/reflectivityCalculation/makeCompileArgs.m @@ -85,6 +85,7 @@ ARGS_1_2.procedure = coder.typeof('X',[1 maxArraySize],[0 1]); ARGS_1_2.parallel = coder.typeof('X',[1 maxArraySize],[0 1]); ARGS_1_2.calcSldDuringFit = coder.typeof(true); +ARGS_1_2.numSimulationPoints = coder.typeof(0); ARGS_1_2.resampleMinAngle = coder.typeof(0); ARGS_1_2.resampleNPoints = coder.typeof(0); ARGS_1_2.display = coder.typeof('X',[1 maxArraySize],[0 1]); diff --git a/examples/domains/standardLayers/domainsStandardLayersScript.m b/examples/domains/standardLayers/domainsStandardLayersScript.m index 5662b2c8e..27aacf398 100644 --- a/examples/domains/standardLayers/domainsStandardLayersScript.m +++ b/examples/domains/standardLayers/domainsStandardLayersScript.m @@ -95,6 +95,7 @@ % Make a controls class.... controls = controlsClass(); +controls.numSimulationPoints = 500; % Send everything to RAT.... [problem,results] = RAT(problem,controls); diff --git a/targetFunctions/+domainsTF/customLayers.m b/targetFunctions/+domainsTF/customLayers.m index 30965844d..b38f1e665 100644 --- a/targetFunctions/+domainsTF/customLayers.m +++ b/targetFunctions/+domainsTF/customLayers.m @@ -19,6 +19,7 @@ calcSld = controls.calcSldDuringFit; parallel = controls.parallel; + numSimulationPoints = controls.numSimulationPoints; resampleMinAngle = controls.resampleMinAngle; resampleNPoints = controls.resampleNPoints; @@ -79,8 +80,8 @@ bulkOutValues,resolutionParamValues,domainRatioValues,dataPresent(i),... data{i},dataLimits{i},simulationLimits{i},contrastBackgroundTypes{i},... contrastBackgroundActions{i},contrastResolutionTypes{i},... - customFiles,nParams,parallel,resampleMinAngle,resampleNPoints, ... - resample(i),geometry,subRoughs(i),calcSld,... + customFiles,nParams,parallel,numSimulationPoints,resampleMinAngle,... + resampleNPoints,resample(i),geometry,subRoughs(i),calcSld,... contrastLayers1{i},contrastLayers2{i}); end @@ -100,8 +101,8 @@ bulkOutValues,resolutionParamValues,domainRatioValues,dataPresent(i),... data{i},dataLimits{i},simulationLimits{i},contrastBackgroundTypes{i},... contrastBackgroundActions{i},contrastResolutionTypes{i},... - customFiles,nParams,parallel,resampleMinAngle,resampleNPoints,... - resample(i),geometry,subRoughs(i),calcSld,... + customFiles,nParams,parallel,numSimulationPoints,resampleMinAngle,... + resampleNPoints,resample(i),geometry,subRoughs(i),calcSld,... contrastLayers1{i},contrastLayers2{i}); end @@ -145,8 +146,8 @@ bulkInValues,bulkOutValues,resolutionParamValues,domainRatioValues,... dataPresent,data,dataLimits,simulationLimits,backgroundType,... backgroundAction,resolutionType,customFiles,nParams,parallel,... - resampleMinAngle,resampleNPoints,resample,geometry,roughness,calcSld,... - contrastLayers1,contrastLayers2) + numSimulationPoints,resampleMinAngle,resampleNPoints,resample,geometry,... + roughness,calcSld,contrastLayers1,contrastLayers2) % Get the domain ratio for this contrast if isempty(domainRatioIndex) @@ -163,7 +164,7 @@ qzshiftValues,scalefactorValues,bulkInValues,bulkOutValues); % Apply scale factors and q shifts to the data - shiftedData = shiftData(scalefactor,qzshift,dataPresent,data,dataLimits,simulationLimits); + shiftedData = shiftData(scalefactor,qzshift,dataPresent,data,dataLimits,simulationLimits,numSimulationPoints); [simulationXData, dataIndices] = makeSimulationRange(shiftedData, simulationLimits); background = constructBackground(backgroundType,backgroundParamIndex,... diff --git a/targetFunctions/+domainsTF/customXY.m b/targetFunctions/+domainsTF/customXY.m index b45b5f66c..4b10a79cb 100644 --- a/targetFunctions/+domainsTF/customXY.m +++ b/targetFunctions/+domainsTF/customXY.m @@ -12,6 +12,7 @@ ~, data, dataLimits, simulationLimits, ~, ~, customFiles, ~] = extractProblemParams(problemStruct); parallel = controls.parallel; + numSimulationPoints = controls.numSimulationPoints; resampleMinAngle = controls.resampleMinAngle; resampleNPoints = controls.resampleNPoints; @@ -70,7 +71,8 @@ data{i},dataLimits{i},simulationLimits{i},... contrastBackgroundTypes{i},contrastBackgroundActions{i},... contrastResolutionTypes{i},customFiles,nParams,parallel,... - resampleMinAngle,resampleNPoints,subRoughs(i),slds1{i},slds2{i}); + numSimulationPoints,resampleMinAngle,resampleNPoints,... + subRoughs(i),slds1{i},slds2{i}); end @@ -90,7 +92,8 @@ data{i},dataLimits{i},simulationLimits{i},... contrastBackgroundTypes,contrastBackgroundActions{i},... contrastResolutionTypes{i},customFiles,nParams,parallel,... - resampleMinAngle,resampleNPoints,subRoughs(i),slds1{i},slds2{i}); + numSimulationPoints,resampleMinAngle,resampleNPoints,... + subRoughs(i),slds1{i},slds2{i}); end @@ -135,7 +138,8 @@ bulkInValues,bulkOutValues,resolutionParamValues,domainRatioValues,... dataPresent,data,dataLimits,simulationLimits,backgroundType,... backgroundAction,resolutionType,customFiles,nParams,parallel,... - resampleMinAngle,resampleNPoints,roughness,sldProfile1,sldProfile2) + numSimulationPoints,resampleMinAngle,resampleNPoints,roughness,... + sldProfile1,sldProfile2) % Get the domain ratio for this contrast if isempty(domainRatioIndex) @@ -165,7 +169,7 @@ resampledLayers = {layers1, layers2}; sldProfile = {sldProfile1, sldProfile2}; - shiftedData = shiftData(scalefactor,qzshift,dataPresent,data,dataLimits,simulationLimits); + shiftedData = shiftData(scalefactor,qzshift,dataPresent,data,dataLimits,simulationLimits,numSimulationPoints); [simulationXData, dataIndices] = makeSimulationRange(shiftedData, simulationLimits); background = constructBackground(backgroundType,backgroundParamIndex,... diff --git a/targetFunctions/+domainsTF/standardLayers.m b/targetFunctions/+domainsTF/standardLayers.m index b5ad2493d..38956fb6d 100644 --- a/targetFunctions/+domainsTF/standardLayers.m +++ b/targetFunctions/+domainsTF/standardLayers.m @@ -20,6 +20,7 @@ calcSld = controls.calcSldDuringFit; parallel = controls.parallel; + numSimulationPoints = controls.numSimulationPoints; resampleMinAngle = controls.resampleMinAngle; resampleNPoints = controls.resampleNPoints; @@ -79,8 +80,8 @@ data{i},dataLimits{i},simulationLimits{i},repeatLayers(i),... contrastBackgroundTypes{i},contrastBackgroundActions{i},... contrastResolutionTypes{i},customFiles,nParams,parallel,... - resampleMinAngle,resampleNPoints,resample(i),geometry,... - subRoughs(i),calcSld,domainContrastLayers1{i},... + numSimulationPoints,resampleMinAngle,resampleNPoints,resample(i),... + geometry,subRoughs(i),calcSld,domainContrastLayers1{i},... domainContrastLayers2{i},layerValues); end @@ -102,8 +103,8 @@ data{i},dataLimits{i},simulationLimits{i},repeatLayers(i),... contrastBackgroundTypes{i},contrastBackgroundActions{i},... contrastResolutionTypes{i},customFiles,nParams,parallel,... - resampleMinAngle,resampleNPoints,resample(i),geometry,... - subRoughs(i),calcSld,domainContrastLayers1{i},... + numSimulationPoints,resampleMinAngle,resampleNPoints,resample(i),... + geometry,subRoughs(i),calcSld,domainContrastLayers1{i},... domainContrastLayers2{i},layerValues); end @@ -147,8 +148,9 @@ bulkInValues,bulkOutValues,resolutionParamValues,domainRatioValues,... dataPresent,data,dataLimits,simulationLimits,repeatLayers,... backgroundType,backgroundAction,resolutionType,customFiles,nParams,... - parallel,resampleMinAngle,resampleNPoints,resample,geometry,roughness,... - calcSld,domainLayersIndices1,domainLayersIndices2,layerValues) + parallel,numSimulationPoints,resampleMinAngle,resampleNPoints,resample,... + geometry,roughness,calcSld,domainLayersIndices1,domainLayersIndices2,... + layerValues) % Get the domain ratio for this contrast if isempty(domainRatioIndex) @@ -171,7 +173,7 @@ contrastLayers2 = allocateLayersForContrast(domainLayersIndices2,layerValues); % Apply scale factors and q shifts to the data - shiftedData = shiftData(scalefactor,qzshift,dataPresent,data,dataLimits,simulationLimits); + shiftedData = shiftData(scalefactor,qzshift,dataPresent,data,dataLimits,simulationLimits,numSimulationPoints); [simulationXData, dataIndices] = makeSimulationRange(shiftedData, simulationLimits); background = constructBackground(backgroundType,backgroundParamIndex,... diff --git a/targetFunctions/+normalTF/customLayers.m b/targetFunctions/+normalTF/customLayers.m index dcb468b18..37b095a21 100644 --- a/targetFunctions/+normalTF/customLayers.m +++ b/targetFunctions/+normalTF/customLayers.m @@ -18,6 +18,7 @@ calcSld = controls.calcSldDuringFit; parallel = controls.parallel; + numSimulationPoints = controls.numSimulationPoints; resampleMinAngle = controls.resampleMinAngle; resampleNPoints = controls.resampleNPoints; @@ -58,8 +59,8 @@ dataPresent(i),data{i},dataLimits{i},simulationLimits{i},... contrastBackgroundTypes{i},contrastBackgroundActions{i},... contrastResolutionTypes{i},customFiles,nParams,parallel,... - resampleMinAngle,resampleNPoints,resample(i),geometry,... - subRoughs(i),calcSld,contrastLayers{i}); + numSimulationPoints,resampleMinAngle,resampleNPoints,... + resample(i),geometry,subRoughs(i),calcSld,contrastLayers{i}); end @@ -79,8 +80,8 @@ dataPresent(i),data{i},dataLimits{i},simulationLimits{i},... contrastBackgroundTypes{i},contrastBackgroundActions{i},... contrastResolutionTypes{i},customFiles,nParams,parallel,... - resampleMinAngle,resampleNPoints,resample(i),geometry,... - subRoughs(i),calcSld,contrastLayers{i}); + numSimulationPoints,resampleMinAngle,resampleNPoints,... + resample(i),geometry,subRoughs(i),calcSld,contrastLayers{i}); end @@ -104,8 +105,8 @@ backgroundParamValues,qzshiftValues,scalefactorValues,bulkInValues,... bulkOutValues,resolutionParamValues,dataPresent,data,dataLimits,... simulationLimits,backgroundType,backgroundAction,resolutionType,... - customFiles,nParams,parallel,resampleMinAngle,resampleNPoints,... - resample,geometry,roughness,calcSld,contrastLayers) + customFiles,nParams,parallel,numSimulationPoints,resampleMinAngle,... + resampleNPoints,resample,geometry,roughness,calcSld,contrastLayers) % Extract the relevant parameter values for this contrast % from the input arrays. @@ -116,7 +117,7 @@ qzshiftValues,scalefactorValues,bulkInValues,bulkOutValues); % Apply scale factors and q shifts to the data - shiftedData = shiftData(scalefactor,qzshift,dataPresent,data,dataLimits,simulationLimits); + shiftedData = shiftData(scalefactor,qzshift,dataPresent,data,dataLimits,simulationLimits,numSimulationPoints); [simulationXData, dataIndices] = makeSimulationRange(shiftedData, simulationLimits); background = constructBackground(backgroundType,backgroundParamIndex,... diff --git a/targetFunctions/+normalTF/customXY.m b/targetFunctions/+normalTF/customXY.m index 5bf9f8751..63c84a903 100644 --- a/targetFunctions/+normalTF/customXY.m +++ b/targetFunctions/+normalTF/customXY.m @@ -13,6 +13,7 @@ customFiles, ~] = extractProblemParams(problemStruct); parallel = controls.parallel; + numSimulationPoints = controls.numSimulationPoints; resampleMinAngle = controls.resampleMinAngle; resampleNPoints = controls.resampleNPoints; @@ -52,7 +53,8 @@ dataPresent(i),data{i},dataLimits{i},simulationLimits{i},... contrastBackgroundTypes{i},contrastBackgroundActions{i},... contrastResolutionTypes{i},customFiles,nParams,parallel,... - resampleMinAngle,resampleNPoints,subRoughs(i),slds{i}); + numSimulationPoints,resampleMinAngle,resampleNPoints,... + subRoughs(i),slds{i}); end else @@ -70,7 +72,8 @@ dataPresent(i),data{i},dataLimits{i},simulationLimits{i},... contrastBackgroundTypes{i},contrastBackgroundActions{i},... contrastResolutionTypes{i},customFiles,nParams,parallel,... - resampleMinAngle,resampleNPoints,subRoughs(i),slds{i}); + numSimulationPoints,resampleMinAngle,resampleNPoints,... + subRoughs(i),slds{i}); end @@ -95,7 +98,8 @@ backgroundParams,qzshiftValues,scalefactorValues,bulkInValues,bulkOutValues,... resolutionParamValues,dataPresent,data,dataLimits,simulationLimits,... backgroundType,backgroundAction,resolutionType,customFiles,nParams,... - parallel,resampleMinAngle,resampleNPoints,roughness,sldProfile) + parallel,numSimulationPoints,resampleMinAngle,resampleNPoints,roughness,... + sldProfile) % Extract the relevant parameter values for this contrast % from the input arrays. @@ -113,7 +117,7 @@ layers = resampledLayers; % Apply scale factors and q shifts to the data - shiftedData = shiftData(scalefactor,qzshift,dataPresent,data,dataLimits,simulationLimits); + shiftedData = shiftData(scalefactor,qzshift,dataPresent,data,dataLimits,simulationLimits,numSimulationPoints); [simulationXData, dataIndices] = makeSimulationRange(shiftedData, simulationLimits); background = constructBackground(backgroundType,backgroundParamIndex,... diff --git a/targetFunctions/+normalTF/standardLayers.m b/targetFunctions/+normalTF/standardLayers.m index b74646ae8..9a22a189d 100644 --- a/targetFunctions/+normalTF/standardLayers.m +++ b/targetFunctions/+normalTF/standardLayers.m @@ -19,6 +19,7 @@ calcSld = controls.calcSldDuringFit; parallel = controls.parallel; + numSimulationPoints = controls.numSimulationPoints; resampleMinAngle = controls.resampleMinAngle; resampleNPoints = controls.resampleNPoints; @@ -65,8 +66,8 @@ dataPresent(i),data{i},dataLimits{i},simulationLimits{i},repeatLayers(i),... contrastBackgroundTypes{i},contrastBackgroundActions{i},... contrastResolutionTypes{i},customFiles,nParams,parallel,... - resampleMinAngle,resampleNPoints,resample(i),geometry,... - subRoughs(i),calcSld,contrastLayersIndices{i},layerValues); + numSimulationPoints,resampleMinAngle,resampleNPoints,resample(i),... + geometry,subRoughs(i),calcSld,contrastLayersIndices{i},layerValues); end @@ -86,8 +87,8 @@ dataPresent(i),data{i},dataLimits{i},simulationLimits{i},repeatLayers(i),... contrastBackgroundTypes{i},contrastBackgroundActions{i},... contrastResolutionTypes{i},customFiles,nParams,parallel,... - resampleMinAngle,resampleNPoints,resample(i),geometry,... - subRoughs(i),calcSld,contrastLayersIndices{i},layerValues); + numSimulationPoints,resampleMinAngle,resampleNPoints,resample(i),... + geometry,subRoughs(i),calcSld,contrastLayersIndices{i},layerValues); end end @@ -110,8 +111,9 @@ backgroundParamValues,qzshiftValues,scalefactorValues,bulkInValues,... bulkOutValues,resolutionParamValues,dataPresent,data,dataLimits,... simulationLimits,repeatLayers,backgroundType,backgroundAction,... - resolutionType,customFiles,nParams,parallel,resampleMinAngle,resampleNPoints,... - resample,geometry,roughness,calcSld,layerIndices,layerValues) + resolutionType,customFiles,nParams,parallel,numSimulationPoints,... + resampleMinAngle,resampleNPoints,resample,geometry,roughness,calcSld,... + layerIndices,layerValues) % Extract the relevant parameter values for this contrast % from the input arrays. @@ -127,7 +129,7 @@ contrastLayers = allocateLayersForContrast(layerIndices,layerValues); % Apply scale factors and q shifts to the data - shiftedData = shiftData(scalefactor,qzshift,dataPresent,data,dataLimits,simulationLimits); + shiftedData = shiftData(scalefactor,qzshift,dataPresent,data,dataLimits,simulationLimits,numSimulationPoints); [simulationXData, dataIndices] = makeSimulationRange(shiftedData, simulationLimits); background = constructBackground(backgroundType,backgroundParamIndex, ... diff --git a/targetFunctions/common/shiftData.m b/targetFunctions/common/shiftData.m index 6a8a4f5d3..1f1fe6c5b 100644 --- a/targetFunctions/common/shiftData.m +++ b/targetFunctions/common/shiftData.m @@ -1,4 +1,4 @@ -function shiftedData = shiftData(scalefactor,qzshift,dataPresent,data,dataLimits,simulationLimits) +function shiftedData = shiftData(scalefactor,qzshift,dataPresent,data,dataLimits,simulationLimits,numSimulationPoints) % Shifts the data according to scale factor. If there is no data, makes % x-data over the simulation range. % @@ -9,6 +9,7 @@ % * data: problemStruct.data % * dataLimits: problemStruct.dataLimits % * simulationLimits: problemStruct.simulationLimits +% * numSimulationPoints: controls.numSimulationPoints % % OUTPUTS: % * shiftedData: Data shifted using given scale factor @@ -43,12 +44,11 @@ else - simPoints = 500; simLo = simulationLimits(1); simHi = simulationLimits(2); - simXData = linspace(simLo,simHi,simPoints); + simXData = linspace(simLo,simHi,numSimulationPoints); shiftedData = zeros(length(simXData), 6); - shiftedData(:, 1) = linspace(simLo,simHi,simPoints); + shiftedData(:, 1) = linspace(simLo,simHi,numSimulationPoints); end diff --git a/tests/domainsTFReflectivityCalculation/domainsCustomLayersInputs.mat b/tests/domainsTFReflectivityCalculation/domainsCustomLayersInputs.mat index 758dd6ff5..a92f79655 100644 Binary files a/tests/domainsTFReflectivityCalculation/domainsCustomLayersInputs.mat and b/tests/domainsTFReflectivityCalculation/domainsCustomLayersInputs.mat differ diff --git a/tests/domainsTFReflectivityCalculation/domainsCustomLayersOutputs.mat b/tests/domainsTFReflectivityCalculation/domainsCustomLayersOutputs.mat index 0741c240e..891e11bba 100644 Binary files a/tests/domainsTFReflectivityCalculation/domainsCustomLayersOutputs.mat and b/tests/domainsTFReflectivityCalculation/domainsCustomLayersOutputs.mat differ diff --git a/tests/domainsTFReflectivityCalculation/domainsCustomLayersTFParams.mat b/tests/domainsTFReflectivityCalculation/domainsCustomLayersTFParams.mat index a147cc261..89eaa0216 100644 Binary files a/tests/domainsTFReflectivityCalculation/domainsCustomLayersTFParams.mat and b/tests/domainsTFReflectivityCalculation/domainsCustomLayersTFParams.mat differ diff --git a/tests/domainsTFReflectivityCalculation/domainsCustomXYInputs.mat b/tests/domainsTFReflectivityCalculation/domainsCustomXYInputs.mat index d1eec25bc..8e72f2013 100644 Binary files a/tests/domainsTFReflectivityCalculation/domainsCustomXYInputs.mat and b/tests/domainsTFReflectivityCalculation/domainsCustomXYInputs.mat differ diff --git a/tests/domainsTFReflectivityCalculation/domainsCustomXYOutputs.mat b/tests/domainsTFReflectivityCalculation/domainsCustomXYOutputs.mat index 6b330ffa9..2df1f9ff8 100644 Binary files a/tests/domainsTFReflectivityCalculation/domainsCustomXYOutputs.mat and b/tests/domainsTFReflectivityCalculation/domainsCustomXYOutputs.mat differ diff --git a/tests/domainsTFReflectivityCalculation/domainsCustomXYTFParams.mat b/tests/domainsTFReflectivityCalculation/domainsCustomXYTFParams.mat index df039e85f..e8d6752a8 100644 Binary files a/tests/domainsTFReflectivityCalculation/domainsCustomXYTFParams.mat and b/tests/domainsTFReflectivityCalculation/domainsCustomXYTFParams.mat differ diff --git a/tests/domainsTFReflectivityCalculation/domainsStandardLayersInputs.mat b/tests/domainsTFReflectivityCalculation/domainsStandardLayersInputs.mat index f2184ba80..7570f4d78 100644 Binary files a/tests/domainsTFReflectivityCalculation/domainsStandardLayersInputs.mat and b/tests/domainsTFReflectivityCalculation/domainsStandardLayersInputs.mat differ diff --git a/tests/domainsTFReflectivityCalculation/domainsStandardLayersOutputs.mat b/tests/domainsTFReflectivityCalculation/domainsStandardLayersOutputs.mat index f70578737..36daa9a8e 100644 Binary files a/tests/domainsTFReflectivityCalculation/domainsStandardLayersOutputs.mat and b/tests/domainsTFReflectivityCalculation/domainsStandardLayersOutputs.mat differ diff --git a/tests/domainsTFReflectivityCalculation/domainsStandardLayersTFParams.mat b/tests/domainsTFReflectivityCalculation/domainsStandardLayersTFParams.mat index 42ad6f07b..fe593b0d0 100644 Binary files a/tests/domainsTFReflectivityCalculation/domainsStandardLayersTFParams.mat and b/tests/domainsTFReflectivityCalculation/domainsStandardLayersTFParams.mat differ diff --git a/tests/normalTFReflectivityCalculation/absorptionInputs.mat b/tests/normalTFReflectivityCalculation/absorptionInputs.mat index 30a2f73e4..8a00db80f 100644 Binary files a/tests/normalTFReflectivityCalculation/absorptionInputs.mat and b/tests/normalTFReflectivityCalculation/absorptionInputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/absorptionOutputs.mat b/tests/normalTFReflectivityCalculation/absorptionOutputs.mat index 839b4a6d4..bddf587d2 100644 Binary files a/tests/normalTFReflectivityCalculation/absorptionOutputs.mat and b/tests/normalTFReflectivityCalculation/absorptionOutputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/absorptionTFParams.mat b/tests/normalTFReflectivityCalculation/absorptionTFParams.mat index af87c5744..e9d8de617 100644 Binary files a/tests/normalTFReflectivityCalculation/absorptionTFParams.mat and b/tests/normalTFReflectivityCalculation/absorptionTFParams.mat differ diff --git a/tests/normalTFReflectivityCalculation/customLayersInputs.mat b/tests/normalTFReflectivityCalculation/customLayersInputs.mat index 82c8ed853..2e1c66d22 100644 Binary files a/tests/normalTFReflectivityCalculation/customLayersInputs.mat and b/tests/normalTFReflectivityCalculation/customLayersInputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/customLayersOutputs.mat b/tests/normalTFReflectivityCalculation/customLayersOutputs.mat index 71692fa7c..c453dc97b 100644 Binary files a/tests/normalTFReflectivityCalculation/customLayersOutputs.mat and b/tests/normalTFReflectivityCalculation/customLayersOutputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/customLayersTFParams.mat b/tests/normalTFReflectivityCalculation/customLayersTFParams.mat index 1298ae563..a72e03167 100644 Binary files a/tests/normalTFReflectivityCalculation/customLayersTFParams.mat and b/tests/normalTFReflectivityCalculation/customLayersTFParams.mat differ diff --git a/tests/normalTFReflectivityCalculation/customXYInputs.mat b/tests/normalTFReflectivityCalculation/customXYInputs.mat index d26116d8d..51c1f451f 100644 Binary files a/tests/normalTFReflectivityCalculation/customXYInputs.mat and b/tests/normalTFReflectivityCalculation/customXYInputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/customXYOutputs.mat b/tests/normalTFReflectivityCalculation/customXYOutputs.mat index 25c583f0f..5d77a3551 100644 Binary files a/tests/normalTFReflectivityCalculation/customXYOutputs.mat and b/tests/normalTFReflectivityCalculation/customXYOutputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/customXYTFParams.mat b/tests/normalTFReflectivityCalculation/customXYTFParams.mat index e920f8df9..cd048abec 100644 Binary files a/tests/normalTFReflectivityCalculation/customXYTFParams.mat and b/tests/normalTFReflectivityCalculation/customXYTFParams.mat differ diff --git a/tests/normalTFReflectivityCalculation/standardLayersInputs.mat b/tests/normalTFReflectivityCalculation/standardLayersInputs.mat index 881c9b39f..e2a20f695 100644 Binary files a/tests/normalTFReflectivityCalculation/standardLayersInputs.mat and b/tests/normalTFReflectivityCalculation/standardLayersInputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/standardLayersOutputs.mat b/tests/normalTFReflectivityCalculation/standardLayersOutputs.mat index 13a5698d1..656a8f60d 100644 Binary files a/tests/normalTFReflectivityCalculation/standardLayersOutputs.mat and b/tests/normalTFReflectivityCalculation/standardLayersOutputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/standardLayersTFParams.mat b/tests/normalTFReflectivityCalculation/standardLayersTFParams.mat index 235aec75a..af763905e 100644 Binary files a/tests/normalTFReflectivityCalculation/standardLayersTFParams.mat and b/tests/normalTFReflectivityCalculation/standardLayersTFParams.mat differ diff --git a/tests/testCommonFunctions/shiftDataInputs.mat b/tests/testCommonFunctions/shiftDataInputs.mat index 7c26888f5..599d9352f 100644 Binary files a/tests/testCommonFunctions/shiftDataInputs.mat and b/tests/testCommonFunctions/shiftDataInputs.mat differ diff --git a/tests/testControlsClass.m b/tests/testControlsClass.m index 4de820da9..289b2557e 100644 --- a/tests/testControlsClass.m +++ b/tests/testControlsClass.m @@ -58,7 +58,20 @@ function testDisplay(testCase) testCase.controls.display = 'any'; end end - + + function testNumSimulationPoints(testCase) + % test if set.numSimulationPoints is working + testCase.controls.numSimulationPoints = 10; + testCase.verifyEqual(testCase.controls.numSimulationPoints, 10, 'set.numSimulationPoints method is not working') + % bad option + testCase.verifyError(@() setNumSimulationPoints('ab'), exceptions.invalidType.errorID); + testCase.verifyError(@() setNumSimulationPoints(0.5), exceptions.invalidValue.errorID); + testCase.verifyError(@() setNumSimulationPoints(1), exceptions.invalidValue.errorID); + function setNumSimulationPoints(value) + testCase.controls.numSimulationPoints = value; + end + end + function testResampleMinAngle(testCase) % Test if set.resampleMinAngle method is working testCase.controls.resampleMinAngle = 0.8; @@ -407,6 +420,7 @@ function testSetProcedureWithDream(testCase) testCase.verifyEqual(testCase.controls.adaptPCR, true, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Single.value, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.calcSldDuringFit, false, 'setProcedure method is not working'); + testCase.verifyEqual(testCase.controls.numSimulationPoints, 500, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.9, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 50, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.display, displayOptions.Iter.value, 'setProcedure method is not working'); @@ -421,6 +435,7 @@ function testSetProcedureWithDream(testCase) 'adaptPCR', true,... 'parallel', parallelOptions.Contrasts.value,... 'calcSldDuringFit', true,... + 'numSimulationPoints', 1000,... 'resampleMinAngle', 0.1,... 'resampleNPoints', 10,... 'display', displayOptions.Notify.value); @@ -433,6 +448,7 @@ function testSetProcedureWithDream(testCase) testCase.verifyTrue(testCase.controls.adaptPCR, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Contrasts.value, 'setProcedure method is not working'); testCase.verifyTrue(testCase.controls.calcSldDuringFit, 'setProcedure method is not working'); + testCase.verifyEqual(testCase.controls.numSimulationPoints, 1000, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.1, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 10, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.display, displayOptions.Notify.value, 'setProcedure method is not working'); @@ -457,6 +473,7 @@ function testSetProcedureWithNS(testCase) testCase.verifyEqual(testCase.controls.nsTolerance, 0.1, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Single.value, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.calcSldDuringFit, false, 'setProcedure method is not working'); + testCase.verifyEqual(testCase.controls.numSimulationPoints, 500, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.9, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 50, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.display, displayOptions.Iter.value, 'setProcedure method is not working'); @@ -469,6 +486,7 @@ function testSetProcedureWithNS(testCase) 'nsTolerance', 0.5,... 'parallel', parallelOptions.Contrasts.value,... 'calcSldDuringFit', true,... + 'numSimulationPoints', 1000,... 'resampleMinAngle', 0.1,... 'resampleNPoints', 10,... 'display', displayOptions.Notify.value); @@ -479,6 +497,7 @@ function testSetProcedureWithNS(testCase) testCase.verifyEqual(testCase.controls.nsTolerance, 0.5, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Contrasts.value, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.calcSldDuringFit, true, 'setProcedure method is not working'); + testCase.verifyEqual(testCase.controls.numSimulationPoints, 1000, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.1, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 10, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.display, displayOptions.Notify.value, 'setProcedure method is not working'); @@ -502,6 +521,7 @@ function testSetProcedureWithDE(testCase) testCase.verifyEqual(testCase.controls.numGenerations, 500, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Single.value, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.calcSldDuringFit, false, 'setProcedure method is not working'); + testCase.verifyEqual(testCase.controls.numSimulationPoints, 500, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.9, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 50, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.display, displayOptions.Iter.value, 'setProcedure method is not working'); @@ -518,6 +538,7 @@ function testSetProcedureWithDE(testCase) 'numGenerations', 3,... 'parallel', parallelOptions.Contrasts.value,... 'calcSldDuringFit', true,... + 'numSimulationPoints', 1000,... 'resampleMinAngle', 0.1,... 'resampleNPoints', 10,... 'display', displayOptions.Notify.value,... @@ -532,6 +553,7 @@ function testSetProcedureWithDE(testCase) testCase.verifyEqual(testCase.controls.numGenerations, 3, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Contrasts.value, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.calcSldDuringFit, true, 'setProcedure method is not working'); + testCase.verifyEqual(testCase.controls.numSimulationPoints, 1000, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.1, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 10, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.display, displayOptions.Notify.value, 'setProcedure method is not working'); @@ -557,6 +579,7 @@ function testSetProcedureWithSimplex(testCase) testCase.verifyEqual(testCase.controls.updatePlotFreq, 20, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Single.value, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.calcSldDuringFit, false, 'setProcedure method is not working'); + testCase.verifyEqual(testCase.controls.numSimulationPoints, 500, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.9, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 50, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.display, displayOptions.Iter.value, 'setProcedure method is not working'); @@ -571,6 +594,7 @@ function testSetProcedureWithSimplex(testCase) 'updatePlotFreq', 4, ... 'parallel', parallelOptions.Contrasts.value,... 'calcSldDuringFit', true,... + 'numSimulationPoints', 1000,... 'resampleMinAngle', 0.1,... 'resampleNPoints', 10,... 'display', displayOptions.Notify.value); @@ -583,6 +607,7 @@ function testSetProcedureWithSimplex(testCase) testCase.verifyEqual(testCase.controls.updatePlotFreq, 4, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Contrasts.value, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.calcSldDuringFit, true, 'setProcedure method is not working'); + testCase.verifyEqual(testCase.controls.numSimulationPoints, 1000, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.1, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 10, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.display, displayOptions.Notify.value, 'setProcedure method is not working'); @@ -600,6 +625,7 @@ function testSetProcedureWithCalculate(testCase) testCase.verifyEqual(testCase.controls.procedure, procedures.Calculate.value, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Single.value, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.calcSldDuringFit, false, 'setProcedure method is not working'); + testCase.verifyEqual(testCase.controls.numSimulationPoints, 500, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.9, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 50, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.display, displayOptions.Iter.value, 'setProcedure method is not working'); @@ -608,12 +634,14 @@ function testSetProcedureWithCalculate(testCase) testCase.controls = testCase.controls.setProcedure(procedures.Calculate.value,... 'parallel', parallelOptions.Contrasts.value,... 'calcSldDuringFit', true,... + 'numSimulationPoints', 1000,... 'resampleMinAngle', 0.1,... 'resampleNPoints', 10,... 'display', displayOptions.Notify.value); testCase.verifyEqual(testCase.controls.procedure, procedures.Calculate.value, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Contrasts.value, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.calcSldDuringFit, true, 'setProcedure method is not working'); + testCase.verifyEqual(testCase.controls.numSimulationPoints, 1000, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.1, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 10, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.display, displayOptions.Notify.value, 'setProcedure method is not working'); diff --git a/tests/testProjectConversion/DSPCBilayerProjectClass.mat b/tests/testProjectConversion/DSPCBilayerProjectClass.mat index 3cded951a..a31bce1dd 100644 Binary files a/tests/testProjectConversion/DSPCBilayerProjectClass.mat and b/tests/testProjectConversion/DSPCBilayerProjectClass.mat differ diff --git a/tests/testProjectConversion/monolayerVolumeModelProjectClass.mat b/tests/testProjectConversion/monolayerVolumeModelProjectClass.mat index 84f9dfa8c..5e75451ef 100644 Binary files a/tests/testProjectConversion/monolayerVolumeModelProjectClass.mat and b/tests/testProjectConversion/monolayerVolumeModelProjectClass.mat differ