


This is a documentation m-file for the PBE solver
Content:
<a href="matlab: help solvePbe">Calling the PBE solver</a>
> <a href="matlab: help helpPbeSolver>optionValuePairs">List of option/value pairs</a>
<a href="matlab: help helpPbeSolver>variables">Nomenclature for input/output structures</a>
<a href="matlab: help helpPbeSolver>inputStruct">Input structure: pbeDefinition</a>
> <a href="matlab: help helpPbeSolver>seedingStruct">Structure for a seeding event.</a>
<a href="matlab: help helpPbeSolver>outputStruct">Output structure array: result</a>


0001 function helpPbeSolver 0002 % This is a documentation m-file for the PBE solver 0003 % 0004 % Content: 0005 % <a href="matlab: help solvePbe">Calling the PBE solver</a> 0006 % > <a href="matlab: help helpPbeSolver>optionValuePairs">List of option/value pairs</a> 0007 % <a href="matlab: help helpPbeSolver>variables">Nomenclature for input/output structures</a> 0008 % <a href="matlab: help helpPbeSolver>inputStruct">Input structure: pbeDefinition</a> 0009 % > <a href="matlab: help helpPbeSolver>seedingStruct">Structure for a seeding event.</a> 0010 % <a href="matlab: help helpPbeSolver>outputStruct">Output structure array: result</a> 0011 clc 0012 help helpPbeSolver 0013 disp('') 0014 disp(' ---------------------------') 0015 end 0016 0017 function variables 0018 % The description of the input and output structures use the following 0019 % nomenclature: 0020 % H - matrix with facet distances (column=crystal, row=dimension) 0021 % h - single column of H 0022 % P - matrix of (user) crystal properties (column=crystal, row=property) 0023 % p - single row of P 0024 % N - vector of particle number assigned to pivot 0025 % x - vector of bulk states 0026 % y - vector of bulk properties 0027 % up - the vector of the unified partition for each pivot 0028 % 0029 % Back to <a href="matlab: helpPbeSolver">Content</a> 0030 % --------------------------- 0031 end 0032 0033 0034 function inputStruct 0035 % The input structure pbeDefinition consists of the fields: 0036 % .timeSpan - time interval for simulation 0037 % .dec - decomposition data including relevant measure information 0038 % 0039 % .seeding - a structure array that is also used for the initial 0040 % condition (support for multiple seeding is currently cancelled). 0041 % The fields are documented <a href="matlab: help helpPbeSolver>seedingStruct">here</a>. 0042 % .growthRate - handle @(H, P, y, t) that is the time derivative of the 0043 % facet distances h. Disappearing facets (the validity of h) are 0044 % treated internally. 0045 % .pivotProperty - handle @(H, up) that is a (geometric) property of 0046 % the crystal represented by h (e.g. volume, surface area). 0047 % Alternatively, this is a list (cell array {}) of measure 0048 % definitions used as input to computeMeasureDec. 0049 % 0050 % .bulkInitial - state vector with the initial condition 0051 % .bulkRate - handle @(y, t) that is the time derivative of the bulk 0052 % state vector x 0053 % .bulkProperty - handle @(P, N, x, t) that is the vector of bulk properties 0054 % (e.g. total particle volume, supersaturation) 0055 % 0056 % .nucleationSize - vector of facet distances of the nuclei 0057 % .nucleationRate - handle @(y, t) that gives the nucleation rate 0058 % 0059 % .option - a structure with additional solver parameters. The fieldnames 0060 % are the option names used in <a href="matlab: help solvePbe">solvePbe</a>. The options in this 0061 % structure are overwritten when the same options are provided during 0062 % a call of solvePbe. 0063 % 0064 % .nDecCoordinates - the number of coordinates in the positionMatrix that 0065 % must match .dec.nC; default value dec.nC 0066 % .nExtraCoordinates - shape coordinates that are contained in the last n 0067 % rows of H; default value 0 0068 % 0069 % Back to <a href="matlab: helpPbeSolver">Content</a> 0070 % --------------------------- 0071 end 0072 0073 function seedingStruct 0074 % The fields for the definition of a seeding event are: 0075 % .time - time of seed injection (discrete time event). 0076 % .positionMatrix - discrete particle population 0077 % .numberVector - contains the number of particles that are represented 0078 % by the corresponding position. If the distribution is generated by 0079 % distribution densities, the particle number equals the density 0080 % value divided by the probability value. 0081 % .probabilityVector - the probability density value for choosing the 0082 % corresponding position. 0083 % 0084 % Back to <a href="matlab: helpPbeSolver">Content</a> 0085 % Back to <a href="matlab: help helpPbeSolver>inputStruct">input structure: pbeDefinition</a> 0086 % --------------------------- 0087 end 0088 0089 function outputStruct 0090 % The output structure array result(:) consists of the fields: 0091 % .time - timestamp 0092 % .evaltime - seconds passed until a result step is entered 0093 % .flagDensity - is 1, if distribution densities are used and 0 0094 % otherwise 0095 % .flagNucleation - is 1, if the first element(s) of hCmatrix represent 0096 % the nucleation bin. 0097 % 0098 % .bulkStateVector - vector of bulk states 0099 % .hcMatrixDynamic - matrix of pivots that represent the population 0100 % (unaltered state variables) 0101 % .hcMatrix - matrix of pivots that represent the population (these are 0102 % valid and might be formulated in the proper emebedding, dependend on 0103 % the useEmbeddingPartitions option) 0104 % .numberVector - vector with the particle numbers assigned to the pivots 0105 % .upVector - vector of unified partitions for hC-vectors, they are 0106 % generated as intitial guess and might be wrong. 0107 % .probabilityVector - the probability density of the pivot point (only 0108 % available if calculated with densities) 0109 % .indexVector - contains integer values for the origin of the hC-vector 0110 % (positive integers as index to a seeding population; -1 for pivots 0111 % of the nucleation process; -2 for the active nucleation pivot) 0112 % .dissolvedPivotVector - a vector that contains the total number of 0113 % removed pivots for each seeding population. 0114 % 0115 % .pivotPropertyMatrix - pivot properties re-calculated for each timestep 0116 % .bulkPropertyVector - bulk properties re-cacluated for each timestep 0117 % 0118 % Back to <a href="matlab: helpPbeSolver">Content</a> 0119 % --------------------------- 0120 end 0121 0122 function optionValuePairs 0123 % The call solvePbe(.., 'option', value) supports a list of option/value 0124 % pairs that are described in the following including their standard 0125 % values. The standard values can be overwritten by the fields of 0126 % pbeDefinition.option. But the settings from pbeDefinition.option are 0127 % overwritten by the options given by a function call. The option/value 0128 % pairs are: 0129 % verbose - verbosity level {2} 0130 % 0131 % odeSolver: a function handle for the ode solver that shall be applied 0132 % {@ode45} 0133 % initialTimeStep: the size of the initial time step to be used by the 0134 % ode solver {1} 0135 % distanceLimit: growth rates are continuously adopted to the limited 0136 % growth rate as soon as they have a distance of this value from 0137 % the validity/confinement cone; particles are also considered 0138 % dissolved when they have a distance of that value from the 0139 % empty-polytope cone {1e-8} 0140 % updateUnifiedLimit: the algorithm stores the unified partition index 0141 % for each hC-vecor and searches for the correct unified parition 0142 % only if the hC-vector has left the stored unified partition. This 0143 % option gives the percentage of hC-vectors that have left the 0144 % unified partition and at which point in time the unified 0145 % partition index is updated for all hC-vectors before time 0146 % integration continues (time discrete event) {0.3} 0147 % useEmbeddingPartitions: if improper representations are used, (1) 0148 % uses the embedding proper representation for the stored hcMatrix 0149 % and the computed unified partitions. For (0), the improper values 0150 % are used. {1} 0151 % 0152 % relTol: relative tolerance for all state variables {1e-5} 0153 % absTolPosition: absolute tolerance for hC-vectors {1e-12} 0154 % absTolBulk: absolute tolerance for the bulk properties {1e-12} 0155 % absTolDensity: absolute tolerance for the distribution density (if 0156 % applied) {1e8} 0157 % absTolNumber: absolute tolerance for the particle number (applies 0158 % for nucleation only since the particle number for seeding 0159 % populations is constant) {1e10} 0160 % binLoad: absolute maximum value for a nucleation bin even though 0161 % nucleation is not yet supported {1e17} 0162 % 0163 % density: flag to consider the dynamical evolution of the probability 0164 % distribution (1) or not (0) {0} 0165 % gradientRelativeDelta: relative delta to be used for hC-vectors to 0166 % estimate the gradient of the growth rate (applies only for 0167 % density=1) {1e-3} 0168 % gradientAbsoluteDelta: absolute delta to be used for hC-vectors to 0169 % estimate the gradient of the growth rate (applies only for 0170 % density=1) {1e-10} 0171 % 0172 % Back to <a href="matlab: helpPbeSolver">Content</a> 0173 % --------------------------- 0174 end