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.

minimum time value under condition

Please login with a confirmed email address before reporting spam

Hi

I have a problem on my simulation
I have a time dependent simulation and I want to get the minimum time value when a phenomena occur ( The voltage V raise a value above a certain threshlod)

I want to get the time when the phenomena occur and I want it to be settle because I will use it in the simulation

I use a max and min function like this
max((V>threshlod)*min(t))
the minimum give the value when the phenomena occur and the max avoid that the final is equal to 0
But the max and min are function definied in domain and NOT GLOBALLY that means that max and min are looked in the model regarding the value computed before in the simulation

At the end I juste want the variable give me 0 before V<threshold and the minimal time value after V>threshold and this value has to stay constant

Thanks a lot
Guillaume

4 Replies Last Post 24 mar 2013, 10:20 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 20 mar 2013, 02:55 GMT-4
Hi

I'm not giving you the solution, but V is a field (V,x,y,z,t) so you need to define where it is evaluated, or you apply the max function it over a domain / boundary, but then do not forget that max and min are functions that really take time to evaluate so your solver will advance very slowly ;)

t looks like you want to model an active "controller", check the model library there are some examples where this is illustrated

--
Good luck
Ivar
Hi I'm not giving you the solution, but V is a field (V,x,y,z,t) so you need to define where it is evaluated, or you apply the max function it over a domain / boundary, but then do not forget that max and min are functions that really take time to evaluate so your solver will advance very slowly ;) t looks like you want to model an active "controller", check the model library there are some examples where this is illustrated -- Good luck Ivar

Andrea Ferrario COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 20 mar 2013, 09:22 GMT-4
Dear Guillaume,

If you want your physics to "keep memory" of the event (the fulfilling of your condition), you will need an additional dependent variable (or state), whose value is changed when the event occurs. You can use the Events interface (under Mathematics -> ODE and DAE interfaces) for this. Add a Discrete state that will change value after the event occurs and define your condition as an Implicit event. You will also need an indicator state that keeps track of the value of your global variable. Refer to the documentation for the Events interface for more information.

--
Andrea Ferrario
Electromagnetics Group
COMSOL AB
Dear Guillaume, If you want your physics to "keep memory" of the event (the fulfilling of your condition), you will need an additional dependent variable (or state), whose value is changed when the event occurs. You can use the Events interface (under Mathematics -> ODE and DAE interfaces) for this. Add a Discrete state that will change value after the event occurs and define your condition as an Implicit event. You will also need an indicator state that keeps track of the value of your global variable. Refer to the documentation for the Events interface for more information. -- Andrea Ferrario Electromagnetics Group COMSOL AB

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 20 mar 2013, 09:47 GMT-4
First thanks you for this answers


@Ivar: I have the voltage, there is no problem about that, I just wanted to create a variable which is 0 when my voltage is under the value and 1 when the voltage reached the threshold value and stay at 1 no matter what happens to the voltage ( I am removing the energy stored in my coil)

@Andrea: I will try what you say,

Guillaume
First thanks you for this answers @Ivar: I have the voltage, there is no problem about that, I just wanted to create a variable which is 0 when my voltage is under the value and 1 when the voltage reached the threshold value and stay at 1 no matter what happens to the voltage ( I am removing the energy stored in my coil) @Andrea: I will try what you say, Guillaume

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 24 mar 2013, 10:20 GMT-4
Hello
I finally found how to do it (tanks the support)
I am using a if probe with a if condition and I integrate the probe with a global equation
When the voltage cross the threshold value; my integration function is set at a value different from zero and this
is the trigger for the discharge of my coil
Thanks
Guillaume
Hello I finally found how to do it (tanks the support) I am using a if probe with a if condition and I integrate the probe with a global equation When the voltage cross the threshold value; my integration function is set at a value different from zero and this is the trigger for the discharge of my coil Thanks Guillaume

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.