5
$\begingroup$

Bug introduced in 11.3 and persisting through 12.0


A support case with the identification [CASE:4268618] was created.


I am a bit surprised that I am not getting a boolean output for the following simple Modelica model:

model = ImportString[
    "block Or
        input Boolean u1;
        input Boolean u2;
        output Boolean y;
     equation
        y = (u1 or u2);
     end Or;"
   ,
   "Mo"
];

sim = SystemModelSimulate[ model, {"y"}, {0,1},
    Association[
        "Inputs" -> {
            "u1" -> Function[ t, True ],
            "u2" -> Function[ t, False ]
        }
    ]
];

First @ sim[{"y"}]

Function[ t, 1., Listable ]

So, what is returned is the real output (e.g. Boole[y]). Is this a bug?

$\endgroup$
  • 3
    $\begingroup$ I (as a developer working on system modeling in Wolfram Language) consider it at least an unfortunate behavior. I have reported it in our issue tracker internally. $\endgroup$ – Malte Lenz Jun 10 at 7:42
  • 1
    $\begingroup$ @Malte Great to hear. It indeed makes wiritng VerificationTest in a test notebook (a great feature btw) a bit more opaque. $\endgroup$ – gwr Jun 10 at 10:38
0
$\begingroup$

As Malte Lenz and now officially Wolfram Support have confirmed, this is a bug.

Note, that not only will Boolean outputs be given numerically by SystemModelSimulate, but Boolean inputs also have to be given as 1 or 0 instead of True or False.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.