{"action":"created","issue":{"url":"https://api.github.com/repos/tbeu/fmi-standard/issues/222","repository_url":"https://api.github.com/repos/tbeu/fmi-standard","labels_url":"https://api.github.com/repos/tbeu/fmi-standard/issues/222/labels{/name}","comments_url":"https://api.github.com/repos/tbeu/fmi-standard/issues/222/comments","events_url":"https://api.github.com/repos/tbeu/fmi-standard/issues/222/events","html_url":"https://github.com/tbeu/fmi-standard/issues/222","id":358293392,"node_id":"MDU6SXNzdWUzNTgyOTMzOTI=","number":222,"title":"Diverging time in master and slave","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":1049839215,"node_id":"MDU6TGFiZWwxMDQ5ODM5MjE1","url":"https://api.github.com/repos/tbeu/fmi-standard/labels/co-sim%20execution","name":"co-sim execution","color":"0000aa","default":false}],"state":"closed","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":1,"closed_issues":144,"state":"closed","created_at":"2018-09-08T08:37:16Z","updated_at":"2018-09-08T13:00:59Z","due_on":"2012-12-17T08:00:00Z","closed_at":"2018-09-08T08:37:16Z"},"comments":4,"created_at":"2018-09-08T12:59:58Z","updated_at":"2018-09-08T13:01:09Z","closed_at":"2018-09-08T13:00:59Z","author_association":"COLLABORATOR","body":"**Reported by jakob&#46;mauss on 11 Apr 2014 04:39 UTC**\nWe recently discovered a problem when running an fmu for co-simulation 1.0. It seems that there is no good fix for this problem, due to a flaw in fmi spec 1.0. The flaw is still present in fmi spec 2.0 RC1 (April 4, 2014) and should be fixed as proposed below.\n\nWe observed the problem when running a fmu for co-simulation 1.0 with fmiDoStep(c, ti, h, newStep), where ti := i\\*h is the current communication point and h = 0.001 is the communication step size.\n\nIn our case, fmiDoStep returns fmiDiscard after 256040 calls. Reason is that the fmu does not use ti to set its time variable, but updates time as follows: time := time + h. This incremental update is also what fmi 2.0 RC1 recomends as non-normative text. Quote:\n```\nFormally this argument (ti) is not needed. It is present in order\nto detect a mismatch between the master and the FMU state of the\nslave\n```\nHowever, if the fmu uses ti only for checking and not to update its slave time variable, rounding errors in slave time will accumulate. As a result, master and slave time diverge, which finally causes the check performed by fmiDoStep to fail. In our case, this happened after 256040 steps.\n\nUnfortunately, fmi 1.0 spec does not enforce that the fmu must use ti  to update slave time. Therefore, both, master and slave can be considered as fmi compliant here, still the simulation fails.\n\nTo fix fmi spec 2.0 RC1, we should change the specification of fmiDoStep as follows:\n\ncurrent text 1:\n```\nThe argument currentCommunicationPoint is the current communication\npoint of the master (tci). [Formally this argument is not needed.\nIt is present in order to detect a mismatch between the master and\nthe FMU state of the slave: The currentCommunicationPoint and the\nFMU state of the slaves defined by former fmiDoStep or\nfmiSetFMUState calls, have to be consistent with respect to each\nother. For first call to fmiDoStep after fmiExitInitializationMode,\nit needs to be consistent with startTime given to the latter.]\n```\n\nproposed change 1\n```\nThe argument currentCommunicationPoint is the current communication\npoint of the master (tci). The FMU must set its independent \"time\"\nvariable to currentCommunicationPoint.\nAt the first call to fmiDoStep, currentCommunicationPoint must be\nequal to startTime as set with fmiSetupExperiment.\nAt the second and further calls to fmiDoStep,\ncurrentCommunicationPoint must be approximately equal to\ncurrentCommunicationPoint + communicationStepSize as passed to the\nFMU with the previous call to fmiDoStep. Otherwise, fmiDoStep must\nreturn fmiDiscard.\n```\n\nCurrent text 2: Exactly one ScalarVariable of an FMU must be defined as \"independent\". This variable must be defined as \"Real\". Attribute \"start\" must not be defined. It is not allowed to call function fmiSetReal on an \"independent\" variable. Instead, its value is set by fmiSetTime for ModelExchange and by arguments currentCommunicationPoint and communicationStepSize of fmiDoStep for CoSimulation. However, the actual value can always be inquired by fmiGetReal. [It is recommended to use <ScalarVariable name=\"time\"> and <Unit name=\"s\"> for the \"independent\" variable. If unit is not “s”, some tools might not support the connection with other FMUs.]\n\nproposed change 2: replace\n```\nand by arguments currentCommunicationPoint and\ncommunicationStepSize of fmiDoStep for CoSimulation.\n```\nby\n```\nand by arguments currentCommunicationPoint of fmiDoStep and\nstartTime of fmiSetupExperiment for CoSimulation.\n```\n\n\n----\n\nMigrated-From: https://trac.fmi-standard.org/ticket/222"},"comment":{"url":"https://api.github.com/repos/tbeu/fmi-standard/issues/comments/419640511","html_url":"https://github.com/tbeu/fmi-standard/issues/222#issuecomment-419640511","issue_url":"https://api.github.com/repos/tbeu/fmi-standard/issues/222","id":419640511,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTY0MDUxMQ==","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-08T13:01:09Z","updated_at":"2018-09-08T13:01:09Z","author_association":"COLLABORATOR","body":"**Comment by hansolsson on 24 Apr 2014 09:44 UTC**\nThe clarified \"For example, if the slave does not...\" is too strong, and should either be removed or be made less strong, e.g. should -> could.\n\nThe issue is that due to round-off the (tc_i-tc_(s,i)) might for large time-values be dominated by round-off error. Having some form of low-pass filtering of these differences is better than using them directly, and implementors should be allowed to do this - as long as times are approximately equal and sum of time-differences is approximately equal to the times (as in the original proposed change)."}}
{"actor":{"display_login":"modelica-trac-importer"}}