COMSOL export rounds frequency data in datapoint headers

Please login with a confirmed email address before reporting spam

I did a study using frequency domain for different frequencies. Screenshot of setup:

Frequency setup

When I plot the data inside, it looks fine.

COMSOL plot

I exported the data as a .csv file with the "Full precision" setting on. However, this seems to only impact the values defined in the "expressions" section and not the frequency data.

Export settings

The exported table contains datapoints inside the .csv table that are formatted like this:

intop1(ec.Jz/E0/a^2) (S/m) @ freq=1.2589E5, s=0.01 0.05118908008352398+5.732703179902605E-4i

I used the "@ freq=1.2589E5" part of the datapoint header to read the frequencies. I plotted the data in python with the exact same operations performed on it, which resulted in the following graph, which looks bumpy:

Bumpy Graph

The reason for this is that the 5 decimal places of the frequency in the datapoint header were too imprecise for my use-case. The solution was to export not only the simulation results in the "expressions" tab, but also the frequency by just adding "freq" as an expression, which will export it with full accuracy. This is probably completely obvious to 99% of you, but I was so confused why my graph looked bumpy with the exported data.


2 Replies Last Post 27 feb 2025, 02:27 GMT-5
Gunnar Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 months ago 26 feb 2025, 10:07 GMT-5

This sounds strange. Can you attach the model?

In 6.3 it's possible to choose for each parameter level whether it's mapped to the rows or the columns in the output file. It sounds as if mapping the freq to the rows would be what you want. The setting is in the Advanced section in Export > Data.

This sounds strange. Can you attach the model? In 6.3 it's possible to choose for each parameter level whether it's mapped to the rows or the columns in the output file. It sounds as if mapping the freq to the rows would be what you want. The setting is in the Advanced section in Export > Data.

Please login with a confirmed email address before reporting spam

Posted: 2 months ago 27 feb 2025, 02:27 GMT-5

Sorry, I use version 6.2, where I find no such option. However, my solution was to export the freq as a second expression in the expression tab. This exports the frequency without rounding.

Sorry, I use version 6.2, where I find no such option. However, my solution was to export the freq as a second expression in the expression tab. This exports the frequency without rounding. ![](https://cdn.imgchest.com/files/4z9cv396ov7.png)

Reply

Please read the discussion forum rules before posting.

Please log in to post a reply.

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.