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.
Stop condition function of solver configurations
Posted 23 apr 2015, 18:26 GMT-4 Battery Design, Parameters, Variables, & Functions, Studies & Solvers 8 Replies
Please login with a confirmed email address before reporting spam
Attachments:
Please login with a confirmed email address before reporting spam
Consider a circuit application where I want to simulate a transition until the output reached a critical threshold to constitute a change in logic state. Then I can run until the value crosses that threshold and then I interpolate the time it would equal the threshold. It would be nice if the code could directly determine that time, but in many cases interpolation, for example 2nd order, is virtually as good.
Please login with a confirmed email address before reporting spam
I was wondering if there is a way to stop calculation immediately. For example consider a cyclic condition where the exact value of a parameter at the end of a cycle is critical for the next cycle. Do you have any suggestion to implement this situation?
Please login with a confirmed email address before reporting spam
I'm not certain this is what you're after, but there are methods to solve periodic nonlinear systems. A classic example is a CMOS ring oscillator: if the ring is long it will oscillate with a long-period square wave, not sinusoidally, due to the truncation imposed by the ground supply.
In real life you break the ring, excite the system with an input, then close the ring, and after a sufficiently large number of laps the signal will converge on a steady state. But to simulate this is impractical. So there's other techniques which are used. However, I don't think Comsol supports this sort of analysis, from what I've seen.
It's not enough, however, to wait for the output to return to the input because every degree of freedom in the model must be periodic, not just an output parameter.
If you're just looking for when the output hits a certain threshold I recommend interpolation, preferably 2nd order.
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
Stop conditions cannot be more accurate than the local time stepping. It stops at the first time when the condition becomes false . For a more accurate stop condition in time-dependent models, you can use events (in the Events interface). In the attached model (solved using COMSOL 5.1), I have added an Implicit Event for the stop condition comp1.soc_neg-1e-3<0 and used the Event tolerance setting (in the Time Stepping section in the Time-Dependent Solver node's Settings window) to provide an accurate stop. I have also added the solutions at the steps just before and after the event to the solution. I have attached a screenshot of the new settings for the stop condition.
Best regards,
Magnus Ringh, COMSOL
Please login with a confirmed email address before reporting spam
That is right! Actually, I was thinking about using events instead of stop condition, however, I did not know how. Could you please tell me in adding solution what the steps before and after stop is for?
Regards,
Barzin
Please login with a confirmed email address before reporting spam
Normally the solutions stored from the time-dependent solver are the solutions specified in the Times to store list for the time-dependent solver. The option to store the solutions before and after the stop condition has been fulfilled makes sure that the solutions available for postprocessing include the solutions for the times as close to the time when the stop condition is fulfilled as possible. You can then choose to store only some solutions and not all the solver steps up to, and after, this point in the time-stepping process.
Best regards,
Magnus Ringh, COMSOL
Please login with a confirmed email address before reporting spam
Many thanks for the prompt reply! It was a good explanation.
Best regards,
Barzin
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.