Code Monkey home page Code Monkey logo

Comments (9)

bernhard-thiele avatar bernhard-thiele commented on August 29, 2024

I don't think that the auto propagation logic is wrong, but I agree that it is contrived. The external object is propagated through causal connectors, so the first block (that which doesn't have an input) needs to construct the external object. The problem is that we need to know the required size of the buffer when constructing it. For this an initial equations system is used which determines the buffer size.

I just tested the fix that you proposed pkgOut(pkg = SerialPackager(bufferSize)) with Dymola 2015 and it worked.

Regarding the specification I'm not so dead sure how to interpret it. If one is not allowed to "assign" to external objects, then even the constructor can't assign to it? Isn't assignment used in the MLS in the sense of algorithmic assignment while otherwise we talk from binding equations, e.g., MLS 3.3 Section 3.8: "For an assignment v:=expr or binding equation v=expr, v must be declared to be at least as variable as expr."?

Anyway, I don't like the complex propagation stuff myself so much and thought about adding an alternative simpler packaging system but never did it.

Are you aware that there is already an option to use a fixed buffer size? You can set parameter useBackwardPropagatedBufferSize = false and thus enable parameter userBufferSize. Did you try this as a workaround?

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

Quick answer: Please read again: External objects can only be bound in component declarations. Assigments in equation or algorithm sections are not legal.

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

Longer answer: I changed the constuction of all external object instances to component declarations (as suggested above). This way SimulationX finally was able to successfully finish the symbolic analysis, i.e. resulted in a runnable simulation model. The problem then was that the buffer size was zero and hence adding the first data to the package failed (with ModelicaError). I did not yet switch the useBackwardPropagatedBufferSize parameter to false. I will try it next week.

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

Please test my proposed changes and pull them if you want.

from modelica_devicedrivers.

bernhard-thiele avatar bernhard-thiele commented on August 29, 2024

Merged your branch in a42cb1b

I can't test it in the moment in Dymola due to our license being use by somebody else, but it looks good...

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

Thanks for merging. Please do test once you have the license.

from modelica_devicedrivers.

bernhard-thiele avatar bernhard-thiele commented on August 29, 2024

Just tested it and it worked fine.

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

I tested all the SerialPackager example models in SimulationX: They work as expected provided that external solvers (i.e. CVODE Method or Fixed Step Solver) are selected. 😌 Currently it does not work if internal solvers ((ME)BDF) are chosen but this is left up to the SimulationX developers.
solverseetingscvode
I'll close this issues though only the second issue is fixed (from SimulationX side). I still cannot say that MDD is standard conform. I rather recommend it to remove from github description.

from modelica_devicedrivers.

tbeu avatar tbeu commented on August 29, 2024

See https://trac.modelica.org/Modelica/ticket/1669 and https://trac.modelica.org/Modelica/ticket/1705 for related issues on external objects.

from modelica_devicedrivers.

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.