-
Filter by Topic
Most Popular
All Topics
- List all discussions
Exporting Comsol data to Matlab?
|
Thread index | Previous thread | Next thread | Start a new discussion |
November 18, 2009 12:00pm UTC
Exporting Comsol data to Matlab?
Hello everybody,
I want to postprocess Comsol data in Matlab. Since Ascii files blow up in size and I get "out of memory error", I'm looking for some other way. I've no experience with Comsol-Matlab interface and it seems to me that this interface is not working in my system.
Could someone please tell me, how to export Postprocessing data in some Matlab-compatible format (not Ascii)?
I've converted a Comsol model (after executing) into an m-file and wanted to run it in Matlab (running separately from Comsol) but Matlab is probably not able to read the flbinaryfile (*.mphm). Any suggestion, what could be wrong here?
Thanks.
Daniel
Reply | Reply with Quote | Send private message | Report Abuse
November 18, 2009 10:06pm UTC in response to Daniel Berk
Re: Exporting Comsol data to Matlab?
Hi
You need to get your link between COMSOL and Matlab up running, either you missed a step during the installation of COMSOL or some of the files added to matlab are not set up correctly. Have a look at the installation documentation of COMSOL (I beleive ther are other comments in the forum and on the support KB pages).
Once you have the link running, you can (in V3.5a) just do a File "connect" to matlab from the COSOL GUI and export the "fem" structure to Matlab by a CNTRL-F.
then you need to understand the "fem" structure (see mlinterface.pdf in the COMSOL doc) to extract the data in binay mode and you can continue your processing at will.
Good luck
Ivar
Reply | Reply with Quote | Send private message | Report Abuse
June 9, 2010 9:12am UTC in response to Ivar Kjelberg
Re: Exporting Comsol data to Matlab?
Hi Ivar,
I have seen your reply for exporting data from comsol to matlab but when I do as u said then I get the following error
Error: 9016
Could not obtain license for SCRIPTPROMPT
License error.
Reply | Reply with Quote | Send private message | Report Abuse
May 30, 2011 1:02pm UTC in response to Bala Kampalli
Re: Exporting Comsol data to Matlab?
Hello everybody,
I want to export COMSOL data (maximum von mises stress) in to Matlab. Then I want to compare the value of the maximum von mises stress from the model with an in advanced determined permissible value, to create an optimal geometry for contact lenses. I've less experience with COMSOL and MATLAB interface.
Can someone tell me how to export the specific data to Matlab? In case it's necessary to use my model, I've attached my model.
Thanks in advance!
Arnoud
Reply | Reply with Quote | Send private message | Report Abuse
June 3, 2011 1:15pm UTC in response to Arnoud van der Vaart
Re: Exporting Comsol data to Matlab?
Hi,
Did you find out the way to export the vonMises stress per element basis into MATLAB?
My requirement is to do it in V4.1, but not in V3.5a. I know that there are different access methods to interact with the data models in V4.1. For example, I figured out how to get/set domain information on geomety objects. However, the solid mechanis variables appear to be not documented yet.
Best regards,
Kodanda
Reply | Reply with Quote | Send private message | Report Abuse
June 4, 2011 5:27pm UTC in response to Kodanda Ram Mangipudi
Re: Exporting Comsol data to Matlab?
Hi,
I didn't discover the way to export the maximum von Mises stress from COMSOL to MATLAB. I've read the document llmatlab_ug.pdf, but it's hard to understand for a MATLAB and COMSOL rookie like me. I'm using COMSOL 4.0a by the way. Do you have any experience with exporting data from COMSOL to MATLAB in COMSOL 4.0a or is it maybe the same as 4.1?
Best regards,
Arnoud
Reply | Reply with Quote | Send private message | Report Abuse
June 17, 2011 1:17pm UTC in response to Ivar Kjelberg
Re: Exporting Comsol data to Matlab?
Hi
You need to get your link between COMSOL and Matlab up running, either you missed a step during the installation of COMSOL or some of the files added to matlab are not set up correctly. Have a look at the installation documentation of COMSOL (I beleive ther are other comments in the forum and on the support KB pages).
Once you have the link running, you can (in V3.5a) just do a File "connect" to matlab from the COSOL GUI and export the "fem" structure to Matlab by a CNTRL-F.
then you need to understand the "fem" structure (see mlinterface.pdf in the COMSOL doc) to extract the data in binay mode and you can continue your processing at will.
Good luck
Ivar
Sorry, but this answer does not help.
First of all "when or where" do I have to press ctrl+f. Second I of course want to automatically return values that comsol computes to the matlab script (i.e. without gui ... Matlab calls Comsol and then uses the matrix that comsol produces for further Processing).
Second ... mlinterface.doc - I have not found it and cannot find it. Is it to much to ask for a link if there is a documentation...
The comsol Matlab interface is really a joke. It is a real struggle to do the simplest thing like give a single value from Comsol to Matlab. Sorry, but this is unacceptable.
I hope you will prepare a good solution soon, as I see the necessity to spread this word in the community...
Michael
Reply | Reply with Quote | Send private message | Report Abuse
July 4, 2011 6:20am UTC in response to Arnoud van der Vaart
Re: Exporting Comsol data to Matlab?
Hi,
I didn't discover the way to export the maximum von Mises stress from COMSOL to MATLAB. I've read the document llmatlab_ug.pdf, but it's hard to understand for a MATLAB and COMSOL rookie like me. I'm using COMSOL 4.0a by the way. Do you have any experience with exporting data from COMSOL to MATLAB in COMSOL 4.0a or is it maybe the same as 4.1?
Best regards,
Arnoud
Hello,
it need this information too. :)
I want to export only the von Mises stress data calculated in Comsol into Matlab for postprocessing. I know how to export to an txt-file. Of course I can copy paste the whole data, but this is to much handwork.
Greetings
Reply | Reply with Quote | Send private message | Report Abuse
February 8, 2012 10:42pm UTC in response to Kai Feldhusen
Re: Exporting Comsol data to Matlab?
Hello,
I know this must be a simple operation but how do you export just the eigenvalue/eigenfrequency in the new versions of Comsol? In 3.5a I used "x=fem.sol.lambda;"but now in Comsol 4.2 I have tried different variations of mpheval and mphglobal but have not been able to get the syntax right. Thanks for any assistance.
Reply | Reply with Quote | Send private message | Report Abuse
February 10, 2012 12:30pm UTC in response to Jonathan Lake
Re: Exporting Comsol data to Matlab?
Hello,
I know this must be a simple operation but how do you export just the eigenvalue/eigenfrequency in the new versions of Comsol? In 3.5a I used "x=fem.sol.lambda;"but now in Comsol 4.2 I have tried different variations of mpheval and mphglobal but have not been able to get the syntax right. Thanks for any assistance.
One way is to reverse engineer things that are not yet documented. For your purpose, there is an "Export Data" node available for the Results section. Right click on the results node and add an Export. There you will be able to select the different native and user-derived variable (if any) as export data. Save the model as an .m file and open it in a text editor, you will see the commands you can use in MATLAB.
best,
Kodanda
Reply | Reply with Quote | Send private message | Report Abuse
Rules and guidelines

