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.

Piecewise Function is giving Unknown variable error.

Please login with a confirmed email address before reporting spam

I am using comsol 5.4. When I define a piecewise function and use it to write expression it is giving an "unknown variable error". (see images). What is going wrong here??(units are all correct)



2 Replies Last Post Feb 6, 2020, 4:12 a.m. EST

Please login with a confirmed email address before reporting spam

Posted: 4 years ago Feb 6, 2020, 4:03 a.m. EST

Hi Ayush, you defined a function, thus should call it with its argument: Eac(n)

Hi Ayush, you defined a function, thus should call it with its argument: Eac(n)

Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 4 years ago Feb 6, 2020, 4:12 a.m. EST

The argument in the function call doesn't need to be 'n', which is just a generic variable in the function definition. It can be any valid expression. But there must be an argument.

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
The argument in the function call doesn't need to be 'n', which is just a generic variable in the function definition. It can be any valid expression. But there must be an argument.

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.