-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all,
when testing the example code for #588 with omc 1.7.0, the index
expressions were rejected as invalid.
So to answer the question, if omc would only allow constant expressions
as indices, I used the following submodel:
class ArrayTest
Integer j;
Real[3] x;
equation
for i in 0:2 loop
x[i*j + 1] = (time + i);
end for;
j = if (time < 0.5) then 1 else 0;
end ArrayTest;
(as a sidenote: omc fails to simulate the same model with Real[2] x
because of an division by zero error - seems to be another bug)
The outcome after time >= 0.5 is obviously undefined (and thus can never
be a bug ;)), but what happens before is quite interesting. x[1] behaves
as it should, but x[2] and x[3] diverge completely.
- --
Christoph Höger
Technische Universität Berlin
Fakultät IV - Elektrotechnik und Informatik
Übersetzerbau und Programmiersprachen
Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin
Tel.: +49 (30) 314-24890
E-Mail: [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAk4S0r0ACgkQhMBO4cVSGS/AVQCaAz0y4q+QE+i9yIU98Kn97rR1
KYYAnRDVecEzUPu6UZbKacjvJ8tz3uhK
=KI4u
-----END PGP SIGNATURE-----
<<attachment: unknown_references.png>>
unknown_references.png.sig
Description: PGP signature
