Francesco Casella
Francesco Casella
@kabdelhak you can use this MWE as a reference: ``` model M Real x[2](start = {3, 4}), y, z; algorithm x[2] := y + z; x[2] := 2*x[2]; equation z...
@kabdelhak, I'm not aware of the details of how code generation works when algorithms are involved. I suspect there may be something fishy, but you need to explain to me...
@phannebohm > What about the following model: > > ```modelica > model M > Real x[2](start = {3, 4}), y, z; > algorithm > x[2] := y; > x[2] :=...
I'm not into the details of what the backend currently does with algorithms, but what I understand from these comments is that perhaps it may be trying to get too...
> > I'm not really sure what you mean by "the second assignment is already redundant", but anyway the model is definitely singular. > > Sorry I wasn't clear. I...
> Looks like i was able to fix the FFT regressions: [regression report](https://libraries.openmodelica.org/branches/history/master/2021-09-07%2012:07:54..2021-09-07%2022:55:21.html) Good! > Not quite sure if the speedups are also my merit. They don't hurt, anyway. >...
Some more thoughts about the case of when statements. Simple example case: ``` algorithm when v > 2 then x := y; end when; when v < 4 then x...
Updated version of proposal to handle algorithm sections in the NF - For each when-statement in an algorithm section, auxiliary boolean variable definitions (or arrays in case of multiple conditions)...
> I guess you would also need to pass package constants as inputs. In fact, the function is defined locally in the model, so it "sees" the package constants exactly...
> We have a bunch of general problems when converting algorithms to functions ([Modelica Spec v3.6-dev 12.2 ](https://specification.modelica.org/master/functions.html)): > > > A function cannot contain calls to the Modelica built-in...