Changes between Version 1 and Version 2 of Ticket #4055, comment 18
- Timestamp:
- 2018-12-22T09:10:40Z (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #4055, comment 18
v1 v2 1 1 ''As a general rule, I would only use algorithms in models for when clauses. In all other cases, encapsulating the algorithm in a function is usually a good practice. IMHO, it also makes the model better understood, I find algorithms in models fishy, unless they involve discrete variables.'' 2 2 3 I rarely use algorithms outside functions. I built this piece of code after having tried several other methods to construct an array of Complex numbers, and having found several barriers in OM. When you enter the logic of workarounds, you try all possible ways.3 I rarely use algorithms outside functions. I built this piece of code after having tried several other methods to construct an array of Complex numbers, and having found several barriers in OM. Check for instance ticket #4611, which has an approach similar to the snippet in Comment:17, but does not work. 4 4 5 5 I did read in the specification that … … 7 7 ''every algorithm section with N different left-hand side variables, is treated as an atomic N-dimensional vector-equation containing all variables appearing in the algorithm section'' 8 8 9 and this for me justified my approach.9 and this for me justified to try this ticket's approach. I also checked with Dymola and my snippet is fine there. 10 10 11 Frankly I did not envisage that moving the algorithm into a function body could change things. I also checked with Dymola and my snippet is fine there. 12 13 At least you did find a working way to construct an array of Complex's! 11 At least you did find a working way to construct an array of Complex's, that overcomes the difficulties here and in #4611!