Let's say I have vectors
Real x[5]={1,2,3,4,5};
and
Real y[5]={0,0,0,0,0};
I want to assign values to elements of y given some condition on x, say for example, for every element in x greater than or equal to 3, corresponding y should be set to 1, for every x<3: y=sin(x)
In matlab, I would have written as follows:
y(x>=3)=1;
y(x<3)=sin(x(x<3));
so
x=[1 2 3 4 5]
Results in
y=[sin(1) sin(2) 1 1 1]
Can something similar be done in Modelica, and if so, how?