Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Mar 30, 2011, 3:47 a.m. EDT
Hi Dominique,
What I have been TRYING to do in MATLAB:
- Get the temperature values on my edge by using (after exporting my model from COMSOL to the COMSOL server):
[myTemp] = mphinterp(model, ['T'], 'dataset', 'edg1')
That doesn't work, it gives me data for half of my edge and afterwards it's all over the place (see attachment #2) (I guess I would need to sort out my values but why isn't it following the arc length?)
I also tried:
myTemp = mpheval(model, 'T', 'edim', 1, 'selection', 3)
which gives me a structure which contains my temperature data but once again my data are all scrambled up when I try to plot them (see attachment #2)
Any ideas why this is so scrambled up? I just want to calculate the Standard Deviation which shouldn't be that hard!
I'm sorry I don't have a solution, but I have exactly the same problem with my model. I just want the data that COMSOL plots in Matlab to edit it.
Have you solved it yet?
Regards,
Peter.
Hi Dominique,
[QUOTE]
What I have been TRYING to do in MATLAB:
- Get the temperature values on my edge by using (after exporting my model from COMSOL to the COMSOL server):
[myTemp] = mphinterp(model, ['T'], 'dataset', 'edg1')
That doesn't work, it gives me data for half of my edge and afterwards it's all over the place (see attachment #2) (I guess I would need to sort out my values but why isn't it following the arc length?)
I also tried:
myTemp = mpheval(model, 'T', 'edim', 1, 'selection', 3)
which gives me a structure which contains my temperature data but once again my data are all scrambled up when I try to plot them (see attachment #2)
Any ideas why this is so scrambled up? I just want to calculate the Standard Deviation which shouldn't be that hard!
[/QUOTE]
I'm sorry I don't have a solution, but I have exactly the same problem with my model. I just want the data that COMSOL plots in Matlab to edit it.
Have you solved it yet?
Regards,
Peter.
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Mar 30, 2011, 11:19 a.m. EDT
Hi,
I'm also confronting the similar problem, confused with the postprocess.
Anyone can help?
Hi,
I'm also confronting the similar problem, confused with the postprocess.
Anyone can help?
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Mar 30, 2011, 11:26 a.m. EDT
I haven't work on that since, been busy with something else.
I will need to get back on it, so if I find out anything, I'll keep you posted.
Good luck finding your way in MATLAB "LiveLink"....
I haven't work on that since, been busy with something else.
I will need to get back on it, so if I find out anything, I'll keep you posted.
Good luck finding your way in MATLAB "LiveLink"....
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Mar 30, 2011, 2:16 p.m. EDT
Well, the LiveLink itself isn't that hard to get to know. Just don't forget to click "File" > "Reset History" before saving your .mph files as .m file.This makes your code a lot less messy.
Well, the LiveLink itself isn't that hard to get to know. Just don't forget to click "File" > "Reset History" before saving your .mph files as .m file.This makes your code a lot less messy.
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Mar 30, 2011, 2:19 p.m. EDT
Yep, that's a good point (resetting the History).
But right now I'm still stuck at the point where I can modify a file that I converted into a .m file but I am not yet able to reconvert a .m into a .mph file...
Yep, that's a good point (resetting the History).
But right now I'm still stuck at the point where I can modify a file that I converted into a .m file but I am not yet able to reconvert a .m into a .mph file...
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Mar 30, 2011, 2:22 p.m. EDT
After modifying your model in Matlab use (not sure about the exact syntax, no COMSOL on my laptop):
model.save('myModel.mph');
After modifying your model in Matlab use (not sure about the exact syntax, no COMSOL on my laptop):
model.save('myModel.mph');
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Mar 30, 2011, 2:52 p.m. EDT
Yes, that's for saving it back into the COMSOL server.
My problem is:
- If I send a file through the COMSOL server from COMSOL to MATLAB, I don't know how to save that file in MATLAB as a .m file. (model.save does not allow that).
So the only way I found to have a .m file is to directly in COMSOL, save as MATLAB .m file.
Once I do that, I can open the file in MATLAB without problem and edit it BUT I can't sent it back into COMSOL nor the COMSOL server since there is no way to read a .m file into the MPH model class (if there is, I haven't found one).
Yes, that's for saving it back into the COMSOL server.
My problem is:
- If I send a file through the COMSOL server from COMSOL to MATLAB, I don't know how to save that file in MATLAB as a .m file. (model.save does not allow that).
So the only way I found to have a .m file is to directly in COMSOL, save as MATLAB .m file.
Once I do that, I can open the file in MATLAB without problem and edit it BUT I can't sent it back into COMSOL nor the COMSOL server since there is no way to read a .m file into the MPH model class (if there is, I haven't found one).
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Jul 6, 2011, 3:16 p.m. EDT
That is my question too: How to send back the edited .m file to Comsol.
That is my question too: How to send back the edited .m file to Comsol.
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Jul 11, 2011, 8:32 a.m. EDT
see my thread 'convert .m to .mph'!
see my thread 'convert .m to .mph'!
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Oct 4, 2011, 9:59 p.m. EDT
Try this for getting temperature at any point from matlab m file:
Compute the temperature T at the center of the domain:
T = mphinterp(model,'T','coord',[0.3;0.5])
This command "mphinterp" has replaced "postinterp" in Comsol 3.5a. Hope this helps.
Thanks.
Try this for getting temperature at any point from matlab m file:
Compute the temperature T at the center of the domain:
T = mphinterp(model,'T','coord',[0.3;0.5])
This command "mphinterp" has replaced "postinterp" in Comsol 3.5a. Hope this helps.
Thanks.
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Feb 29, 2012, 11:48 a.m. EST
Hi everyone,
I have a similar problem with mphinterp...
I have a 2D model, on wich I have used the Heat Transfer module in a transient study. I want to read and save the temperature evolution in a point I have defined in the center of my domain, but I don't want to call it by its coordinates. That is, I want to "call" that point by its tag.
So lets say this point is number 3. I do the following:
[Temp] = mphinterp(model,'T','Edim',0,'selection',3);
I get this error:
??? Error using ==> mphinterp at 144
Coordinate or non-solution dataset is required
I am using the COMSOL version 4.2a
Have you solved your problem? Do you have any ideas about what I am doing wrong?
Thank you!
Ana Gaspar
Hi everyone,
I have a similar problem with mphinterp...
I have a 2D model, on wich I have used the Heat Transfer module in a transient study. I want to read and save the temperature evolution in a point I have defined in the center of my domain, but I don't want to call it by its coordinates. That is, I want to "call" that point by its tag.
So lets say this point is number 3. I do the following:
[Temp] = mphinterp(model,'T','Edim',0,'selection',3);
I get this error:
??? Error using ==> mphinterp at 144
Coordinate or non-solution dataset is required
I am using the COMSOL version 4.2a
Have you solved your problem? Do you have any ideas about what I am doing wrong?
Thank you!
Ana Gaspar