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

Please login with a confirmed email address before reporting spam

Hi,

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


8 Replies Last Post Jun 12, 2014, 6:04 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 26, 2012, 4:43 p.m. EDT
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.
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.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 26, 2012, 5:16 p.m. EDT

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
[QUOTE] 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. [/QUOTE] 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

Posted: 1 decade ago Apr 27, 2012, 11:28 a.m. EDT
If i get it right, you need domain maximum (considering all the points) value till the current time. It could be done with Matlab script for sure but with GUI i am not sure how to implement it.

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?
If i get it right, you need domain maximum (considering all the points) value till the current time. It could be done with Matlab script for sure but with GUI i am not sure how to implement it. 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

Posted: 1 decade ago Apr 30, 2012, 2:35 a.m. EDT
Hi,

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.
Hi, 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

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 16, 2013, 9:33 a.m. EST
Hi again, after a long time!

@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.

Hi again, after a long time! @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

Posted: 1 decade ago Jan 18, 2013, 9:54 a.m. EST
Hi again,

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
Hi again, 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

Posted: 1 decade ago Jan 26, 2013, 8:19 a.m. EST
Hi Daniel,

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.
Hi Daniel, 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

Posted: 1 decade ago Jun 12, 2014, 6:04 a.m. EDT
Hi guys,

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
Hi guys, 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.