Skip to content

Model with units defined in a component don't get properly converted #4

@agarny

Description

@agarny

This model describes the following model:

def model van_der_pol_model_1928 as
    def comp main as
        def unit per_second as
            unit second {expo: -1};
        enddef;

        var time: second;
        var x: dimensionless {init: -2};
        var y: dimensionless {init: 0};
        var epsilon: dimensionless {init: 1};

        ode(x, time) = y*1{per_second};
        ode(y, time) = (epsilon*(1{dimensionless}-sqr(x))*y-x)*1{per_second};
    enddef;
enddef;

As we can see, per_second is defined within the main component. If you convert this model to CellML 2.0 using cellml1to2.xsl, you end up with this model, which also defines per_second in the main component. However, CellML 2.0 only allows units to be defined in the model element (see section 8 of https://www.cellml.org/specifications/cellml_2.0). So, here, we end up with an invalid CellML 2.0 file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions