{"action":"created","issue":{"url":"https://api.github.com/repos/tbeu/Modelica/issues/485","repository_url":"https://api.github.com/repos/tbeu/Modelica","labels_url":"https://api.github.com/repos/tbeu/Modelica/issues/485/labels{/name}","comments_url":"https://api.github.com/repos/tbeu/Modelica/issues/485/comments","events_url":"https://api.github.com/repos/tbeu/Modelica/issues/485/events","html_url":"https://github.com/tbeu/Modelica/issues/485","id":195156415,"number":485,"title":"Invalid argument to delay in Modelica.Electrical.Analog.Lines.TLine2 and Modelica.Electrical.Analog.Lines.TLine3","user":{"login":"modelica-trac-importer","id":22202507,"avatar_url":"https://avatars.githubusercontent.com/u/22202507?v=3","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":499441885,"url":"https://api.github.com/repos/tbeu/Modelica/labels/bug","name":"bug","color":"ee0701","default":true},{"id":499451239,"url":"https://api.github.com/repos/tbeu/Modelica/labels/Electrical.Analog","name":"Electrical.Analog","color":"0000aa","default":false},{"id":499453872,"url":"https://api.github.com/repos/tbeu/Modelica/labels/P:%20normal","name":"P: normal","color":"aa8888","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-12-13T04:10:08Z","updated_at":"2016-12-13T04:11:48Z","closed_at":"2016-12-13T04:11:18Z","body":"**Reported by anonymous on 24 Jan 2011 13:46 UTC**\nThe models Modelica.Electrical.Analog.Lines.TLine2 looks like this\r\n\r\n```\r\nmodel TLine2 \"Lossless transmission line with characteristic impedance Z0, frequency F and normalized length NL\"\r\n  extends Modelica.Electrical.Analog.Interfaces.TwoPort;\r\n  parameter Modelica.SIunits.Resistance Z0(start=1) \"Characteristic impedance\";\r\n  parameter Modelica.SIunits.Frequency F(start=1) \"Frequency\";\r\n  parameter Real NL(start=1) \"Normalized length\";\r\nprotected \r\n  Modelica.SIunits.Voltage er;\r\n  Modelica.SIunits.Voltage es;\r\n  Modelica.SIunits.Time TD;\r\nequation \r\n  assert(Z0 > 0, \"Z0 has to be positive\");\r\n  assert(NL > 0, \"NL has to be positive\");\r\n  assert(F > 0, \"F  has to be positive\");\r\n  TD=NL/F;\r\n  i1=(v1 - es)/Z0;\r\n  i2=(v2 - er)/Z0;\r\n  es=2*delay(v2, TD) - delay(er, TD);\r\n  er=2*delay(v1, TD) - delay(es, TD);\r\nend TLine2;\r\n```\r\n\r\nSince TD is declared as a variable, and no delayMax argument is given, this is not allowed according to the Modelica specification. Changing the model to\r\n\r\n\r\n```\r\nmodel TLine2 \"Lossless transmission line with characteristic impedance Z0, frequency F and normalized length NL\"\r\n  extends Modelica.Electrical.Analog.Interfaces.TwoPort;\r\n  parameter Modelica.SIunits.Resistance Z0(start=1) \"Characteristic impedance\";\r\n  parameter Modelica.SIunits.Frequency F(start=1) \"Frequency\";\r\n  parameter Real NL(start=1) \"Normalized length\";\r\nprotected \r\n  Modelica.SIunits.Voltage er;\r\n  Modelica.SIunits.Voltage es;\r\n  parameter Modelica.SIunits.Time TD=NL/F; <-----------\r\nequation \r\n  assert(Z0 > 0, \"Z0 has to be positive\");\r\n  assert(NL > 0, \"NL has to be positive\");\r\n  assert(F > 0, \"F  has to be positive\");\r\n  i1=(v1 - es)/Z0;\r\n  i2=(v2 - er)/Z0;\r\n  es=2*delay(v2, TD) - delay(er, TD);\r\n  er=2*delay(v1, TD) - delay(es, TD);\r\nend TLine2;\r\n```\r\ngives a model that is allowed. The model Modelica.Electrical.Analog.Lines.TLine3 has a similar problem. I set the MSL version to 3.2 but it applies to all versions of the MSL.\n\nMigrated-From: https://trac.modelica.org/Modelica/ticket/485"},"comment":{"url":"https://api.github.com/repos/tbeu/Modelica/issues/comments/266635932","html_url":"https://github.com/tbeu/Modelica/issues/485#issuecomment-266635932","issue_url":"https://api.github.com/repos/tbeu/Modelica/issues/485","id":266635932,"user":{"login":"modelica-trac-importer","id":22202507,"avatar_url":"https://avatars.githubusercontent.com/u/22202507?v=3","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":"2016-12-13T04:11:48Z","updated_at":"2016-12-13T04:11:48Z","body":"**Modified by dietmarw on 5 Apr 2013 09:15 UTC**"}}
{"actor":{"display_login":"modelica-trac-importer"}}