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.

Setting a maximum limit to a variable

Please login with a confirmed email address before reporting spam

I am creating a user-defined variable for calculating pumping power, which will be a function of pressure difference and flow rate. I will use the pressure difference calculated by COMSOL as the input for the function. However, I want to set a maximum limit for the pumping power value, so that it does not exceed a certain threshold. Is there a built-in function in COMSOL that can help me achieve this?


2 Replies Last Post 23 mag 2023, 08:51 GMT-4
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 10 mag 2023, 13:42 GMT-4
Updated: 2 years ago 10 mag 2023, 13:47 GMT-4

Hello Shaik,

You could accomplish this by using an expression involving booleans to define your pumping power function, something like

which equals f(p) when f(p) is less than 5 and saturates at 5 when f(p) is greater than 5.

Best,

Jeff

-------------------
Jeff Hiller
Hello Shaik, You could accomplish this by using an expression involving booleans to define your pumping power function, something like ( f(p) < 5 ) * f(p) + ( f(p) > 5 ) * 5 which equals f(p) when f(p) is less than 5 and saturates at 5 when f(p) is greater than 5. Best, Jeff

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 23 mag 2023, 08:51 GMT-4

Thank you for your valuable explanation.

Thank you for your valuable explanation.

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.