{"action":"created","issue":{"url":"https://api.github.com/repos/tbeu/Modelica/issues/304","repository_url":"https://api.github.com/repos/tbeu/Modelica","labels_url":"https://api.github.com/repos/tbeu/Modelica/issues/304/labels{/name}","comments_url":"https://api.github.com/repos/tbeu/Modelica/issues/304/comments","events_url":"https://api.github.com/repos/tbeu/Modelica/issues/304/events","html_url":"https://github.com/tbeu/Modelica/issues/304","id":196504136,"number":304,"title":"Flow variables of complex type","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":503534431,"url":"https://api.github.com/repos/tbeu/Modelica/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/tbeu/Modelica/milestones/30","html_url":"https://github.com/tbeu/Modelica/milestone/30","labels_url":"https://api.github.com/repos/tbeu/Modelica/milestones/30/labels","id":2204827,"number":30,"title":"Design67","description":"67th Modelica Design Meeting in Atlanta, U.S.A. ","creator":{"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},"open_issues":1,"closed_issues":0,"state":"closed","created_at":"2016-12-19T14:16:47Z","updated_at":"2016-12-19T19:47:49Z","due_on":"2010-09-14T07:00:00Z","closed_at":"2016-12-19T14:16:47Z"},"comments":1,"created_at":"2016-12-19T19:47:49Z","updated_at":"2016-12-19T19:47:58Z","closed_at":null,"body":"**Reported by Ha&#x6e;sO&#x6c;sson on 11 Mar 2010 08:44 UTC**\nI did not find this ticket, but it has been discussed.\n\nWith the introduction of ComplexCurrentit seems natural to have flow variables of this type (or any other record with operators).\n\nWith Modelica 3.1 that works with Cartesian representation, but not with Polar representation - and obviously the idea is that it should be the same regardless of representation. The issue is that Complex is split into primitive components and then flow equations introduced for them; i.e. not using the operations defined in the class itself.\n\nTo make Complex works as the built-in types the following changes are needed:\n\n * Operator record components are not split into primitive components for connection handling.\n * Some way of finding the zero for the operator record class.\n   1. One way is to define an operator function '0' (or another way) with zero input and one output of the given type; and state that this definesthe zero value.\n   1. Another way is torequire there is an uniqueconstructor callable with zero inputs; and then _assume_ that it gives the zero value.\n\nThe zero (=additive identity, and regardless of choice above) also solves the problem that some matrix multiplications are currently undefined (e.g. Complex[3,0]*Complex[0,2]).\n\nTo be concrete: with a complex current and voltage type connect(p, a.p) gives:\n\nCartesian in 3.1:\n\n`p.v.re=a.p.v.re;\n  p.v.im=a.p.v.im;\n  -``p.i.re+a.p.i.re=0;\n  -p.i.im+a.p.i.im=0;`\n\n`Polar in 3.1:`\n\n`  p.v.magnitude=a.p.v.magnitude;\n  p.v.angle=a.p.v.angle;\n  -p.i.magnitude+a.p.i.magnitude=0;\n  -p.i.angle+a.p.i.angle=0;`\n\n`Proposed:`\n\n`  p.v=a.p.v;\n  Complex.'+'(Complex.'-'(p.i), a.p.i)=Complex(0, 0);`\n\nMigrated-From: https://trac.modelica.org/Modelica/ticket/304"},"comment":{"url":"https://api.github.com/repos/tbeu/Modelica/issues/comments/268059976","html_url":"https://github.com/tbeu/Modelica/issues/304#issuecomment-268059976","issue_url":"https://api.github.com/repos/tbeu/Modelica/issues/304","id":268059976,"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-19T19:47:58Z","updated_at":"2016-12-19T19:47:58Z","body":"**Comment by HansOlsson on 11 Mar 2010 10:45 UTC**\n`Actually Polar works in the example above, but neither if you have more connectors or if the two connectors are both inside or both outside.`"}}
{"actor":{"display_login":"modelica-trac-importer"}}