Quantcast
Viewing all 46 articles
Browse latest View live

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

Preparation of figures for papers/thesis?

If it has been written somewhere, can someone point me to where there is a guide to producing figures from 2D plots?

I am using COMSOL 4.2a, and want to use some surface plots alongside legends of the colour tables used. It is bizarre that COMSOL does not provide vector graphics export. I have tried to generate a decent image using the png export (via the 'snapshot' button -- is there any other way?), but it is horrible.

How I am doing it is:
1. Use highest 'Quality' settings in each component of the plot group that has such a setting (e.g. Surface; Contour)
2. Set export resolution to 1200 DPI
3. Set image dimensions to highest possible (for me it seems 4096 pixels is the upper limit?).
4. First generate a snapshot without any includes (i.e. no title, legend, axes. etc)
5. Then generate a snapshot with the legend included.
6. In GIMP cut and paste and scale as required.

See attached file for example of trying to export a surface plot with two colour legends. The model image part of the figure is tiny, and the legends huge.

If anyone has any tips or a separate set of routines in python/matplotlib or similar already in place I would love to see it!

Parameters in file name

Hello all,

I am in a situation where I need to work with 40 or so parameters, and as a result when I export my results from a parametric sweep (with parameters appended to the file name) the file becomes too large to save. Is there a way to select which parameters are appended to the file name? On the flip side, is there a way to define "parameter sets" in which 1 parameter defines the others?

Thanks,
Aaron Shifman

export mesh data for an explicit selection

Dear all,

I am a relatively new user COMSOL with a lot of Finite Element experience both on the programming and theory level. I started with COMSOL today which went actually quite fine and fast.

I would like to use that to interface assemled system matrices and mesh data to my own solvers. And it was successful for simple shell models.

At this point, I am also wondering if that is possible to export some selected node data or not. What I am directly interested is 'can I create node groups in COMSOL' which can be exported in some kind of text data file format or in binary file format?

Let me be more specific, lets say I have two fixed edges of a square plate and I would like know which nodes are associated with this selected fixed edges so that I can extract the constrained dof infornation myself. These kinds of information might give me more freedom for simple FRF analysis that I would like to conduct.

I learned that I can extract the matrices Kc and K, for instance, for the system stiffness matrix which represent the matrix on which the boundary conditions are applied and the full system matrix without any boundary conditions applied, respectively.

I would like to know or compute the fixed dof information by either getting it from COMSOL(which would be nice since no extra computations will be necessary.) or by iterating over the nodes myself.

Any ideas or pointers are appreciated on this matter.

Best regards,
Umut

Extracting data during simulation for each iteration

Hi,

In my model, I want to have the amount of pressure at specific grid points (1D model) at each iteration, and use this value to manipulate another variable which is used in the next iteration.

I was wondering whether it’s possible to use Live Link for Matlab/Excel (or UDF) for this purpose if Comsol could not handle the situation?

Thanks in advance

Export Data - Beam2D

Hello,

I have made a model using the Beam 2D element, and on the "Export-->Data->Expressions" I can not find the structure characteristics i.e. velocity, displacement etc. It is an eigenfrequency study, and the beam consists of two vertexes created by Bézier Polygon.

I tried it this way in order to be as simple as possible, and I chose Euler-Bernoulli Beam.


I imagine that my geometry causes these data to not exist although I could use some opinions.


P.S.: The only way to export data under these circumstances is by "Exporting to Data" my Mode Shape, but I think there are some problems there in the data.

Regards,
Nicolas T.

Data format of exported data adjustable?

Is the data format of the exported data adjustable?
I have calculated two integral values per time step.
I would like to have data exported in a format one line per time step with data in a row.

looking like:
time.............integral1.............integral2
time.............integral1.............integral2
time.............integral1.............integral2
time.............integral1.............integral2
time.............integral1.............integral2
.....

The data format, produced with the Spreadsheet data format, looks like

time integral1 integral2 time integral1 integral2 time integral1 integral2 time integral1 integral2 time integral1 integral2 time integral1 integral2 time integral1 integral2 time integral1 integral2 time integral1 integral2

or in transposed form like:

time
integral1
integral2
time
integral1
integral2
time
integral1
integral2
time
integral1
integral2
...
what is less easily usable

extract data from Comsol to matlab at a specific area

Hi:
I have a rectangular structure in Comsol and the field is located in the middle of the domain. I want to export only the data at the middle of the domain where the field is located, can I do that in Comsol? or it has to be done through Comsol script?. I used to do post processing manually and select a regular grid directly from Comsol.
Can anyone help me out with this?, I really need to find a way to export as many points from the middle of the domain as possible.
thanks,
Naema

Creating a zstack of images of COMSOL results

Hello, thank you for reading this,

I was wondering how I could export a zstack of slice plane images. In other words, I want to start at the top of my model, make a slice plane image, visualize my results for the slice plane, then take a snapshot and append the filename. I would repeat this after moving down the model a centimeter, then repeat the process.

What I have done was export a slice plane sequence to sectionwise, which I then imported to MATLAB, but this requires another couple of steps that just makes the workflow longer. I have also exported the whole scene as a point cloud/color information file and used some interpolation to view the results, but that ran into other issues. I figured that for what I do, just exporting png images would be easiest.

In short, I want to make a zstack of results, which I will then post-process and visualize in another utility. Is this possible, with command line scripts or in the GUI?

Thanks!

PDE import and export

Hi! Is there a way to Import/Export General Form PDE from/to a text file, as it is possible in the cases of e.g. parameters and variables?

A problem about exporting data on deformed mesh

