Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change of fmiGetDerivatives/fmiSetContinuousStates/fmiGetContinuousStates for QSS #243

Open
modelica-trac-importer opened this issue Oct 16, 2018 · 14 comments
Labels
enhancement New feature or request
Milestone

Comments

@modelica-trac-importer
Copy link

Reported by tsnouidui on 30 Apr 2014 18:21 UTC
Hi all,

I am developping a master algorithm for FMUs for model-exchange which use the Quantized State Systems (QSS) integration methods for time integration. For this master algorithm to fully utilize the capability of these integration methods, it will be good if it is possible to retrieve single derivative of FMUs.

My question:
Why is it not possible similar to fmiGetReal() to provide fmiGetDerivatives() with the value reference of the derivative which should be retrieved/computed? My guess is that, the current specification is designed for traditional integration methods which work on the whole state vector at every integration step. This assumption is not valid for QSS methods.

The change will also imply the capability to support the setting/getting of individuals continuous states. This will require to provide fmiSetContinuousStates/fmiGetContinuousStates with the value references of the states that need to be set/get?

Thanks!

Thierry


Migrated-From: https://trac.fmi-standard.org/ticket/243

@modelica-trac-importer
Copy link
Author

Comment by karl.wernersson on 23 May 2014 16:49 UTC
Hi

In ModelStructure in the xmlFile all state derivatives are defined and an index is given to the scalar variable for each derivative. From there you would get the valueReference used to call fmi2GetReal to collect a single derivative.

calling fmi2SetReal on a single state is planed to be supported for fmi 2.1

/Karl Wernersson

@modelica-trac-importer
Copy link
Author

Comment by tsnouidui on 23 May 2014 18:09 UTC
Thanks!
Thierry

@modelica-trac-importer
Copy link
Author

Modified by otter on 30 May 2014 07:10 UTC

@modelica-trac-importer
Copy link
Author

Comment by torstenblochwitz on 10 Feb 2015 12:59 UTC
According to table Table 1: Mathematical description of an FMU for Model Exchange it is already allowed to set continuous states via fmi2SetReal.

According to Figure 6: Calling sequence of Model Exchange C functions.

We have to check the rest of the specification for consistency and decide which is the expected behavior.

@modelica-trac-importer modelica-trac-importer added P: blocker bug Something isn't working and removed P: major enhancement New feature or request labels Oct 16, 2018
@modelica-trac-importer
Copy link
Author

Comment by anonymous on 10 Feb 2015 22:59 UTC
Page 79 of the FMI specification 2.0 says:

fmi2Status fmi2SetXXX(..)
Set new Values for (independent) parameters, start values and inputs and re-initialize caching of variables that depend on these variables...

I believe that continuous states do not fall under any of these categories.

Thanks!
Thierry

@modelica-trac-importer
Copy link
Author

Modified by tsnouidui on 4 Aug 2015 17:27 UTC

@modelica-trac-importer
Copy link
Author

Comment by fcasella on 19 Sep 2015 09:54 UTC
Myself and Federico Bergero are working on a prototype extension of FMI implemented in the OpenModelica compiler, to support QSS (including higher-order versions of it) and multi-rate algorithms. We attach some early thoughts on the topic to this ticket.

The idea is that we need:

  • function to trigger the partial computation of state derivatives (and of their
    directional derivatives), see also my paper Efficient Computation of State Derivatives
    for Multi-Rate Integration of Object-Oriented Models, MATHMOD 2015, for some ideas
    regarding the implementation
  • functions to compute additional information required by QSS algorithm, e.g.,
    the partial derivative w.r.t. time of the state derivative functions

We'll keep you posted about the progress.

@modelica-trac-importer
Copy link
Author

Comment by fedebergero on 24 Sep 2015 13:20 UTC
Hi Thierry, as Francesco mentioned we are working on how to include QSS methods in OpenModelica and one possible way is through FMI.

We have sketched the attached document and as you mentioned we need way to set some particular state variables and compute some other state derivatives. On the attach there is no prototype function for getting the higher order derivatives yet (needed for QSS2 / 3 / 4).

When it comes to events much more is needed from an FMU, but on this stage we are just focusing on continuous systems.

To resume, we should join forces on this matter!

Fede

@modelica-trac-importer
Copy link
Author

Comment by tsnouidui on 6 Oct 2015 17:23 UTC
Hi Fede,

I read the attachment and we should indeed join force here.

Thierry

@modelica-trac-importer
Copy link
Author

Comment by torstenblochwitz on 15 Dec 2015 09:02 UTC
Discussion at the Meeting at DLR in December 2015 (in context with the discussions about discrete states): In a maintenance release (FMI 2.0.1) we should not change the semantics. We should Keep the Definition of allowed functions calls according to figure 6. So this might be a change request for a minor relese (e.g. 2.1).

@modelica-trac-importer
Copy link
Author

Comment by cbertsch on 1 Jun 2018 13:06 UTC
This does not seem to be covered by any of the working groups currently.
If a simple solution can be found, it could be considered for 3.0, otherwise at a later time.

@modelica-trac-importer
Copy link
Author

Comment by cbertsch on 11 Jun 2018 09:52 UTC
FCP Alignment Meeting: not foreseen for FMI 3.0

@modelica-trac-importer
Copy link
Author

Modified by cbertsch on 18 Jun 2018 10:13 UTC

@t-sommer t-sommer removed the P: major label Mar 9, 2019
@chrbertsch chrbertsch added enhancement New feature or request and removed bug Something isn't working labels May 1, 2020
@t-sommer
Copy link
Collaborator

t-sommer commented Apr 3, 2021

Would this be solved by implementing higher order derivatives as proposed in #372?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants