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.

Skip unsolvable parameters in parametric sweep?

Please login with a confirmed email address before reporting spam

General question.

I run a parametric sweep and occasionally one of the parameters causes a simulation that doesn't converge.

e.g. the parameters are
param = 1, 2, 3, 4, 5 meters
and this simulation solves for 1, 2, 4, 5 meters but for whatever reason doesn't solve for 3 meters. It gives me an error.

The problem is, the parameter sweep just stops at param = 3 meters! How do I get it to, if it encounters something unsolvable, just skip 3 meters and continue to solve for param = 4 and 5 meters?

Thanks

7 Replies Last Post 2016年12月12日 GMT-5 12:38
Josh Thomas Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年9月4日 GMT-4 15:02
In general, I don't believe this is possible to do in COMSOL. However, one work-around that can work in some cases is to set the "Termination criterion" for the non-linear solver or the segregated solver (which I assume is causing the non-convergence) to "Iterations or tolerance" rather than the default which is "Tolerance."

In this way, the troublesome parameter step will still "converge" because you've iterated to the max amount of times. But, be careful because in this case the error will still be above the tolerance you set. You will have to be sure you individually check the error reported in the log for each parameter step to be sure the error is not too high for each of your returned solutions.

Best regards,
Josh Thomas
AltaSim Technologies

In general, I don't believe this is possible to do in COMSOL. However, one work-around that can work in some cases is to set the "Termination criterion" for the non-linear solver or the segregated solver (which I assume is causing the non-convergence) to "Iterations or tolerance" rather than the default which is "Tolerance." In this way, the troublesome parameter step will still "converge" because you've iterated to the max amount of times. But, be careful because in this case the error will still be above the tolerance you set. You will have to be sure you individually check the error reported in the log for each parameter step to be sure the error is not too high for each of your returned solutions. Best regards, Josh Thomas AltaSim Technologies

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年9月5日 GMT-4 08:42

General question.

I run a parametric sweep and occasionally one of the parameters causes a simulation that doesn't converge.

e.g. the parameters are
param = 1, 2, 3, 4, 5 meters
and this simulation solves for 1, 2, 4, 5 meters but for whatever reason doesn't solve for 3 meters. It gives me an error.

The problem is, the parameter sweep just stops at param = 3 meters! How do I get it to, if it encounters something unsolvable, just skip 3 meters and continue to solve for param = 4 and 5 meters?

Thanks


Try 2.999 or 3.001 meters. Numerics is funny sometimes.

Lasse
[QUOTE] General question. I run a parametric sweep and occasionally one of the parameters causes a simulation that doesn't converge. e.g. the parameters are param = 1, 2, 3, 4, 5 meters and this simulation solves for 1, 2, 4, 5 meters but for whatever reason doesn't solve for 3 meters. It gives me an error. The problem is, the parameter sweep just stops at param = 3 meters! How do I get it to, if it encounters something unsolvable, just skip 3 meters and continue to solve for param = 4 and 5 meters? Thanks [/QUOTE] Try 2.999 or 3.001 meters. Numerics is funny sometimes. Lasse

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年9月5日 GMT-4 10:32


General question.

I run a parametric sweep and occasionally one of the parameters causes a simulation that doesn't converge.

e.g. the parameters are
param = 1, 2, 3, 4, 5 meters
and this simulation solves for 1, 2, 4, 5 meters but for whatever reason doesn't solve for 3 meters. It gives me an error.

The problem is, the parameter sweep just stops at param = 3 meters! How do I get it to, if it encounters something unsolvable, just skip 3 meters and continue to solve for param = 4 and 5 meters?

Thanks


Try 2.999 or 3.001 meters. Numerics is funny sometimes.

Lasse


Yes that's what I usually do. But if I am sweeping a parameter 100 times, the simulation takes 24 hours to run, I don't want it to stop randomly on the 22nd value and then I must tweak that one value and run from scratch again...

Then it stops on the 26th value, I tweak that one value and run from scratch again...

You see the problem :)
[QUOTE] [QUOTE] General question. I run a parametric sweep and occasionally one of the parameters causes a simulation that doesn't converge. e.g. the parameters are param = 1, 2, 3, 4, 5 meters and this simulation solves for 1, 2, 4, 5 meters but for whatever reason doesn't solve for 3 meters. It gives me an error. The problem is, the parameter sweep just stops at param = 3 meters! How do I get it to, if it encounters something unsolvable, just skip 3 meters and continue to solve for param = 4 and 5 meters? Thanks [/QUOTE] Try 2.999 or 3.001 meters. Numerics is funny sometimes. Lasse [/QUOTE] Yes that's what I usually do. But if I am sweeping a parameter 100 times, the simulation takes 24 hours to run, I don't want it to stop randomly on the 22nd value and then I must tweak that one value and run from scratch again... Then it stops on the 26th value, I tweak that one value and run from scratch again... You see the problem :)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年9月5日 GMT-4 11:53


General question.

I run a parametric sweep and occasionally one of the parameters causes a simulation that doesn't converge.

e.g. the parameters are
param = 1, 2, 3, 4, 5 meters
and this simulation solves for 1, 2, 4, 5 meters but for whatever reason doesn't solve for 3 meters. It gives me an error.

The problem is, the parameter sweep just stops at param = 3 meters! How do I get it to, if it encounters something unsolvable, just skip 3 meters and continue to solve for param = 4 and 5 meters?

Thanks


Try 2.999 or 3.001 meters. Numerics is funny sometimes.

Lasse


Yes that's what I usually do. But if I am sweeping a parameter 100 times, the simulation takes 24 hours to run, I don't want it to stop randomly on the 22nd value and then I must tweak that one value and run from scratch again...

Then it stops on the 26th value, I tweak that one value and run from scratch again...

You see the problem :) It shouldn't have to run all the prior values over again, it should just skip the offending value.
[QUOTE] [QUOTE] General question. I run a parametric sweep and occasionally one of the parameters causes a simulation that doesn't converge. e.g. the parameters are param = 1, 2, 3, 4, 5 meters and this simulation solves for 1, 2, 4, 5 meters but for whatever reason doesn't solve for 3 meters. It gives me an error. The problem is, the parameter sweep just stops at param = 3 meters! How do I get it to, if it encounters something unsolvable, just skip 3 meters and continue to solve for param = 4 and 5 meters? Thanks [/QUOTE] Try 2.999 or 3.001 meters. Numerics is funny sometimes. Lasse [/QUOTE] Yes that's what I usually do. But if I am sweeping a parameter 100 times, the simulation takes 24 hours to run, I don't want it to stop randomly on the 22nd value and then I must tweak that one value and run from scratch again... Then it stops on the 26th value, I tweak that one value and run from scratch again... You see the problem :) It shouldn't have to run all the prior values over again, it should just skip the offending value.

Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年9月5日 GMT-4 13:08
Hi,

There is a way of doing this, although not completely general. If you do a 'Show default solver' and go to the Parametric node under 'Job Configurations' there is a check box 'Stop if error'. Clear it. This approach assumes that the sweep is an 'outer' sweep so that there is a 'Job Configurations' node in the solver.

Being able to continue after a parameter value caused an error is a functionality which has been recognized as important. In the upcoming version (to be released this autumn) it will be possible to instruct the parametric solver also within the Stationary solver to store dummy solutions and continue and to the next parameter value if an error occurs.

Regards,
Henrik
Hi, There is a way of doing this, although not completely general. If you do a 'Show default solver' and go to the Parametric node under 'Job Configurations' there is a check box 'Stop if error'. Clear it. This approach assumes that the sweep is an 'outer' sweep so that there is a 'Job Configurations' node in the solver. Being able to continue after a parameter value caused an error is a functionality which has been recognized as important. In the upcoming version (to be released this autumn) it will be possible to instruct the parametric solver also within the Stationary solver to store dummy solutions and continue and to the next parameter value if an error occurs. Regards, Henrik

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年9月7日 GMT-4 02:14

Hi,

There is a way of doing this, although not completely general. If you do a 'Show default solver' and go to the Parametric node under 'Job Configurations' there is a check box 'Stop if error'. Clear it. This approach assumes that the sweep is an 'outer' sweep so that there is a 'Job Configurations' node in the solver.

Being able to continue after a parameter value caused an error is a functionality which has been recognized as important. In the upcoming version (to be released this autumn) it will be possible to instruct the parametric solver also within the Stationary solver to store dummy solutions and continue and to the next parameter value if an error occurs.

Regards,
Henrik


Henrik,

Fantastic, works great.

David

[QUOTE] Hi, There is a way of doing this, although not completely general. If you do a 'Show default solver' and go to the Parametric node under 'Job Configurations' there is a check box 'Stop if error'. Clear it. This approach assumes that the sweep is an 'outer' sweep so that there is a 'Job Configurations' node in the solver. Being able to continue after a parameter value caused an error is a functionality which has been recognized as important. In the upcoming version (to be released this autumn) it will be possible to instruct the parametric solver also within the Stationary solver to store dummy solutions and continue and to the next parameter value if an error occurs. Regards, Henrik [/QUOTE] Henrik, Fantastic, works great. David

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 2016年12月12日 GMT-5 12:38
Is there now a way to do this in a recent version of Comsol? If I uncheck "stop if error", the simulation just keeps running wild. I actually want functionality similar to a "continue" in a for loop -- skip the rest of the evaluation and move to the next step.
Is there now a way to do this in a recent version of Comsol? If I uncheck "stop if error", the simulation just keeps running wild. I actually want functionality similar to a "continue" in a for loop -- skip the rest of the evaluation and move to the next step.

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.