Please login with a confirmed email address before reporting spam
You could define a function with nested if statements as shown in the attached image. Note that you will need to add the appropriate units for the function and the argument as shown in the highlighted fields in the attached image. (your argument unit would be s, and your function unit would be whatever the unit of Q are... Joules from memory).
I am not sure how well Comsol will handle instantaneous changes in source values, as it seems to me this would be highly non-linear and would not converge. In which case you could create a function using the rectangular function to introduce smooth transitions between values. Your final analytical function would then just sum the contributing rectangular functions. You would need to ensure your time step in your study can resolve the transition zones sufficiently.
In the attached image I have set Q1= 0.75 and Q2 =1.3 within the global parameters.
The core of the function is
if((x>lowerlimit)*(x<=upperlimit),valueiftrue,valueiffalse)
the value if false is then a second if statement of the same form, and so on. The "*" in the formula is equivilent to the AND statement.
However, for model stability I suspect you will need to use a sequence of rectangular functions with smoothing, which themselves could contain IF statements to meet your needs.
You could define a function with nested if statements as shown in the attached image. Note that you will need to add the appropriate units for the function and the argument as shown in the highlighted fields in the attached image. (your argument unit would be s, and your function unit would be whatever the unit of Q are... Joules from memory).
I am not sure how well Comsol will handle instantaneous changes in source values, as it seems to me this would be highly non-linear and would not converge. In which case you could create a function using the rectangular function to introduce smooth transitions between values. Your final analytical function would then just sum the contributing rectangular functions. You would need to ensure your time step in your study can resolve the transition zones sufficiently.
In the attached image I have set Q1= 0.75 and Q2 =1.3 within the global parameters.
The core of the function is
*if((x>lowerlimit)\*(x