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.

Reset dependent variable to initial values during execution

Please login with a confirmed email address before reporting spam

Hello COMSOL community,

Attached is a bidomain model representing heart tissue that we are developing. After every 6s of execution I need to reset the dependent variables to their initial values. Is that possible in COMSOL? If so how?

Specifically in the attached model, I need to reset the value of Vm, a dependent variable in the Bidomain model PDE to its initial value every 6s.

Thanks
Deepika


8 Replies Last Post 2012年5月9日 GMT-4 17:36

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年5月9日 GMT-4 12:58
Dear COMSOL users,

I'd greatly appreciate if one of you can tell me if there is a means to reset dependent variable values forcibly in the middle of solving pdes.

Thanks
Deepika
Dear COMSOL users, I'd greatly appreciate if one of you can tell me if there is a means to reset dependent variable values forcibly in the middle of solving pdes. Thanks Deepika

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 2012年5月9日 GMT-4 13:18
Hi

what do you mean by "reset initial conditions", you can do a sweep depending on a parameter or add a parametric sweep and restart your simulation from your initial conditions, including remeshing (see the doc), or you can have "oscilaltory BC's that goes back to given values at a given time (needs often to tweak somewhat the solver settings but it works mostly nicely) ...

--
Good luck
Ivar
Hi what do you mean by "reset initial conditions", you can do a sweep depending on a parameter or add a parametric sweep and restart your simulation from your initial conditions, including remeshing (see the doc), or you can have "oscilaltory BC's that goes back to given values at a given time (needs often to tweak somewhat the solver settings but it works mostly nicely) ... -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年5月9日 GMT-4 13:25
Dear Ivar,

Thanks for your reply...

Here's what I want to do:

After every 6s of execution of the bidomain PDE equations I need to set the value of Vm, a dependent variable to its initial value and continue execution. Here I need to set the value of Vm over a part of the domain as in the initial value expression:

if((x>0)*(y>0), Vfire, Vrest)

I sincerely appreciate your help.

Thanks
Deepika
Dear Ivar, Thanks for your reply... Here's what I want to do: After every 6s of execution of the bidomain PDE equations I need to set the value of Vm, a dependent variable to its initial value and continue execution. Here I need to set the value of Vm over a part of the domain as in the initial value expression: if((x>0)*(y>0), Vfire, Vrest) I sincerely appreciate your help. Thanks Deepika

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年5月9日 GMT-4 13:43
I checked what Parameter Sweep can do...and realized the parametric sweep can only change values of parameters. Here I want to change the value of the dependent variable in the middle of execution manually...Is there a way to do it in COMSOL?

Thanks
Deepika
I checked what Parameter Sweep can do...and realized the parametric sweep can only change values of parameters. Here I want to change the value of the dependent variable in the middle of execution manually...Is there a way to do it in COMSOL? Thanks Deepika

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 2012年5月9日 GMT-4 15:07
Hi

I do not believe it's correct to act directly on the dependent variables, since these are the responses/solutions of your physics laws and the BC+initial conditions. You must act on the BC to get the solution to "reset" the dependent variables.

Or you start and stop your model, and redefine new initial conditions, also fully or partially using last solver time as new initial conditions.

The parameter sweep indeed changes parameters, but these parameters can drive BC values

--
Good luck
Ivar
Hi I do not believe it's correct to act directly on the dependent variables, since these are the responses/solutions of your physics laws and the BC+initial conditions. You must act on the BC to get the solution to "reset" the dependent variables. Or you start and stop your model, and redefine new initial conditions, also fully or partially using last solver time as new initial conditions. The parameter sweep indeed changes parameters, but these parameters can drive BC values -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年5月9日 GMT-4 15:56
Thanks for your response...

I am trying to simulate a continuous phenomenon in cardiac electrophysiology where the heart tissue is reset to the same initial condition at the end of every ecg cycle...hence at the end of every cycle unless I reset the value of the dependent variable to that of the initial values the cycle will not repeat...It occurs once and then stops..

Is there any way to do this continuously without having to stop and start execution where I can preset the values of dependent variables at specific times and this override the values from the solver?

Thanks
Deepika
Thanks for your response... I am trying to simulate a continuous phenomenon in cardiac electrophysiology where the heart tissue is reset to the same initial condition at the end of every ecg cycle...hence at the end of every cycle unless I reset the value of the dependent variable to that of the initial values the cycle will not repeat...It occurs once and then stops.. Is there any way to do this continuously without having to stop and start execution where I can preset the values of dependent variables at specific times and this override the values from the solver? Thanks Deepika

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 2012年5月9日 GMT-4 17:11
Hi
I see only some cleverway with a parametric sweep, but something must change from restart to restart, otherwise you are just repeating N times the same simulation, or have I missed something ?

--
Good luck
Ivar
Hi I see only some cleverway with a parametric sweep, but something must change from restart to restart, otherwise you are just repeating N times the same simulation, or have I missed something ? -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年5月9日 GMT-4 17:36
Thanks for your suggestion Ivar.

We want to be able to simulate N similar simulations imitating normal heart activity and then introduce a parameter that will trigger a different response simulating atrial fibrillation (AF). I was planning on using the parameter sweep to trigger AF but will have to figure out a way to simulate continuous cycles of normal heart rhythm first.
Thanks for your suggestion Ivar. We want to be able to simulate N similar simulations imitating normal heart activity and then introduce a parameter that will trigger a different response simulating atrial fibrillation (AF). I was planning on using the parameter sweep to trigger AF but will have to figure out a way to simulate continuous cycles of normal heart rhythm first.

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.