How to Implement Piecewise Time-Varying Electrode Surface Potential in Comsol?

AI Thread Summary
To impose a linearly varying electrode surface potential over time, a piecewise function can be defined in COMSOL, utilizing boolean operators to handle different time domains. The potential is structured as E(t) = phimin + v*t for 0 <= t < t0 and E(t) = phimax - v*(t - t0) for t0 <= t < 2*t0, where t0 is calculated based on the difference between phimax and phimin divided by the scan rate v. Implementing periodic functions may require the use of the modulo operator within the boolean expressions. The discussion highlights the need for clarity on the type of study being conducted and the physics involved, particularly regarding the transport of diluted species. Overall, understanding how to implement these equations effectively is crucial for the desired simulation outcomes.
Ma94
Messages
3
Reaction score
0
Can anyone know please know how can i impose the electrode surface potential to vary lineary and periodically with time as:
E(t)= phimin+v*t for 0<=t<t0
phimax-v*(t-t0) for t0<=t<2*t0
with t0=(phimax-phimin)/v
v=scan rate in V/s
 
Engineering news on Phys.org
What exactly do you have a problem with? Is it the fact that you have different potentials to impose for different time domains? Or do you have problems imposing even a simple time-dependent potential?

It would also help if you indicated what type of study you are doing (what physics and study type you have selected in COMSOL).
 
Thanks for your reply .As you said first i need to implant 2 différent potenials in the surface of an electrode for 2 different time domains .In fact the reference article that I'm using is a little bit difficult ,they said that the potential is a triangle time dependent so i will use time dependent study , for the physics i will use transport of diluted species and another one that i did'nt figure it out.
 
Ma94 said:
Thanks for your reply .As you said first i need to implant 2 différent potenials in the surface of an electrode for 2 different time domains .
Sorry, but this didn't answer my question. Would you know how to do it with only one time-dependent equation?

I am just trying to gauge the level of the difficulty. Otherwise, my answer might be rather unhelpful.

In any case, to implement piecewise equations, you need to use boolean operators. For instance, to implement
$$
\left\{
\begin{array}{cl}
1 & x < 0 \\
x^2 + 1 & x \ge 0
\end{array}
\right.
$$
you would write
Code:
1 * (x < 0) + (x^2+1) * (x >= 0)
Doing it for periodic functions can be implement using the modulo operator in the boolean expression.
 
Back
Top