Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

Calculating cubic roots with conditions

Please login with a confirmed email address before reporting spam

Hello everyone

I am using Comsol 3.5a and I am trying to perform a calculation but unfortunately it seems not to work. I am using Comsol just to solve differential equations and , hence, I am using the mathematical tool that is incorporated. My domain is a square with variables x and z and side equal to 10 dimensionless units. What I want is to calculate the square root of (x^2-y^2) but only for x>y. In all other cases I want the outcome to be 0. I tryied to use absolute value (using the abs(x^2-y^2)) but it seems that in that way I also create solutions for x<y , as well.

Also I am trying to use a condition like: sqrt (x^2-y^2)*(x>y) but also is not working.

Do you have any idea what should I do?

Thank you very much

Yuri

1 Reply Last Post 2017年8月21日 GMT-4 08:13
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 2017年8月21日 GMT-4 08:13
How about sqrt((x^2-y^2)*(x>y)) ?
Jeff
How about sqrt((x^2-y^2)*(x>y)) ? Jeff

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.