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.

avoid sharp picks _convergence problem

Please login with a confirmed email address before reporting spam

Dear All,
Do you have any idea how I can smooth this expression?

B=1/A*(A!=0)+0*(A==0)

Many thanks in advance,
Elham

2 Replies Last Post 2011年1月5日 GMT-5 12:31
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年1月5日 GMT-5 10:08
Hi

have you tried

1/(A+eps)

if A is only >0 or only <0 it could work

or

if(A==0,0,1/A)

this might work

See the users Guide p81:
Use the if operator to avoid illegal operations. For example, if(x==0,1,sin(x)/x) is a valid and continuous expression for all values of x, including x = 0.

--
Good luck
Ivar
Hi have you tried 1/(A+eps) if A is only >0 or only

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年1月5日 GMT-5 12:31
Thank you ivar. what I've written and you suggest seem to be equivalant. apparantly, this kind of if condition shouldn't make convergence problem. I need to look for other sources of problem.
regards,
Elham
Thank you ivar. what I've written and you suggest seem to be equivalant. apparantly, this kind of if condition shouldn't make convergence problem. I need to look for other sources of problem. regards, Elham

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.