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.
Piecewise Function with Multiple Arguments
Posted Sep 6, 2016, 7:29 p.m. EDT Heat Transfer & Phase Change, Materials Version 4.4 0 Replies
Please login with a confirmed email address before reporting spam
For example, let's say I pass 3 variables/arguments (x,y,z) to a piecewise function named PW.
NOTE: x,y,z are not spatial coordinates.
I would like to set some variable (VAR) equal to PW(x,y,z).
PW would work as follows.
For the range 0<x<1 I want the function PW(x,y,z) = 2*y
For the range 1<x<2 I want the function PW(x,y,z) = 3*z
For the range 2<x<inf I want the function PW(x,y,z) = y + z
This is basically the same idea as an if/then statement.
Furthermore, I would really like to have the "functions" above be calls to other functions.
For example, again there are 3 variables/arguments (x,y,z).
For the range 0<x<1 I want the function PW(x,y,z) = g(x)
For the range 1<x<2 I want the function PW(x,y,z) = h(y)
For the range 2<x<inf I want the function PW(x,y,z) = j(y,z)
Where g(),h(), and j() are already defined analytical functions.
So, PW doesn't even actually have to use the arguments y and z, but does need to pass them on to other functions.
Any advice?
Thanks,
Bryan
Hello Bryan Burk
Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.
If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.