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 Jul 29, 2022, 8:01 p.m. EDT
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 years ago Jul 8, 2022, 9:59 a.m. EDT
Updated: 2 years ago Jul 8, 2022, 10:00 a.m. EDT

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 Jul 8, 2022, 10:22 a.m. EDT

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 Jul 8, 2022, 10:35 a.m. EDT

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 Jul 8, 2022, 10:52 a.m. EDT

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 Jul 29, 2022, 8:01 p.m. EDT

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.