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.
if condition in variable definitions
Posted 12 avr. 2011, 10:36 UTC−4 Parameters, Variables, & Functions Version 4.1 6 Replies
Please login with a confirmed email address before reporting spam
Hi,
I was wondering how to implement if conditions in variable definitions?
For example, if I wanted to define a variable a, and it is based on a condition of b, which has been defined as another variable.
a = 1 if b>0
a = 3 if b<=0
I was wondering how to implement this?
And another situation is, I have already defined a variable M, then another variable depends on M:
c = M^2 + 5 when M<0.5
c = 2*M/(M+1)^2 when M>=0.5
Could anyone please help with this? Thanks a lot in advance!
I was wondering how to implement if conditions in variable definitions?
For example, if I wanted to define a variable a, and it is based on a condition of b, which has been defined as another variable.
a = 1 if b>0
a = 3 if b<=0
I was wondering how to implement this?
And another situation is, I have already defined a variable M, then another variable depends on M:
c = M^2 + 5 when M<0.5
c = 2*M/(M+1)^2 when M>=0.5
Could anyone please help with this? Thanks a lot in advance!
6 Replies Last Post 19 avr. 2011, 10:42 UTC−4