Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Error while using mphinterp function

Please login with a confirmed email address before reporting spam

Dear All,

please help me regarding mphinterp function.....

while using,

coordinate=[29970,10080]'
'' electric_field=mphinterp(model,'(es.Ey*es.ny)','coord',coordinate)''
in comsol 5.0 with matlab, i am always encountered with the error message

Error using mphinterp
mphinterp : Java exception occurred:
Exception:
com.comsol.util.exceptions.FlException: Failed to evaluate
expression
(rethrown as com.comsol.util.exceptions.FlException)
(rethrown as com.comsol.util.exceptions.FlException)
Messages:
Failed to evaluate expression

Failed to evaluate expression

Cannot evaluate expression.

Undefined variable.
- Variable: comp1.es.ny
- Geometry: geom1
- Domain: 2

Failed to evaluate expression.
- Expression: real((comp1.es.Ey*comp1.es.ny))

Failed to evaluate expression.
- Expression: real(comp1.es.Ey*comp1.es.ny)

Error in Plea_Linepractice60micW_1micro_final29_2dModel (line
239)
electric_field=mphinterp(model,'(es.Ey*es.ny)','coord',coordinate)

3 Replies Last Post 2017年1月23日 GMT-5 08:19
Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2017年1月20日 GMT-5 09:13
Hi

es.ny is only defined exactly on a boundary.

I suggest you try something like this:
[x,y,d]=mphinterp(model,{'x' 'y' 'es.Ey*es.ny'},'edim','boundary','selection',3,'coord',0:0.1:1);
and use the 'selection' property to select the boundary you are trying to extract data for.


--
Lars Gregersen
Comsol Denmark
Hi es.ny is only defined exactly on a boundary. I suggest you try something like this: [x,y,d]=mphinterp(model,{'x' 'y' 'es.Ey*es.ny'},'edim','boundary','selection',3,'coord',0:0.1:1); and use the 'selection' property to select the boundary you are trying to extract data for. -- Lars Gregersen Comsol Denmark

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2017年1月20日 GMT-5 10:33
Hello Lars,

Thank you for responding so fast. Your valuable suggestion worked for me.


----------
Asha Sharma
Hello Lars, Thank you for responding so fast. Your valuable suggestion worked for me. ---------- Asha Sharma

Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2017年1月23日 GMT-5 08:19
Hi Asha

You're welcome!

You can also do:
electric_field = mphinterp(model, 'es.Ey*es.ny', 'edim', 'boundary', 'coord', coordinate)


--
Lars Gregersen
Comsol Denmark
Hi Asha You're welcome! You can also do: electric_field = mphinterp(model, 'es.Ey*es.ny', 'edim', 'boundary', 'coord', coordinate) -- Lars Gregersen Comsol Denmark

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.