Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

Is there a simple way to obtain the historic maximum of a variable?

Please login with a confirmed email address before reporting spam

The variable may increase and descrease as function of time. It is needed for coupling analysis, instead of output.

10 Replies Last Post 29 nov 2012, 05:54 GMT-5
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 4 nov 2011, 03:34 GMT-4
Hi

in the data set node you can extract the min max of a region and then analyse that separately, or you can get it into a table. Check the doc on the Posprocessing nodes

--
Good luck
Ivar
Hi in the data set node you can extract the min max of a region and then analyse that separately, or you can get it into a table. Check the doc on the Posprocessing nodes -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 4 nov 2011, 09:33 GMT-4
I may not have made it clear. But the maximum value is to be used for coupling - I need it as an input to the model - not for postprocessing.
And what I need is a field variable which is the maximum of another field variable at the same position in history. Similar as the plastic strain in elasto-plastic analysis, but unfortunately, COMSOL hide the details of implementation on plastic strain. This is very important in material modeling involving internal variables. I believe it is not too difficult to implement as an operator, hope COMSOL could consider it in the next version.
I may not have made it clear. But the maximum value is to be used for coupling - I need it as an input to the model - not for postprocessing. And what I need is a field variable which is the maximum of another field variable at the same position in history. Similar as the plastic strain in elasto-plastic analysis, but unfortunately, COMSOL hide the details of implementation on plastic strain. This is very important in material modeling involving internal variables. I believe it is not too difficult to implement as an operator, hope COMSOL could consider it in the next version.

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 4 nov 2011, 16:07 GMT-4
Hi

with a maxop1() operator I believe you can manage, I have added a simple example, it's nonsense in physics, I add here a boundary force driven by the maximum of the face displacement, but it illustrates the use of a model global variable defined as the maximum of a face, used in the solving process

It's a v4.2a model file
--
Good luck
Ivar
Hi with a maxop1() operator I believe you can manage, I have added a simple example, it's nonsense in physics, I add here a boundary force driven by the maximum of the face displacement, but it illustrates the use of a model global variable defined as the maximum of a face, used in the solving process It's a v4.2a model file -- Good luck Ivar


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 6 nov 2011, 21:41 GMT-5
Thanks. I can't open your model (it requires CAD module), but based on the description, I guess you misunderstood me again.
I need a field, not a global variable, and I need to take the maximum in time, not space. In your example, I need the boundary force on any point to be a function of the maximum displacement of the same point from t=0 to t.
Thanks. I can't open your model (it requires CAD module), but based on the description, I guess you misunderstood me again. I need a field, not a global variable, and I need to take the maximum in time, not space. In your example, I need the boundary force on any point to be a function of the maximum displacement of the same point from t=0 to t.

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 8 nov 2011, 03:24 GMT-5
Hi

I didn't use any CAD tools, but it could be a 4.2a effect.

Indeed I didn't catch your true issue then, with a projection operator you can extract, for a given time the values of your boundary, but then how to accumulate the max over time ? Even your field will become rather discontinuous I believe. Probably you have only matlab/scripting to get around

--
Good luck
Ivar
Hi I didn't use any CAD tools, but it could be a 4.2a effect. Indeed I didn't catch your true issue then, with a projection operator you can extract, for a given time the values of your boundary, but then how to accumulate the max over time ? Even your field will become rather discontinuous I believe. Probably you have only matlab/scripting to get around -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 8 nov 2011, 09:23 GMT-5
Ivar,
Actually, COMSOL has used such a feature in the Structure Mechanics module. The plastic strain is a variable like that (loading increase it, unloading / reloading up to the historic maximum would not change it, overloading it would renew the value). Such a field should not be too discontinuous. COMSOL has hidden the implementation from user for some reason, so it can not be modified, and we have no clue how it is implemented.
It is almost impossible even with a matlab script. Because this is a field, i.e. each point would carry a different value, and it needs to be stored somewhere throughout the simulation.
Thank you anyway.
Wei
Ivar, Actually, COMSOL has used such a feature in the Structure Mechanics module. The plastic strain is a variable like that (loading increase it, unloading / reloading up to the historic maximum would not change it, overloading it would renew the value). Such a field should not be too discontinuous. COMSOL has hidden the implementation from user for some reason, so it can not be modified, and we have no clue how it is implemented. It is almost impossible even with a matlab script. Because this is a field, i.e. each point would carry a different value, and it needs to be stored somewhere throughout the simulation. Thank you anyway. Wei

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 19 dic 2011, 03:47 GMT-5
I am also searching desperately for a way to handle history variables like that. Eg for implementing scalar damage models in the weak form mode.

I think everybody could workaround if we could directly access a local variable at the END of the LAST converged timestep....then we could work with some if and comparison operators....but I guess also adressing specific time steps- iin particular the last converged one- is not possible?
I am also searching desperately for a way to handle history variables like that. Eg for implementing scalar damage models in the weak form mode. I think everybody could workaround if we could directly access a local variable at the END of the LAST converged timestep....then we could work with some if and comparison operators....but I guess also adressing specific time steps- iin particular the last converged one- is not possible?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 30 apr 2012, 02:36 GMT-4
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 25 ago 2012, 14:39 GMT-4
Hi,


It would be helpful if you can post an example mph file how you do this within a steady state setting. With time dependent solver, it is easy with the ODE. But with steady state, once the coefficients da and ea are set to zero, it will not work, at least for me.


Thank you,
Suresh





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, It would be helpful if you can post an example mph file how you do this within a steady state setting. With time dependent solver, it is easy with the ODE. But with steady state, once the coefficients da and ea are set to zero, it will not work, at least for me. Thank you, Suresh [QUOTE] 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 29 nov 2012, 05:54 GMT-5
I was advised by COMSOL support to use the following global equation
d(Tmax)/dt = dT/dt*(dT/dt>0)*(T>Tmax)
if you need to find a maximum of variable T in time. It worked well for me.

Regards,
Denis
I was advised by COMSOL support to use the following global equation d(Tmax)/dt = dT/dt*(dT/dt>0)*(T>Tmax) if you need to find a maximum of variable T in time. It worked well for me. Regards, Denis

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.