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.

Change a function during a time simulation

Please login with a confirmed email address before reporting spam

Hi everybody,
I have a 2D Comsol model in that there are 4 functions interpolation (Global definition>Interpolation); each interpolation is a temperature field such as T=T(x,y)
My model is a time dependent study; till now I have used this model with one by one Temperature field T(x,y), over the entire range of time, but now I should simulate a real work (so, with the lowest temperature field initially, and after with the highest temp. field, and in conclusion again with the lowest, for instance).
I make an example to be more clear: if I have T1(x,y) and T2(x,y), and the time of my simulation is 0:1:24 h, I would create a work condition with T1 for 5h, then a linear increase from T1->T2 for 1h, afterward T2 for 5h etc.
I tried to use "Definitions>Piecewise", but I have an error, I think because it is needed in the "function" (in Piecewise) a constant value*argument; so, each T=T(x,y) is time indipendent, but it is not a value, but a function in (x,y).
And, if you suggest me to use this Piecewise, which is the name of the time used by the time dependent study (or rather, the name of the "argument" in Piecewise)?
I hope I was clear

Thank you in advance

Fabio

1 Reply Last Post 27 gen 2012, 10:28 GMT-5
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 27 gen 2012, 10:28 GMT-5
Hi

if you enter your T1(x,y) as a grid in Interpolation with the "Use space coordinates as arguments", you can refer to it as simply T1 (provided that a domain election defines some default x,y, coordinates)

then you can use an analytical function to combine the T1 T2 and "t" variable to get the call for the different time domains (via bolean operators on "t", or an if()). But note you cannot plot the analytical function if using the "Use space coordinates" for the Interpolation function, then you must use a T1(x,y) and add all three corrdinates in the analytical arguments

But I believe piecevise is only made for a single argument, not two. But still to combine your two interpolations (with the Use space corrdinates on should work, only you cannot plot it in the function definition window, only in a derived variable postprocessing, hence you must finish your model an at least solve it to the "derived variables" hence to load initial values

(hope I'm clear with these explanations ;)

--
Good luck
Ivar
Hi if you enter your T1(x,y) as a grid in Interpolation with the "Use space coordinates as arguments", you can refer to it as simply T1 (provided that a domain election defines some default x,y, coordinates) then you can use an analytical function to combine the T1 T2 and "t" variable to get the call for the different time domains (via bolean operators on "t", or an if()). But note you cannot plot the analytical function if using the "Use space coordinates" for the Interpolation function, then you must use a T1(x,y) and add all three corrdinates in the analytical arguments But I believe piecevise is only made for a single argument, not two. But still to combine your two interpolations (with the Use space corrdinates on should work, only you cannot plot it in the function definition window, only in a derived variable postprocessing, hence you must finish your model an at least solve it to the "derived variables" hence to load initial values (hope I'm clear with these explanations ;) -- Good luck Ivar

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.