Introduction
This article cover the conditional expressions IF, IF-OR and IF-AND.
With the expression language available on platform, the user can build conditional IF-statements through logical expressions based on True (1) or False (0). As an example, we will look at a double-disc model with a spacially-varying pressure as a function of the radius:
$$
P = 1000 \cdot r^2 = 1000 \cdot (x^2 + y^2) Pa
$$
The pressure expression can be easily implemented in SimScale using the expression option in the Pressure Boundary Condition pop-up window
IF-Statement
Now, an IF-statement can be implemented if we wish to apply the pressure distribution at a specific portion of disc. As an example, the pressure will be applied only when the radius is larger then 0.0375m. The required expression is
1000*sqrt(x^2 + y^2)*(sqrt(x^2 + y^2)>0.0375)
where the if-condition is represented in the logical expression
(sqrt(x^2 + y^2)>0.0375)
In SimScale, the implementation of the expression follows the same idea depicted in Figure 3. Considering the aforementioned if-statement, we obtain the following:

IF with AND-Statement
We can include the AND-logic to the IF-Statement from above by multiplying two logical expressions. Considering the radius larger than 0.0375m AND lower than 0.05m, we need the following expression:
1000*sqrt(x^2 + y^2)*(sqrt(x^2 + y^2)>0.0375)*(sqrt(x^2 + y^2)<0.05)
where the if with and-condition is represented in the logical expression:
(sqrt(x^2 + y^2)>0.0375)*(sqrt(x^2 + y^2)<0.05)
In the platform, this pressure distribution implementation and its corresponding Von-Mises stress distribution on the disc are depicted as follows:

IF with OR-Statement
Following the same idea of the previous conditional statement, the OR-Statement is implemented by an addition (+) operation. Considering a pressure distribution applied if the radius is smaller than 0.0375m OR larger than 0.05m, the expression is as follows:
1000*sqrt(x^2 + y^2)*(sqrt(x^2 + y^2)<0.0375) + 1000*sqrt(x^2 + y^2)*(sqrt(x^2 + y^2)>0.05)
with the or-condition represented with the following logical expression
+ 1000*sqrt(x^2 + y^2)*(sqrt(x^2 + y^2)>0.05)
In SimScale, this pressure distribution implementation and its corresponding Von-Mises stress distribution on the disc are depicted as follows:

IF with AND-Statement with Spatial and Temporal Dependency
In the case of nonlinear or dynamic simulations, might also be helpful to couple spatial with time-dependent statements. We look at an example where the pressure distribution is applied for a radius between 0.0375 and 0.05m AND for the a time interval from 0.3 to 0.7s. In this case, the expression is defined as:
1000*sqrt(x^2+y^2)*(sqrt(x^2+y^2)>0.0375)*(sqrt(x^2+y^2)<0.05)*(t>=0.3)*(t<=0.7)
where the AND time-dependent logical expression is accounted for in the for in the follow portion
*(t>=0.3)*(t<=0.7)
In SimScale, the spatial- and time-dependent pressure distribution is implemented as follows:
The expression from Figure 8 produced the following Von-Mises stress distribution over time:





