Skip to content

Issue with boolean conditions #102

@casella

Description

@casella

Please check the Modelica.Electrical.Batteries.Examples.SuperCapDischargeCharge.bmo model. The results of the MTK simulation do not match the reference results of the Modelica model.

The DAEs of the equation are mostly linear, so they shouldn't be a problem. As I understand, the only potentially problematic equations are:

    'pulseSeries.on1' = sum(if time >= ({10.0, 30.0, 50.0, 70.0, 90.0})[(1:5)['i']] and time < ({10.0, 30.0, 50.0, 70.0, 90.0})[(1:5)['i']] + 10.0 then 1 else 0 for 'i' in 1:size({time >= ({10.0, 30.0, 50.0, 70.0, 90.0})['k'] and time < ({10.0, 30.0, 50.0, 70.0, 90.0})['k'] + 10.0 for 'k' in 1:5}, 1)) == 1;
    'pulseSeries.on2' = sum(if time >= ({120.0, 140.0, 160.0, 180.0, 200.0})[(1:5)['i']] and time < ({120.0, 140.0, 160.0, 180.0, 200.0})[(1:5)['i']] + 10.0 then 1 else 0 for 'i' in 1:size({time >= ({120.0, 140.0, 160.0, 180.0, 200.0})['k'] and time < ({120.0, 140.0, 160.0, 180.0, 200.0})['k'] + 10.0 for 'k' in 1:5}, 1)) == 1;
    'pulseSeries.y' = if 'pulseSeries.on1' then 1.0 else if 'pulseSeries.on2' then -1.0 else 0.0;

BaseModelica.jl parses them and even simulates them, but apparently not with the right semantics. Can you please double-check? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions