Giter VIP home page Giter VIP logo

Comments (4)

t-sommer avatar t-sommer commented on August 23, 2024

@nickbattle, can you propose a fix?

from reference-fmus.

nickbattle avatar nickbattle commented on August 23, 2024

@t-sommer I can propose arbitrary changes that will pass validation, but these are reference FMUs which presumably are intended to work in a particular way, so I think the FMU authors really ought to decide what the correct settings should be.

In the Resource/FMI2.xml case, the variable "y" is invalid because its "initial" clause defaults to "calculated" and you cannot have a "start" value if a variable is calculated. So one solution would be to remove the start clause. Or you could define a different "initial" setting. I don't know the intent of the model, so I can't guess which is appropriate.

Fixing the "InitialUnknowns" just means adding a InitialUnknowns section to the ModelStructure that is the same as the Outputs section. Though if you change the initial value of "y", you don't have to include it in the InitialUnknowns (only "approx" or "calculated" outputs are needed in InitialUnknowns).

The fix for Stair/FMI2.xml is easier. From the name "counter", I assume it is discrete rather than continuous, and therefore should have a variability of "discrete" rather than the default, which is "continuous".

If someone can indicate which changes are appropriate, I can re-validate them.

from reference-fmus.

t-sommer avatar t-sommer commented on August 23, 2024

therefore should have a variability of "discrete" rather than the default, which is "continuous"

The FMI 2.0.1 Spec is ambiguous here:

on page 48 it says:

(a) Only a variable of type = “Real” can be “continuous”. [...] (b) The default is “continuous”.

IMHO the (b) takes precedence over (a).

In FMI 3.0 this has been clarified:

The default is continuous for variables of type <Float32> and <Float64>, and discrete for all other types.

from reference-fmus.

nickbattle avatar nickbattle commented on August 23, 2024

Yes, I agree, otherwise we do not know the variability of non-Reals without explicit variabilities. The formal model always regards ScalarVariables with a missing variability as "continuous". In the case of your PR, that causes another error, because the type is now "Integer" which cannot be "continuous". It needs a variability clause to say the variable is "discrete".

As you say, this is clarified in FMI3 and the formal model therefore implements this and your PR changes for the FMI3.xml are accepted (though the InitialUnknowns issue remains in both).

from reference-fmus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.