You are viewing the documentation for an older COMSOL version. The latest version is
available here.
At the MATLAB® prompt, the function
mphinterp evaluates the result at arbitrary points. To evaluate an expression at specific point coordinates, call the function
mphinterp as in the command:
where e1,... are the COMSOL Multiphysics
expressions to evaluate,
<coord> the evaluation point coordinates defined with a NxM double array,
N the space dimension of the evaluation domain, and
M is the number of evaluation points. The output
d1,... is a
Px
M double array, where
P is the length of the inner solution. If an evaluation point is outside the expressions definition domain the output value is NaN.
where <dsettag> is a selection dataset tag defined in the model, for example, Cut point, Cut Plane, Revolve, and so forth.
<dsettag> can also be a mesh dataset tag, in this case the evaluation is performed on the geometric mesh vertices.
The function mphinterp supports the following properties to set the data of the evaluation to perform:
|
•
|
dataset, specify the solution dataset to use in the evaluation:
|
<dsettag> is the tag of a solution dataset or a mesh dataset. The default value is the current solution dataset of the model. When a mesh dataset is specified the expression
<expr> can only be geometry or mesh expression.
|
•
|
selection, specify the domain selection for evaluation:
|
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.
|
•
|
edim, specify the element dimension for evaluation:
|
where edim is one of the strings
'point',
'edge',
'boundary' or
'domain'. One can also use numerical values instead, which in 3D are the values from 0 to 3. The default settings correspond to the model geometry space dimension. When using a lower space dimension value, make sure that the evaluation point coordinates dimension has the same size.
|
•
|
ext, specify extrapolation control value to define how much outside the mesh the interpolation searches. This ensures you return data for points that are outside the geometry:
|
where <ext> is a double value corresponding to the search distance as a scale in terms of the local element size. The default value is 0.1.
|
•
|
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:
|
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 solution respectively. By default the evaluation is performed on all inner solution.
|
•
|
outersolnum, specify the outer solution number for data evaluation. Outer solutions are generated with parametric sweeps:
|
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.
where <time> is a double array. The default value corresponds to all the stored time steps.
|
•
|
phase, specify the phase in degrees:
|
where <phase> is a double value.
The function mphinterp returns in the MATLAB workspace a double array. It also supports other output formats.
with unit is a 1xN cell array where N is the number of expressions to evaluate.
the output data for evaluation points will only contains NaN.
where method can be one of the following value:
|
•
|
'harmonic', for harmonic perturbation analysis.
|
|
•
|
'linpoint', the expression is evaluated by taking the values of any dependent variables from the linearization point of the solution.
|
|
•
|
'lintotal', the expression is evaluated by adding the linearization point and the harmonic perturbation and taking the real part of this sum.
|
|
•
|
'lintotalavg', this is the same as evaluating using the lintotal property and then averaging over all phases of the harmonic perturbation.
|
|
•
|
'lintotalrms', this is the same as evaluating using the lintotal property and then taking the RMS over all phases of the harmonic perturbation.
|
|
•
|
'lintotalpeak', this is the same as evaluating using the lintotal property solution and then taking the maximum over all phases of the harmonic perturbation.
|
If the property evalmethod is set to
harmonic, you specify whether the expression should be linearized or not with the property
differential as shown below:
The default property value settings ('on') evaluates the differential of the expression with respect to the perturbation at the linearization point. If
diffvalue is
off, it evaluates the expression by taking the values of any dependent variables from the harmonic perturbation part of the solution.
With the property
recover, you can specify the accurate derivative recovery:
where recover is either
'ppr',
'pprint', or
'off' (the default). Set the property to
ppr to perform recovery inside domains or set to
pprint to apply recovery to all domain boundaries. Because the accurate derivative processing takes time, the property is disabled by default.
Set the unit property to specify the unit of the evaluation:
where unit is a cell array with the same size as
expr.
Use the property matherr to return an error for undefined operations or expressions: