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.

How to stop a runaway simulation?

Please login with a confirmed email address before reporting spam

Hi,

I am running simulations automated with matlab scripting. Sometimes the simulations run away (do not converge) and last for ever with a extremly small time step. In such situations one usually hits the stop button in the solution progress window, but in an automated run you can't.

I guess it could be done with the Stop Condition in the 'Solvers Parameters - Time Stepping - Use Stop Condition' field.
There I could use the current or last time step size and set a limit to it.

But how can I access the current (or last) Stepsize ? Is there a variable I can use?

Thanks for any ideas,

Martin

7 Replies Last Post Nov 30, 2012, 6:32 a.m. EST
COMSOL Moderator

Hello Martin Suter

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.


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 20, 2011, 9:04 a.m. EDT
Did you find an answer for this issue? I have exactly the same problem.
Did you find an answer for this issue? I have exactly the same problem.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Sep 20, 2011, 1:27 p.m. EDT
Same Problem...
Could someone give an answer?
Same Problem... Could someone give an answer?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Sep 21, 2011, 2:57 a.m. EDT
No solution so far ...
No solution so far ...

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Sep 21, 2011, 3:44 a.m. EDT
Manualy:

ctrl + pause/break

Using script - check the documentation of a function that you use... Try to find where "the evaluation of convergance" is calculated and write proper condition..

Best regards,
Rafał Piotuch
Manualy: ctrl + pause/break Using script - check the documentation of a function that you use... Try to find where "the evaluation of convergance" is calculated and write proper condition.. Best regards, Rafał Piotuch

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Sep 22, 2011, 10:37 a.m. EDT
Dear Rafal Piotuch,

I don't quiet see what you mean!
Could you please be more precise?

Cheers
Dear Rafal Piotuch, I don't quiet see what you mean! Could you please be more precise? Cheers

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Sep 23, 2011, 1:16 a.m. EDT
Dear Julien Egger;
sure:) Hope you use Matlab to solve problem, else I don't know how to help you:)
So.. If you use Matlab it is easy to stop simulation manualy- just press ctr+pause/break and the simulation stops after some time - but for sure you want to stop simulation automaticly, without any human control...

When you solve sth. using for example femtime function.. read documentation of such function and read script of this function - there must be a "place" in code that refers to convergance calculation... So there must be a variable that stores current step_size.. If you will write in pseudo code:

if (step_size<0.0001) then
%the function return sth, so it should be stopped or proper value should be returned.
return(0);

it should be working.
So that's all.

Rafał Piotuch
Dear Julien Egger; sure:) Hope you use Matlab to solve problem, else I don't know how to help you:) So.. If you use Matlab it is easy to stop simulation manualy- just press ctr+pause/break and the simulation stops after some time - but for sure you want to stop simulation automaticly, without any human control... When you solve sth. using for example femtime function.. read documentation of such function and read script of this function - there must be a "place" in code that refers to convergance calculation... So there must be a variable that stores current step_size.. If you will write in pseudo code: if (step_size

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 30, 2012, 6:32 a.m. EST
look up the global variable "timestep" in the comsol documentation. It does exactly what you want :)
look up the global variable "timestep" in the comsol documentation. It does exactly what you want :)

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.