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.

quasi steady-state check: a fun puzzle

Please login with a confirmed email address before reporting spam

So, this problem is more like a puzzle/riddle for me, to use the power of Comsol, if possible.

Let's say I have a point position in time, i.e. a pandule head position, after an initial load, the tip reaches a quasi steady-state pattern after some time, oscillating at the same amplitute and frequency, more or less: cl.ly/T74 for example.

How can one check this in Comsol and tell the solver to stop?


ps. maybe doing it via stop condition. so there should be some kind of averaging and slope check in global equations for u, generating a value, then piping it to the solver to stop.

7 Replies Last Post 21.04.2010, 01:37 GMT-4
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 17.04.2010, 03:21 GMT-4
Hi

In other words, from your graph, you are saying you have some harmonic bahaviour (of unknown frequency)with a varying amplitude that after some time reaches a saturation, so you want to detect when the amplitude has reached it's "steady state.

Clearly if you know the periode, you can take a running integration of one periode and plot that, then you get rid of the main oscillations. As a priori you do not know the frequency, then perhaps if you use the calculated time signal and run an autocorrelation after each time step and put a stop condition on the derivative of the result ?, just a crazy idea.

make a test with an function such as a*(1-exp(-k/t))*sin(2*pi*f*t)

Have fun Comsoling
Ivar

Complement:

I tried it out in Maple, not good enough as the result is oscillating, should have though about that, but there should be a trivial way to extract the average amplitude from such a signal.
The file below might give you some ideas, I would have to go back to my signal processing books, that subject has slipped away I notice ;)

The main issue is to get a function that is not to sensitive to noise and offset

Ivar
Hi In other words, from your graph, you are saying you have some harmonic bahaviour (of unknown frequency)with a varying amplitude that after some time reaches a saturation, so you want to detect when the amplitude has reached it's "steady state. Clearly if you know the periode, you can take a running integration of one periode and plot that, then you get rid of the main oscillations. As a priori you do not know the frequency, then perhaps if you use the calculated time signal and run an autocorrelation after each time step and put a stop condition on the derivative of the result ?, just a crazy idea. make a test with an function such as a*(1-exp(-k/t))*sin(2*pi*f*t) Have fun Comsoling Ivar Complement: I tried it out in Maple, not good enough as the result is oscillating, should have though about that, but there should be a trivial way to extract the average amplitude from such a signal. The file below might give you some ideas, I would have to go back to my signal processing books, that subject has slipped away I notice ;) The main issue is to get a function that is not to sensitive to noise and offset Ivar


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 17.04.2010, 07:52 GMT-4
Wow, that looks more trickier than I thought. Many thanks Ivar.
Wow, that looks more trickier than I thought. Many thanks Ivar.

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 17.04.2010, 09:50 GMT-4
Hi

yes I agree, that is why I believe there must be a simpler way ;)

What I show is the lazy engineer trying out some formulas, my reference books are in my office and it's the week-end, nice weather and I'm at home, to far to fetch those. But you might find a working trick, no ?

have fun Comsoling
Ivar
Hi yes I agree, that is why I believe there must be a simpler way ;) What I show is the lazy engineer trying out some formulas, my reference books are in my office and it's the week-end, nice weather and I'm at home, to far to fetch those. But you might find a working trick, no ? have fun Comsoling Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 19.04.2010, 05:56 GMT-4
"How can one ... tell the solver to stop?"

Excellent question for our resident Comsol gurus.

It would be great to be able to embed a stop condition in Comsol that would abort the computation if some particular condition were met, say in a time dependent calculation. Let's say you set up a problem to run for 10 sec but you find the computation is going awry after 1 sec. Rather than wait around for the full 10 sec (which could be 10 min or 10 hr in computation time), it would be better to just abort the whole thing. This would require being able to set up some function for performing a test at each time step, and then issuing a command to stop the computation (probably also instructing Comsol to do clean up work) if necessary.

Is this possible?
"How can one ... tell the solver to stop?" Excellent question for our resident Comsol gurus. It would be great to be able to embed a stop condition in Comsol that would abort the computation if some particular condition were met, say in a time dependent calculation. Let's say you set up a problem to run for 10 sec but you find the computation is going awry after 1 sec. Rather than wait around for the full 10 sec (which could be 10 min or 10 hr in computation time), it would be better to just abort the whole thing. This would require being able to set up some function for performing a test at each time step, and then issuing a command to stop the computation (probably also instructing Comsol to do clean up work) if necessary. Is this possible?

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 19.04.2010, 10:15 GMT-4
Hi

yes there is a "stop condition" in the (or just for some?) solver section (advanced ones ?), that does as if you manually hit the "stop button" in the log, up to you to define your criteria, try a indexed search on the pdf doc more info, notls such info is somewhat spread out often in examples in the different docs.

Have fun Comsoling
Ivar
Hi yes there is a "stop condition" in the (or just for some?) solver section (advanced ones ?), that does as if you manually hit the "stop button" in the log, up to you to define your criteria, try a indexed search on the pdf doc more info, notls such info is somewhat spread out often in examples in the different docs. Have fun Comsoling Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 19.04.2010, 10:21 GMT-4

Hi

yes there is a "stop condition" in the (or just for some?) solver section (advanced ones ?), that does as if you manually hit the "stop button" in the log, up to you to define your criteria, try a indexed search on the pdf doc more info, notls such info is somewhat spread out often in examples in the different docs.

Have fun Comsoling
Ivar


Indeed. e.g. for the case of inverted meshes, you can tell comsol to stop and do remeshing.

Meanwhile, back to the problem itself:
Is there a way to apply some functions on the results? (FFT, mean,...)?
[QUOTE] Hi yes there is a "stop condition" in the (or just for some?) solver section (advanced ones ?), that does as if you manually hit the "stop button" in the log, up to you to define your criteria, try a indexed search on the pdf doc more info, notls such info is somewhat spread out often in examples in the different docs. Have fun Comsoling Ivar [/QUOTE] Indeed. e.g. for the case of inverted meshes, you can tell comsol to stop and do remeshing. Meanwhile, back to the problem itself: Is there a way to apply some functions on the results? (FFT, mean,...)?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 21.04.2010, 01:37 GMT-4
Sorry, I meant to stop a computation programmatically, not manually. Further, it would be useful to be able to write out some diagnostics at the same time, to be able to see the state of the computation at the time it stopped. It would be rather like a try-catch approach in Matlab or C/C++ programming. Would this be possible to do by first saving a model in Matlab, manually inserting the necessary diagnostics in the Matlab code, then running it from there? I'll check the docs as you suggested. Thanks.
Sorry, I meant to stop a computation programmatically, not manually. Further, it would be useful to be able to write out some diagnostics at the same time, to be able to see the state of the computation at the time it stopped. It would be rather like a try-catch approach in Matlab or C/C++ programming. Would this be possible to do by first saving a model in Matlab, manually inserting the necessary diagnostics in the Matlab code, then running it from there? I'll check the docs as you suggested. Thanks.

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.