{"action":"created","issue":{"url":"https://api.github.com/repos/tbeu/fmi-standard/issues/144","repository_url":"https://api.github.com/repos/tbeu/fmi-standard","labels_url":"https://api.github.com/repos/tbeu/fmi-standard/issues/144/labels{/name}","comments_url":"https://api.github.com/repos/tbeu/fmi-standard/issues/144/comments","events_url":"https://api.github.com/repos/tbeu/fmi-standard/issues/144/events","html_url":"https://github.com/tbeu/fmi-standard/issues/144","id":358288847,"node_id":"MDU6SXNzdWUzNTgyODg4NDc=","number":144,"title":"Handling Constraints in ModelExchange","user":{"login":"modelica-trac-importer","id":22202507,"node_id":"MDQ6VXNlcjIyMjAyNTA3","avatar_url":"https://avatars1.githubusercontent.com/u/22202507?v=4","gravatar_id":"","url":"https://api.github.com/users/modelica-trac-importer","html_url":"https://github.com/modelica-trac-importer","followers_url":"https://api.github.com/users/modelica-trac-importer/followers","following_url":"https://api.github.com/users/modelica-trac-importer/following{/other_user}","gists_url":"https://api.github.com/users/modelica-trac-importer/gists{/gist_id}","starred_url":"https://api.github.com/users/modelica-trac-importer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modelica-trac-importer/subscriptions","organizations_url":"https://api.github.com/users/modelica-trac-importer/orgs","repos_url":"https://api.github.com/users/modelica-trac-importer/repos","events_url":"https://api.github.com/users/modelica-trac-importer/events{/privacy}","received_events_url":"https://api.github.com/users/modelica-trac-importer/received_events","type":"User","site_admin":false},"labels":[{"id":1049839717,"node_id":"MDU6TGFiZWwxMDQ5ODM5NzE3","url":"https://api.github.com/repos/tbeu/fmi-standard/labels/P:%20major","name":"P: major","color":"f6f6f6","default":false},{"id":1049834783,"node_id":"MDU6TGFiZWwxMDQ5ODM0Nzgz","url":"https://api.github.com/repos/tbeu/fmi-standard/labels/bug","name":"bug","color":"d73a4a","default":true},{"id":1049838915,"node_id":"MDU6TGFiZWwxMDQ5ODM4OTE1","url":"https://api.github.com/repos/tbeu/fmi-standard/labels/specification","name":"specification","color":"0000aa","default":false}],"state":"open","locked":false,"assignee":{"login":"tbeu","id":5444067,"node_id":"MDQ6VXNlcjU0NDQwNjc=","avatar_url":"https://avatars0.githubusercontent.com/u/5444067?v=4","gravatar_id":"","url":"https://api.github.com/users/tbeu","html_url":"https://github.com/tbeu","followers_url":"https://api.github.com/users/tbeu/followers","following_url":"https://api.github.com/users/tbeu/following{/other_user}","gists_url":"https://api.github.com/users/tbeu/gists{/gist_id}","starred_url":"https://api.github.com/users/tbeu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbeu/subscriptions","organizations_url":"https://api.github.com/users/tbeu/orgs","repos_url":"https://api.github.com/users/tbeu/repos","events_url":"https://api.github.com/users/tbeu/events{/privacy}","received_events_url":"https://api.github.com/users/tbeu/received_events","type":"User","site_admin":false},"assignees":[{"login":"tbeu","id":5444067,"node_id":"MDQ6VXNlcjU0NDQwNjc=","avatar_url":"https://avatars0.githubusercontent.com/u/5444067?v=4","gravatar_id":"","url":"https://api.github.com/users/tbeu","html_url":"https://github.com/tbeu","followers_url":"https://api.github.com/users/tbeu/followers","following_url":"https://api.github.com/users/tbeu/following{/other_user}","gists_url":"https://api.github.com/users/tbeu/gists{/gist_id}","starred_url":"https://api.github.com/users/tbeu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbeu/subscriptions","organizations_url":"https://api.github.com/users/tbeu/orgs","repos_url":"https://api.github.com/users/tbeu/repos","events_url":"https://api.github.com/users/tbeu/events{/privacy}","received_events_url":"https://api.github.com/users/tbeu/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/tbeu/fmi-standard/milestones/11","html_url":"https://github.com/tbeu/fmi-standard/milestone/11","labels_url":"https://api.github.com/repos/tbeu/fmi-standard/milestones/11/labels","id":3634966,"node_id":"MDk6TWlsZXN0b25lMzYzNDk2Ng==","number":11,"title":"FMI 2.0","description":"","creator":{"login":"modelica-trac-importer","id":22202507,"node_id":"MDQ6VXNlcjIyMjAyNTA3","avatar_url":"https://avatars1.githubusercontent.com/u/22202507?v=4","gravatar_id":"","url":"https://api.github.com/users/modelica-trac-importer","html_url":"https://github.com/modelica-trac-importer","followers_url":"https://api.github.com/users/modelica-trac-importer/followers","following_url":"https://api.github.com/users/modelica-trac-importer/following{/other_user}","gists_url":"https://api.github.com/users/modelica-trac-importer/gists{/gist_id}","starred_url":"https://api.github.com/users/modelica-trac-importer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modelica-trac-importer/subscriptions","organizations_url":"https://api.github.com/users/modelica-trac-importer/orgs","repos_url":"https://api.github.com/users/modelica-trac-importer/repos","events_url":"https://api.github.com/users/modelica-trac-importer/events{/privacy}","received_events_url":"https://api.github.com/users/modelica-trac-importer/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":80,"state":"closed","created_at":"2018-09-08T08:37:16Z","updated_at":"2018-09-08T11:50:05Z","due_on":"2012-12-17T08:00:00Z","closed_at":"2018-09-08T08:37:16Z"},"comments":1,"created_at":"2018-09-08T11:50:04Z","updated_at":"2018-09-08T11:50:24Z","closed_at":null,"author_association":"COLLABORATOR","body":"**Reported by akorobkine on 11 Jul 2013 19:59 UTC**\nAfter investigating FMUChecker-2.0a1/FMUChecker-2.0a2 (ModelExchange branch) we have found that fmiGetContinuousStates is not called after the call to fmiCompletedIntegratorStep, unless there are events present in the system.  This is a possible problem if the system has constraints and the states could change their values during the call to fmiCompletedIntegratorStep, but the master will possibly not have the correct (updated) values for the states.\n\nHere are the possible solutions to the above issue:\n\n(1) Adding the following call (unconditionaly):\n  fmistatus = fmi2_import_get_continuous_states(fmu, states, n_states);\n\nright after the call to fmi2_import_completed_integrator_step(fmu, &callEventUpdate)\nand prior to event handling in the FMUChecker seems to fix the above issue.\n\n(2)  Another possible fix (on the FMU generation side) is to add in a dummy event for any model that has constraints, to force the client to call fmiGetContinuousStates at the end of every step (when the events run).\n\n(3)  It may be that constraint handling should be made explicit in the FMI spec, by addition of a new function, e.g. fmiApplyProjection, and a capability flag indicating that the FMU requires projection?\n\nLooking at the above issue and the possible solutions to it, what is the preferred way to handle systems with constraints in the FMU environment?\n\nThanks,\n\nAlex/Maplesoft\n\n----\n\nMigrated-From: https://trac.fmi-standard.org/ticket/144"},"comment":{"url":"https://api.github.com/repos/tbeu/fmi-standard/issues/comments/419636246","html_url":"https://github.com/tbeu/fmi-standard/issues/144#issuecomment-419636246","issue_url":"https://api.github.com/repos/tbeu/fmi-standard/issues/144","id":419636246,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTYzNjI0Ng==","user":{"login":"modelica-trac-importer","id":22202507,"node_id":"MDQ6VXNlcjIyMjAyNTA3","avatar_url":"https://avatars1.githubusercontent.com/u/22202507?v=4","gravatar_id":"","url":"https://api.github.com/users/modelica-trac-importer","html_url":"https://github.com/modelica-trac-importer","followers_url":"https://api.github.com/users/modelica-trac-importer/followers","following_url":"https://api.github.com/users/modelica-trac-importer/following{/other_user}","gists_url":"https://api.github.com/users/modelica-trac-importer/gists{/gist_id}","starred_url":"https://api.github.com/users/modelica-trac-importer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modelica-trac-importer/subscriptions","organizations_url":"https://api.github.com/users/modelica-trac-importer/orgs","repos_url":"https://api.github.com/users/modelica-trac-importer/repos","events_url":"https://api.github.com/users/modelica-trac-importer/events{/privacy}","received_events_url":"https://api.github.com/users/modelica-trac-importer/received_events","type":"User","site_admin":false},"created_at":"2018-09-08T11:50:24Z","updated_at":"2018-09-08T11:50:24Z","author_association":"COLLABORATOR","body":"**Comment by otter on 14 Oct 2013 11:21 UTC**\nThe FMI 1.0 and 2.0 interface is for ODEs with embedded algebraic equations. It is not for DAEs and not for overdetermined ODEs or DAEs. There is a plan to support residues in FMI 2.1 (so mix of ODEs and DAEs) additionally. At the same time also overdetermined DAEs/ODEs could be supported as well (so projecting on a constraint). However, all this seems to be outside of FMI 2.0.\n\nStill overdetermined ODEs can be handled in a clean way in FMI 2.0 (but maybe not as efficient as it could be; but not supporting DAEs seems to be much more critical for multi-body systems):\n1. Call fmiCompletedIntegratorStep after each step.\n2. If a projection is needed (so not in every step, but only if the constraint is violated too much), set the return argument enterEventMode = true and mark in the FMU that a projection is needed.\n3. The environment triggers an event and during the event handling the FMU performs the project, changes the states, and informs the environment that the states have changed.\n4. The environment inquires the new state vector and re-initializes its solver with its new states.\n\nI changed the milestone to FMI 2.1 because the issue can be handled in FMI 2.0 and one might analyze the problem again for the FMI 2.1 development whether a more efficient solution is needed.\n"}}
{"actor":{"display_login":"modelica-trac-importer"}}