Please login with a confirmed email address before reporting spam
Posted:
6 years ago
01.02.2019, 08:21 GMT-5
Did you call your step function correctly, i.e. (for example) c0*step1((t-ts)[1/s])? I have preferred the Heviside function like this:
c0*(1-flc2hs((t-ts)[1/s],0.001))
and I have defined in the parameters list c0 = 0.1[uM] and ts = 24[h].
I got a correct behaviour, except that the both ways are not completely sharp at t = 24h because, due to numerical reasons, the step is somewhat smoothed in the vicinity of the step point.
Another issue is that you must define the function below Component, not under Global definitions.
Did you call your step function correctly, i.e. (for example) c0*step1((t-ts)[1/s])? I have preferred the Heviside function like this:
c0*(1-flc2hs((t-ts)[1/s],0.001))
and I have defined in the parameters list c0 = 0.1[uM] and ts = 24[h].
I got a correct behaviour, except that the both ways are not completely sharp at t = 24h because, due to numerical reasons, the step is somewhat smoothed in the vicinity of the step point.
Another issue is that you must define the function below Component, not under Global definitions.
Jeff Hiller
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
6 years ago
01.02.2019, 08:53 GMT-5
Updated:
6 years ago
01.02.2019, 10:30 GMT-5
A quick comment to say that a little smoothing at the step is recommended indeed. "Perfect" Heaviside steps, such as you'd get from using a boolean expression, can be missed by a transient solver that looks at gradients for signs that it should take smaller time steps. You'll want to use an amount of smoothing that is consistent with the real world transients (Perfect steps are unphysical - in your case a concentration cannot instantaneously change from one value to another). I think I remember there having been discussions about this in this Discussion Forum before, so you may want to do a search on that.
Jeff
-------------------
Jeff Hiller
A quick comment to say that a little smoothing at the step is recommended indeed. "Perfect" Heaviside steps, such as you'd get from using a boolean expression, can be missed by a transient solver that looks at gradients for signs that it should take smaller time steps. You'll want to use an amount of smoothing that is consistent with the real world transients (Perfect steps are unphysical - in your case a concentration cannot instantaneously change from one value to another). I think I remember there having been discussions about this in this Discussion Forum before, so you may want to do a search on that.
Jeff
Please login with a confirmed email address before reporting spam
Posted:
6 years ago
02.02.2019, 21:41 GMT-5
Thank you so much for the replies Lasse and Jeff.
The Heaviside function improved over the step function, Thank you for the suggestion.
I think I was expecting too much: I was expecting a fast and obvious distribution due to backward diffusion as I saw with the forward diffusion (at early time points). Wasn't remembering that the gradient is much smaller after 24 hours since full distribution (same drug conc in all regions) is reached at this moment.
Is there particular reason, to put the function under component instead of global definitions?
Thank you so much for the replies Lasse and Jeff.
The Heaviside function improved over the step function, Thank you for the suggestion.
I think I was expecting too much: I was expecting a fast and obvious distribution due to backward diffusion as I saw with the forward diffusion (at early time points). Wasn't remembering that the gradient is much smaller after 24 hours since full distribution (same drug conc in all regions) is reached at this moment.
Is there particular reason, to put the function under component instead of global definitions?
Please login with a confirmed email address before reporting spam
Posted:
6 years ago
04.02.2019, 03:50 GMT-5
Once I noticed that my model did not recognize the function I defined under Global definitions. I do not know why.
Once I noticed that my model did not recognize the function I defined under Global definitions. I do not know why.