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.

Problem with sign function sign(u)

Please login with a confirmed email address before reporting spam

Hello,

I am trying to sketch a rounded square with the parametric curve functionality using x(t)=2.1sign(cos(t))(abs(cos(t)))^(1/2) and y(t)=2.1sign(sin(t))(abs(sin(t)))^(1/2), and i get a warning message which i assume is related with the sign function because the warning doesn't appear when it is not included in the above parametric relationships.

Do you have any clue why this happens? Does anyone has experience with the sign function Thanks miko


1 Reply Last Post Feb 17, 2020, 3:00 a.m. EST
Magnus Ringh COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 4 years ago Feb 17, 2020, 3:00 a.m. EST

Hello Miko,

These expressions should work fine. For general information, the correct COMSOL syntax is

2.1sign(cos(t))(abs(cos(t)))^(1/2) 2.1sign(sin(t))(abs(sin(t)))^(1/2)

(or use "sqrt(...)" instead of "^(1/2)")

I'm not sure what kind of warning you see. If it's about the tolerance, which is what I get with the default settings, you can adjust it in the Advanced Settings section of the settings window for the Parametric Curve feature.

Best regards, Magnus Ringh, COMSOL

Hello Miko, These expressions should work fine. For general information, the correct COMSOL syntax is 2.1*sign(cos(t))*(abs(cos(t)))^(1/2) 2.1*sign(sin(t))*(abs(sin(t)))^(1/2) (or use "sqrt(...)" instead of "^(1/2)") I'm not sure what kind of warning you see. If it's about the tolerance, which is what I get with the default settings, you can adjust it in the **Advanced Settings** section of the settings window for the Parametric Curve feature. Best regards, Magnus Ringh, COMSOL

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.