In this Knowledge Base Article you will learn how to set conditional statements in Global Parameters using matching syntaxis.
In Simcenter Amesim, you cannot create conditional statements using the If-then(-else) terminology. However, you can use conditions based on Global Parameters values and matching syntax (e.g. x==1 or x!=1).
For example, let's consider setting the solar irradiation value based on the hour of the day:
To achieve this, first define the daytime in hours and then set the conditions based on this time in the irradiance global parameter using the following expression:
(Time<=8 || Time>20)*0 + (Time>8 && Time<=12 || Time>16 && Time<=20)*1000 + (Time>12 && Time<=16)*1500
Now, depending on the daytime you input, the irradiation will be set based on the rules defined in the expression above:
Day time: 6 hours
Day time: 10 hours
Day time: 14 hours