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 import interpolation functions for complex numbers?

Please login with a confirmed email address before reporting spam

When using the interpolation function and importing data through EXCEL, it is found that COMSOL cannot import data when there is a complex form of data, such as 1+i. So how do I import complex numbers from a file when using the interpolation function?


5 Replies Last Post 29 lug 2022, 20:01 GMT-4
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 8 lug 2022, 09:59 GMT-4
Updated: 2 years ago 8 lug 2022, 10:00 GMT-4

One column for the real part, one column for the imaginary part.

Jeff

-------------------
Jeff Hiller
One column for the real part, one column for the imaginary part. Jeff

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 8 lug 2022, 10:22 GMT-4

OK. Thanks for the suggestion. lol But this is really inconvenient, especially when the amount of data is large

OK. Thanks for the suggestion. lol But this is really inconvenient, especially when the amount of data is large

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 8 lug 2022, 10:35 GMT-4

One column for the real part, one column for the imaginary part.

Jeff

I would like to ask. If I want to load discrete pressure field data, in the form of f(x,y,value), is there any better way besides using interpolation function?

Hope to receive your reply

>One column for the real part, one column for the imaginary part. > >Jeff I would like to ask. If I want to load discrete pressure field data, in the form of f(x,y,value), is there any better way besides using interpolation function? Hope to receive your reply

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 8 lug 2022, 10:52 GMT-4

That's the right approach.

-------------------
Jeff Hiller
That's the right approach.

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 29 lug 2022, 20:01 GMT-4

I am trying to import data using Definitions -> Functions -> Interpolation. Data is in Grid format and values are complex. The error I get is "Format of data file is not correct". The file in question has been generated in Comsol, so I assume that the issue is due to the complex values. I am not sure how to apply Jeff's suggestion in the case of a grid file. I tried in the case of 1 dimensional data by changing each line from A+Bi to A B but I still get the same error. Any help would be appreciated

I am trying to import data using Definitions -> Functions -> Interpolation. Data is in Grid format and values are complex. The error I get is "Format of data file is not correct". The file in question has been generated in Comsol, so I assume that the issue is due to the complex values. I am not sure how to apply Jeff's suggestion in the case of a grid file. I tried in the case of 1 dimensional data by changing each line from A+Bi to A B but I still get the same error. Any help would be appreciated

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.