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.
maximum (or minimum) value in a time domain
Posted Apr 25, 2012, 6:48 a.m. EDT 8 Replies
Please login with a confirmed email address before reporting spam
I have a problem I cannot solve and you might help me.
In my time-dependent analysis I would like to know the maximum of value of a variable, which has been reached at previous time steps. But I can't figure it out how to that.
If my variable is v(t), then I would like to know max(v(t=t0), (t=t1), ..., v(t=ti)) at each time step.
Do you think it is possible to do that?
Thanks,
Daniel
Please login with a confirmed email address before reporting spam
Once you define the expression, you should get the maximum or minimum value. Hope it helps.
Please login with a confirmed email address before reporting spam
I think it is possible, try using Results ----> Derived values ----> maximum (or minimum) ---> line, surface or volume depending upon your domain dimension.
Once you define the expression, you should get the maximum or minimum value. Hope it helps.
Hej,
Thanks, but the problem is that I'm looking for the maximum (or minimum) for each point of the domain until the current time. And I want to use that value during the calculation.
Daniel
Please login with a confirmed email address before reporting spam
You need this value for postprocessing or to change variable/model setting for next time step? If it is postprocessing, you may still be able to use what i wrote in the last post.
Good luck with your problem. Did you try contacting Comsol support on this?
Please login with a confirmed email address before reporting spam
You can do this by creating a ODE and assigning the co-efficient to 0 and using the command "ODE variable - ((variable>=ODE variable)*variable +(variable<ODE variable)*ODE variable) for f. This will assign the maximum field value of the variable to the ODE variable which you can access in the end. Use segregated solver to solve for the variable first and then solve for the ODE.
Hope this helps.
Best
Lakshmi.
Please login with a confirmed email address before reporting spam
@Mranal: I need this for next time step, not only for post-processing. I have tried with Comsol support, but it didn't help.
@Lakshmi: good idea, I tried but didn't work. It says that the matrix is singular.
Please login with a confirmed email address before reporting spam
actually it works thanks, Lakshmi! The coefficient should be close to 0, but not exactly. Then it works. My only problem is that now the solver takes more time steps and it slows down the computation.
Daniel
Please login with a confirmed email address before reporting spam
Another user was suggested by COMSOL support to use this global equation
d(Tmax)/dt = dT/dt*(dT/dt>0)*(T>Tmax)
to find the max of T over time.
Hope this reduces the time.
Best regards
Lakshmi.
Please login with a confirmed email address before reporting spam
is there any chance to see the mph-file implementation of either one of these ODEs?
I think I am stuck in my evaluation ...
Regards
Markus
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.
Suggested Content
- FORUM Where is the maximum (or minimum)?
- KNOWLEDGE BASE License Borrowing
- KNOWLEDGE BASE Two-Phase Flow Modeling Guidelines
- BLOG Exploiting Maximum Principles to Save Time and Resources
- FORUM Re: maximum (or minimum) value in a time domain