Evaluating an Integral
Evaluate an integral of expression with the function mphint2.
To evaluate the integral of the expression over the domain with the highest space domain dimension call the function mphint2 as in this command:
[d1,...] = mphint2(model,{'e1',...},edim)
where e1,... are the expressions to integrate. The values d1,... are returned as a 1xP double array, with P the length of inner parameters. edim is the integration dimension, which can be 'line', 'surface', 'volume', or an integer value that specifies the space dimension (1, 2, or 3).
The rest of this section has additional information for the function mphint2:
Specify the Integration Data
The function mphint2 supports the following properties to set the data of the evaluation to perform:
dataset, specify the solution dataset to use in the integration:
data = mphint2(model,<expr>,edim,'dataset',<dsettag>)
<dsettag> is the tag of a solution dataset. The default value is the current solution dataset of the model.
selection, specify the integration domain:
data = mphint2(model,<expr>,edim,'selection',<seltag>)
where <seltag> is the tag of a selection node to use for the data evaluation. <seltag> can also be a positive integer array that corresponds to the domain index list. The default selection is all domains where the expression is defined. If the evaluation point does not belong to the specified domain selection the output value is NaN.
solnum, specify the inner solution number for data evaluation. Inner solutions are generated for the following analysis types: time domain, frequency domain, eigenvalue, or stationary with continuation parameters:
data = mphint2(model,<expr>,edim,'solnum',<solnum>)
where <solnum> is an integer array corresponding to the inner solution index. <solnum> can also be a string:'end' or 'all' to evaluate the expression for the last inner solution, or all inner solutions, respectively. By default the evaluation is performed on all inner solutions.
outersolnum, specify the outer solution number for data evaluation. Outer solutions are generated with parametric sweeps:
data = mphint2(model,<expr>,edim,'outersolnum',<outersolnum>)
where <outersolnum> is a positive integer corresponding to the outer solution index. <outersolnum> can also be a string, 'all' or 'end', to evaluate the expression for all or the last outer solution respectively. The default settings use the first outer solution for the data evaluation.
data = mphint2(model,<expr>,edim,'t',<time>)
where <time> is a double array. The default value corresponds to all the stored time steps.
data = mphint2(model,<expr>,edim,'dataseries',<dataoperation>)
where <dataoperation> can be one of the following value: 'none' (no operation performed), 'average' (to compute average of the selected series), 'integral' (to integrate over series), 'maximum' (to evaluate the maximum over series), 'minimum' (to evaluate the minimum), 'rms' (to compute the root mean square), 'stddev' (to compute the standard deviation), or 'variance' (to compute the variance).
Output Format
The function mphint2 also supports other output formats.
To extract the unit of the evaluated expression, define an extra output variable:
[data,unit] = mphint2(model,<expr>,edim)
with unit is a 1xN cell array where N is the number of expressions to evaluate.
By default mphint2 returns the results as a squeezed singleton. To get the full singleton, set the squeeze property to off:
data = mphint2(model,<expr>,edim,'squeeze','off')
Set the property matrix to off to return the data as a cell array instead of a double array:
data = mphint2(model,<expr>,edim,'matrix','off')
Specify the Integration Settings
To specify integration settings such as the integration method, integration order, or axisymmetry assumption using these properties:
method, specify the integration method, which can be either integration or summation:
data = mphint2(model,<expr>,edim,'method',method)
where method can be 'integration' or 'summation'. The default uses the appropriate method for the given expression.
intorder, specify the integration order:
data = mphint2(model,<expr>,edim,'intorder',<order>)
where order is a positive integer. The default value is 4.
intsurface or intvolume, compute surface or volume integral for axisymmetric models:
data = mphint2(model,<expr>,edim,'intsurface','on')
data = mphint2(model,<expr>,edim,'intvolume','on')