Evaluating Expressions
If you want to evaluate the parameters, variables, or expressions in the model, use the function
mphgetexpressions
.
1
Evaluate the expressions of the parameters defined in the model:
expr = mphgetexpressions(model.param)
expr =
{'L' } {'9[cm]' } {'Length' } {[0.0900]} {'m' }
{'rad_1'} {'6[mm]' } {'Bolt radius' } {[0.0060]} {'m' }
{'tbb' } {'5[mm]' } {'Thickness' } {[0.0050]} {'m' }
{'wbb' } {'5[cm]' } {'Width' } {[0.0500]} {'m' }
{'mh' } {'6[mm]' } {'Maximum eleme…'} {[0.0060]} {'m' }
{'htc' } {'5[W/m^2/K]'} {'Heat transfer…'} {[ 5]} {'W/(m^2*K)'}
{'Vtot' } {'20[mV]' } {'Applied volta…'} {[0.0200]} {'V' }
2
You can evaluate a specific parameter expression by using the function
mphevaluate
. To evaluate the length of the busbar,
L
, in inches:
L = mphevaluate(model,'L','in')
L =
3.5433
Note:
The evaluation does not require an existing solution dataset in the model.
Code for Use with MATLAB
®
mphopen busbar
% Evaluating Data at Arbitrary Points
Qtot = mphinterp(model,'ht.Qtot','coord',[5e-2;-2e-2;1e-3])
[Temp, unit]= mphinterp(model,'T','coord',[5e-2;-2e-2;1e-3],'unit','degF')
x0=0:5e-2/4:5e-2;
y0=0:-2.5e-2/4:-2.5e-2;
z0=[0 5e-3];
[x,y,z]=meshgrid(x0,y0,z0);
xx=[x(:),y(:),z(:)]';
Qtot = mphinterp(model,'ht.Qtot','coord',xx);
Qtot = reshape(Qtot,length(x0),length(y0),length(z0))
% Evaluating Data at Node Points
data = mpheval(model,'V')
data2 = mpheval(model,{'T' 'V'})
data3 = mpheval(model,'T','refine',2)
hold on;
plot3(data3.p(1,:),data3.p(2,:),data3.p(3,:),'.');
plot3(data2.p(1,:),data2.p(2,:),data2.p(3,:),'.r');
mphmesh(model)
data4 = mpheval(model,{'ec.normJ'},...
'edim',2,'selection',43)
% Global Evaluation and Integration
Vtot = mphglobal(model,'Vtot')
Q = mphint2(model,'ec.Qh','volume','selection',1)
[I unit] = mphint2(model,'ec.normJ','surface','selection',43)
maxT = mphmax(model,'T','volume','selection',1)
maxT = mphmax(model,'T','surface','selection',43)