I am trying to export the data on a deformed domain at different times. However, the export file only contains Coordinates information of the first time frame I chose. If there is 10 time steps, I have to export the data on each time step one by one. Is this a bug of Comsol I did something wrong?

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

Preparation of figures for papers/thesis?

If it has been written somewhere, can someone point me to where there is a guide to producing figures from 2D plots?

I am using COMSOL 4.2a, and want to use some surface plots alongside legends of the colour tables used. It is bizarre that COMSOL does not provide vector graphics export. I have tried to generate a decent image using the png export (via the 'snapshot' button -- is there any other way?), but it is horrible.

How I am doing it is:
1. Use highest 'Quality' settings in each component of the plot group that has such a setting (e.g. Surface; Contour)
2. Set export resolution to 1200 DPI
3. Set image dimensions to highest possible (for me it seems 4096 pixels is the upper limit?).
4. First generate a snapshot without any includes (i.e. no title, legend, axes. etc)
5. Then generate a snapshot with the legend included.
6. In GIMP cut and paste and scale as required.

See attached file for example of trying to export a surface plot with two colour legends. The model image part of the figure is tiny, and the legends huge.

If anyone has any tips or a separate set of routines in python/matplotlib or similar already in place I would love to see it!

Parameters in file name

Hello all,

I am in a situation where I need to work with 40 or so parameters, and as a result when I export my results from a parametric sweep (with parameters appended to the file name) the file becomes too large to save. Is there a way to select which parameters are appended to the file name? On the flip side, is there a way to define "parameter sets" in which 1 parameter defines the others?

Thanks,
Aaron Shifman

export mesh data for an explicit selection

Dear all,

I am a relatively new user COMSOL with a lot of Finite Element experience both on the programming and theory level. I started with COMSOL today which went actually quite fine and fast.

I would like to use that to interface assemled system matrices and mesh data to my own solvers. And it was successful for simple shell models.

At this point, I am also wondering if that is possible to export some selected node data or not. What I am directly interested is 'can I create node groups in COMSOL' which can be exported in some kind of text data file format or in binary file format?

Let me be more specific, lets say I have two fixed edges of a square plate and I would like know which nodes are associated with this selected fixed edges so that I can extract the constrained dof infornation myself. These kinds of information might give me more freedom for simple FRF analysis that I would like to conduct.

I learned that I can extract the matrices Kc and K, for instance, for the system stiffness matrix which represent the matrix on which the boundary conditions are applied and the full system matrix without any boundary conditions applied, respectively.

I would like to know or compute the fixed dof information by either getting it from COMSOL(which would be nice since no extra computations will be necessary.) or by iterating over the nodes myself.

Any ideas or pointers are appreciated on this matter.

Best regards,
Umut


Extracting data during simulation for each iteration

Hi,

In my model, I want to have the amount of pressure at specific grid points (1D model) at each iteration, and use this value to manipulate another variable which is used in the next iteration.

I was wondering whether it’s possible to use Live Link for Matlab/Excel (or UDF) for this purpose if Comsol could not handle the situation?

Thanks in advance

Export Data - Beam2D

Hello,

I have made a model using the Beam 2D element, and on the "Export-->Data->Expressions" I can not find the structure characteristics i.e. velocity, displacement etc. It is an eigenfrequency study, and the beam consists of two vertexes created by Bézier Polygon.

I tried it this way in order to be as simple as possible, and I chose Euler-Bernoulli Beam.


I imagine that my geometry causes these data to not exist although I could use some opinions.


P.S.: The only way to export data under these circumstances is by "Exporting to Data" my Mode Shape, but I think there are some problems there in the data.

Regards,
Nicolas T.

Data format of exported data adjustable?

Is the data format of the exported data adjustable?
I have calculated two integral values per time step.
I would like to have data exported in a format one line per time step with data in a row.

looking like:
time.............integral1.............integral2
time.............integral1.............integral2
time.............integral1.............integral2
time.............integral1.............integral2
time.............integral1.............integral2
.....

The data format, produced with the Spreadsheet data format, looks like

time integral1 integral2 time integral1 integral2 time integral1 integral2 time integral1 integral2 time integral1 integral2 time integral1 integral2 time integral1 integral2 time integral1 integral2 time integral1 integral2

or in transposed form like:

time
integral1
integral2
time
integral1
integral2
time
integral1
integral2
time
integral1
integral2
...
what is less easily usable

extract data from Comsol to matlab at a specific area

Hi:
I have a rectangular structure in Comsol and the field is located in the middle of the domain. I want to export only the data at the middle of the domain where the field is located, can I do that in Comsol? or it has to be done through Comsol script?. I used to do post processing manually and select a regular grid directly from Comsol.
Can anyone help me out with this?, I really need to find a way to export as many points from the middle of the domain as possible.
thanks,
Naema

Creating a zstack of images of COMSOL results

Hello, thank you for reading this,

I was wondering how I could export a zstack of slice plane images. In other words, I want to start at the top of my model, make a slice plane image, visualize my results for the slice plane, then take a snapshot and append the filename. I would repeat this after moving down the model a centimeter, then repeat the process.

What I have done was export a slice plane sequence to sectionwise, which I then imported to MATLAB, but this requires another couple of steps that just makes the workflow longer. I have also exported the whole scene as a point cloud/color information file and used some interpolation to view the results, but that ran into other issues. I figured that for what I do, just exporting png images would be easiest.

In short, I want to make a zstack of results, which I will then post-process and visualize in another utility. Is this possible, with command line scripts or in the GUI?

Thanks!
Viewing all 46 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>