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 with Piecewise Function

Please login with a confirmed email address before reporting spam

Hello,

I'm testing incorporating variable material properties into my model with a piecewise function but am getting errors when I try to run it. Is this the correct syntax? When changing the material property to the function argument it goes yellow.

Here are images of my view from a specific heat function.

Thank you. Jocelyn



1 Reply Last Post 09.03.2025, 10:11 MEZ

Please login with a confirmed email address before reporting spam

Posted: 6 months ago 09.03.2025, 10:11 MEZ
Updated: 6 months ago 09.03.2025, 10:19 MEZ

If you hover over the orange colored (which indicates problem) text, maybe an error text pops up.

I think you can't use T there as used. The used function argument name T only exist inside your piecewise function. From outside you must use a constant or a variable, which exists outside.

Or Cp as variable name and Cp also as function name is a problem.

Nice greetings

If you hover over the orange colored (which indicates problem) text, maybe an error text pops up. I think you can't use T there as used. The used function argument name T only exist inside your piecewise function. From outside you must use a constant or a variable, which exists outside. Or Cp as variable name and Cp also as function name is a problem. Nice greetings

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.