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.

Errors when computing the interpolation function

Please login with a confirmed email address before reporting spam

Greetings, COMSOL user.

I have experiencing problems when computing a COMSOL + MATLAB code. The error that occurs (with or without MATLAB) is linked to Interpolation function #1 (int1). The error message says the following:

Messages:
The following feature has encountered a problem

The following feature has encountered a problem

The following feature has encountered a problem:

Failed to evaluate variable.
- Variable: int1
- Geometry: 1
- Domain: 1
I have right paths to the interpolation function which is a .txt file. I have two more functions, but I have no problems with them.

The .txt file I import consists of three columns:
First column is for X-coordinates and second one is for Y-coordinates. It's a 2D geometry. The third column assigns values for the cells created by (X,Y)-coordinates.

I appreciate if somebody could give some advice.

Thanks

7 Replies Last Post 25 gen 2017, 02:51 GMT-5

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 17 gen 2017, 12:20 GMT-5
First check whether you can plot the interpolation function. If not, slightly change the coordinates in txt file.
First check whether you can plot the interpolation function. If not, slightly change the coordinates in txt file.

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 18 gen 2017, 00:28 GMT-5
Hello, Sohan.

I can plot the interpolation function. Since there are three columns in the .txt file, COMSOL plots a 3D figure.
Could you please elaborate on how I can change the coordinates?

Regards,

Ulugbek
Hello, Sohan. I can plot the interpolation function. Since there are three columns in the .txt file, COMSOL plots a 3D figure. Could you please elaborate on how I can change the coordinates? Regards, Ulugbek

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 18 gen 2017, 08:19 GMT-5
Since the error message says the software is unable to evaluate a VARIABLE, it looks like the problem is that you may not have passed arguments (as in int(x,y) for instance) to int1, leading the software to think that int1 is a variable as opposed to a function.
Best,
Jeff
Since the error message says the software is unable to evaluate a VARIABLE, it looks like the problem is that you may not have passed arguments (as in int(x,y) for instance) to int1, leading the software to think that int1 is a variable as opposed to a function. Best, Jeff

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 18 gen 2017, 20:09 GMT-5
Hi, Jeff.

Thank you. I fixed the problem. The error was caused by the int1. I modified that function to int1(x,y) and everything went perfect.
Thank you for your help.

Dear Jeff, is the syntax in 4.2 and 5.2 are different? In v 4.2 the interpolation function caused no problems when it was int1 only.
Hi, Jeff. Thank you. I fixed the problem. The error was caused by the int1. I modified that function to int1(x,y) and everything went perfect. Thank you for your help. Dear Jeff, is the syntax in 4.2 and 5.2 are different? In v 4.2 the interpolation function caused no problems when it was int1 only.

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 19 gen 2017, 08:15 GMT-5
No, the syntax has not changed. It has never been possible to call an interpolation function without stating its arguments.
Jeff
No, the syntax has not changed. It has never been possible to call an interpolation function without stating its arguments. Jeff

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 24 gen 2017, 09:58 GMT-5
I need to correct my post of 1/19. There is one case where you can in fact call an interpolation function without passing arguments to it explicitly: you can do that if you checked the "Use spatial coordinates as arguments" checkbox on the Settings window for the interpolation function. The function can then be called exactly as you would call a variable. This makes me think that perhaps in your version 4.2 file you had checked that checkbox.
Best,
Jeff
I need to correct my post of 1/19. There is one case where you can in fact call an interpolation function without passing arguments to it explicitly: you can do that if you checked the "Use spatial coordinates as arguments" checkbox on the Settings window for the interpolation function. The function can then be called exactly as you would call a variable. This makes me think that perhaps in your version 4.2 file you had checked that checkbox. Best, Jeff

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 25 gen 2017, 02:51 GMT-5
Thank you, Jeff.

I will definitely take a note of that.

Regards.
Thank you, Jeff. I will definitely take a note of that. Regards.

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.