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.

How to obtain a variable(x,y,t) with Matlab

Please login with a confirmed email address before reporting spam

For a variable, say pressure p, is a function of x,y,t.

In Matlab, we usually have p(x,y) for pressure at any point we want to know.

However, in Comsol linked with Matlab, how can I obtain pressure at any time and anywhere?

Thanks for any help.

3 Replies Last Post 2016年3月21日 GMT-4 18:38

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2016年3月21日 GMT-4 13:34
I'm not sure when time is included. However, in the the frequency domain with only the spatical coordinates (x,y,z), you may try:

var = mphinterp(model, ' abs(p)' , 'coord' , Position_Matrix);

where you should replace 'abs(p)' with cetain variable that you want to measure, and set Position_Matrix as the points where you want to take values.

You may check the API documentations for functions how to extract values in any case. Most may start with mph*().
I'm not sure when time is included. However, in the the frequency domain with only the spatical coordinates (x,y,z), you may try: var = mphinterp(model, ' abs(p)' , 'coord' , Position_Matrix); where you should replace 'abs(p)' with cetain variable that you want to measure, and set Position_Matrix as the points where you want to take values. You may check the API documentations for functions how to extract values in any case. Most may start with mph*().

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2016年3月21日 GMT-4 16:53
Really appreciate your replying. I searched for mphinterp in API document, but I failed to find it. I am afraid it due to different versions. I am using Comsol 4.2 now.

Can you give me a little more descriptions of this term or key words? Thanks.
Really appreciate your replying. I searched for mphinterp in API document, but I failed to find it. I am afraid it due to different versions. I am using Comsol 4.2 now. Can you give me a little more descriptions of this term or key words? Thanks.

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2016年3月21日 GMT-4 18:38
You should be able to find the matlab livelink pdf help document in your comsol installation directory. Usually it is in <comsol path>/doc/pdf. You may check that.

Otherwise, you may google something like "matlab livelink comsol", there will also be documents available up in the first few results.
You should be able to find the matlab livelink pdf help document in your comsol installation directory. Usually it is in /doc/pdf. You may check that. Otherwise, you may google something like "matlab livelink comsol", there will also be documents available up in the first few results.

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.