mphglobal
Evaluate global quantities.
Syntax
[d1,...,dn] = mphglobal(model,{e1,...,en},...)
[d1,...,dn,unit] = mphglobal(model,{e1,...,en},...)
Description
[d1,...,dn] = mphglobal(model,{e1,...,en},...) returns the results from evaluating the global quantities specified in the string expression e1,..., en.
[d1,...,dn,unit] = mphglobal(model,{e1,...,en},...) also returns the unit of the expressions e1,..., en. unit is a nx1 cell array.
The function mphglobal accepts the following property/value pairs:
off | on
off | on
off | on
The property Dataset controls which dataset is used for the evaluation. Datasets contain or refer to the source of data for postprocessing purposes. Evaluation is supported only on solution datasets.
When the property Phase is used, the solution vector is multiplied with exp(i*phase) before evaluating the expression.
The expressions ei are evaluated for one or several solutions. Each solution generates an additional row in the output data array di. The properties solnum and t control which solutions are used for the evaluations. The solnum property is available when the dataset has multiple solutions — for example, in the case of parametric, eigenfrequency, or time-dependent solutions. The t property is available only for time-dependent problems. If solnum is provided, the solutions indicated by the indices provided with the solnum property are used. If t is provided, solutions are interpolated. If neither solnum nor t is provided, all solutions are evaluated.
For time-dependent problems, the variable t can be used in the expressions ei. The value of t is the interpolation time when the property t is provided, and the time for the solution, when solnum is used. Similarly, lambda and the parameter are available as eigenvalues for eigenvalue problems and as parameter values for parametric problems, respectively.
In case of multiple expression if the unit property is defined with a string, the same unit is used for both expressions. To use different units, set the property with a cell array. In case of inconsistent unit definition, the default unit is used instead.
Solnum is used to select the solution number when a parametric, eigenvalue, or time-dependent solver has been used.
Outersolnum is used to select the outer solution number when a parametric sweep has been used in the study step node.
Example
Evaluate the maximum temperature in the model
model = mphopen('model_tutorial_llmatlab');
model.cpl.create('maxop','Maximum','geom1').selection.all;
std = model.study.create('std');
std.feature.create('stat','Stationary');
std.run;
maxT = mphglobal(model,'maxop(T)')
Evaluate the maximum temperature in the model in degrees Celsius
maxT = mphglobal(model,'maxop(T)','unit','degC')
Evaluate a global expression at every time step computed with power set to 30:
model = mphopen('model_tutorial_llmatlab');
model.cpl.create('maxop', 'Maximum', 'geom1').selection.all;
std = model.study.create('std');
param = std.feature.create('param','Parametric');
time = std.feature.create('time','Transient');
time.set('tlist', 'range(0,1,25)');
param.setIndex('pname','power',0);
param.setIndex('plistarr','30 60 90',0);
std.run;
maxT = mphglobal(model,'maxop(T)','dataset','dset2');
Evaluate maxop(T) for the first and fifth time step:
maxT = mphglobal(model,'maxop(T)',dataset','dset2',...
'solnum',[1,5]);
Evaluate maxop(T) at 20.512 sec:
maxT = mphglobal(model,'maxop(T)',dataset','dset2',...
't',20.512);
Evaluate maxop(T) at every time step computed with power set to 90:
maxT = mphglobal(model,'maxop(T)','dataset','dset2',...
'outersolnum',3);
See also
mpheval, mphevalglobalmatrix, mphevalpoint, mphevalpointmatrix, mphint2, mphinterp