Changes between Version 1 and Version 2 of Ticket #4055, comment 18


Ignore:
Timestamp:
2018-12-22T09:10:40Z (6 years ago)
Author:
massimo ceraolo

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4055, comment 18

    v1 v2  
    11''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.''
    22
    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.
     3I 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.
    44
    55I did read in the specification that
     
    77''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''
    88
    9 and this for me justified my approach.
     9and this for me justified to try this ticket's approach. I also checked with Dymola and my snippet is fine there.
    1010
    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!
     11At least you did find a working way to construct an array of Complex's, that overcomes the difficulties here and in #4611!