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.

if condition with true expression only

Please login with a confirmed email address before reporting spam

I want to create a function that will force a variable to a certain value if a certain condition is met, and leave it untouched otherwise. For example, it A > 100, B gets set to 0. If A < 100, B remains at whatever value it had in the previous time step.

From my understanding, an if() condition requires an expression for the 'true' case and the 'false' case, but I want an expression for the 'true' case only.

Thanks!


0 Replies Last Post 01.06.2023, 08:36 GMT-4
COMSOL Moderator

Hello Cameron Fenske

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

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.