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.
COMSOL error: Cannot evaluate expression. Undefined variable.
Posted 21 janv. 2024, 03:29 UTC−5 General, API, Modeling Tools & Definitions Version 6.2 2 Replies
Please login with a confirmed email address before reporting spam
I am trying to include an external function in COMSOL. I copied the example from the manual about sin(x)/x. Compiled it into a .dll and included the library via Global Definitions > Functions > External. Then I have set function name "eval" and Arguments "x". In Plot Parameters, I have set the limits to 0 and 10. Now when I hit "Plot" I will get an error message:
Cannot evaluate expression. Undefined variable. - Variable: x - Global scope Failed to evaluate expression. - Expression: x
x is defined in Parameters with some Value. But it would make more sense to me, that x, in this case, is drawn upon the pool of the limit range.
Anyway, how do I have to set up x, so that my test plot will accept the variable and also, so that I can use the function elsewhere to evaluate?