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.

try/catch in matlab for COMSOL

Please login with a confirmed email address before reporting spam

I am doing a parametric sweep in COMSOL with the geometry. The problem is, it is a large parameter space and a few combinations which would be unreasonable to check give an error. It is a stationary solver and what I need is something in COMSOL matlab code to tell me if there is inverted geometry or too many iterations such that I can skip that set of parametric values. I get the error:

For example, can I have COMSOL output the iterations as it solves such that if it hits a certain amount, I can quickly tell if I need to skip that set of parameters. This is inside a huge FOR loop as I need to sweep over a very large parametric space.

"??? Java exception occurred:
Exception:
com.comsol.util.exceptions.FlException: Failed to
find a solution for the initial parameter
(rethrown as
com.comsol.util.exceptions.FlException)
(rethrown as
com.comsol.util.exceptions.FlException)
Messages:
The following feature has encountered a problem

The following feature has encountered a problem

Failed to find a solution for the initial
parameter

Maximum number of Newton iterations reached

Returned solution is not converged
- Feature: Stationary Solver 1 (sol1/s1)
- Error: Failed to find a solution for the
initial parameter."

2 Replies Last Post Feb 1, 2013, 8:23 p.m. EST
COMSOL Moderator

Hello Alexander Warning

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.


Pierre-Yves Prodhomme

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 1, 2013, 5:35 a.m. EST
I don't know if you got an answer to your post.
I am stuck with a similar problem.
With a stationnary solver I would like COMSOL to calculate all the parameters even when he didn't converge for one particular parameter. For the moment when COMSOL is not able to converge for a parameter it just stops as you said. This is bothering. I am sure there is a solution but I cannot find it...
Any help would be appreciated.
Thanks in advance.
I don't know if you got an answer to your post. I am stuck with a similar problem. With a stationnary solver I would like COMSOL to calculate all the parameters even when he didn't converge for one particular parameter. For the moment when COMSOL is not able to converge for a parameter it just stops as you said. This is bothering. I am sure there is a solution but I cannot find it... Any help would be appreciated. Thanks in advance.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 1, 2013, 8:23 p.m. EST
Check for "stop condition" in the help. It's explained pretty well there.
Check for "stop condition" in the help. It's explained pretty well there.

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.