{"action":"created","issue":{"url":"https://api.github.com/repos/tbeu/Modelica/issues/365","repository_url":"https://api.github.com/repos/tbeu/Modelica","labels_url":"https://api.github.com/repos/tbeu/Modelica/issues/365/labels{/name}","comments_url":"https://api.github.com/repos/tbeu/Modelica/issues/365/comments","events_url":"https://api.github.com/repos/tbeu/Modelica/issues/365/events","html_url":"https://github.com/tbeu/Modelica/issues/365","id":197512795,"number":365,"title":"Is the handling of complex arrays too complex?","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":506762999,"url":"https://api.github.com/repos/tbeu/Modelica/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":506769007,"url":"https://api.github.com/repos/tbeu/Modelica/labels/L:Complex*","name":"L:Complex*","color":"0000aa","default":false},{"id":506770144,"url":"https://api.github.com/repos/tbeu/Modelica/labels/P:%20high","name":"P: high","color":"ff6666","default":false}],"state":"open","locked":false,"assignee":{"login":"beutlich","id":14896695,"avatar_url":"https://avatars.githubusercontent.com/u/14896695?v=3","gravatar_id":"","url":"https://api.github.com/users/beutlich","html_url":"https://github.com/beutlich","followers_url":"https://api.github.com/users/beutlich/followers","following_url":"https://api.github.com/users/beutlich/following{/other_user}","gists_url":"https://api.github.com/users/beutlich/gists{/gist_id}","starred_url":"https://api.github.com/users/beutlich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beutlich/subscriptions","organizations_url":"https://api.github.com/users/beutlich/orgs","repos_url":"https://api.github.com/users/beutlich/repos","events_url":"https://api.github.com/users/beutlich/events{/privacy}","received_events_url":"https://api.github.com/users/beutlich/received_events","type":"User","site_admin":false},"assignees":[{"login":"beutlich","id":14896695,"avatar_url":"https://avatars.githubusercontent.com/u/14896695?v=3","gravatar_id":"","url":"https://api.github.com/users/beutlich","html_url":"https://github.com/beutlich","followers_url":"https://api.github.com/users/beutlich/followers","following_url":"https://api.github.com/users/beutlich/following{/other_user}","gists_url":"https://api.github.com/users/beutlich/gists{/gist_id}","starred_url":"https://api.github.com/users/beutlich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beutlich/subscriptions","organizations_url":"https://api.github.com/users/beutlich/orgs","repos_url":"https://api.github.com/users/beutlich/repos","events_url":"https://api.github.com/users/beutlich/events{/privacy}","received_events_url":"https://api.github.com/users/beutlich/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/tbeu/Modelica/milestones/48","html_url":"https://github.com/tbeu/Modelica/milestone/48","labels_url":"https://api.github.com/repos/tbeu/Modelica/milestones/48/labels","id":2214851,"number":48,"title":"Design79","description":"79th Modelica Design Meeting in Coventry, UK","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-25T13:00:36Z","updated_at":"2016-12-25T19:37:07Z","due_on":"2013-06-05T07:00:00Z","closed_at":"2016-12-25T13:00:36Z"},"comments":8,"created_at":"2016-12-25T19:34:57Z","updated_at":"2016-12-25T19:37:17Z","closed_at":null,"body":"**Reported by christiankral on 28 Apr 2010 11:29 UTC**\nI was running into a problem when I wanted to perform a calculation where real and complex arrays are incorporated. Consider the following parameters:\n\n```\n  parameter Integer n=3;\n  parameter Real r1[n]={1,2,3};\n  parameter Real r2[n]={2,3,4};\n  parameter Complex c[n]={Complex(1,1),Complex(1,2),Complex(1,3)};\n```\n\nI can compute the element wise sum of the arrays `r1` and `r2` by:\n\n```\n  parameter Real sumr_1 = sum(r1.*r2);\n  parameter Real sumr_2 = r1*r2;\n```  \n\nHow could a similar operation be performed for `c` and `r1`? Here are two equally awkward looking solutions to the problem:\n\n```\n  parameter Complex sumc_1 = \n    Modelica.ComplexMath.'sum'({r1[j]*c[j] for j in 1:n}); // works\n  parameter Complex sumc_2 = Complex.'*'.scalarProduct\n    ({Complex(r1[k]) for k in 1:n},c);                     // works\n```\n\nWhat I would like to have is:\n\n```\n  parameter Complex sumc_3 = sum(r1.*c); // does not work\n  parameter COmplex sumc_4 = r1*c;       // does not work\n```\n\n\n# Conclusions\n\nThe working cases are\n * difficult to write, read and understand\n * a horror for a Modelica beginner: how can we explain to anybody that the achievements of the last ten years turn out to looks like this? \n\nThe not working case are\n * easy to write, read and understand\n * logical to a beginner, because the code looks the same in case of real expressions\n\nI wonder where the gap between the two cases comes from? I cannot believe that Modelica has to be so unclear and confused. \n\n# Proposal\n\nSimplify handling of complex arrays. Simplify Modelica. Make Complex a built in data type if necessary. \n\n\n----\n\nMigrated-From: https://trac.modelica.org/Modelica/ticket/365"},"comment":{"url":"https://api.github.com/repos/tbeu/Modelica/issues/comments/269134811","html_url":"https://github.com/tbeu/Modelica/issues/365#issuecomment-269134811","issue_url":"https://api.github.com/repos/tbeu/Modelica/issues/365","id":269134811,"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-25T19:37:17Z","updated_at":"2016-12-25T19:37:17Z","body":"**Comment by hansolsson on 4 Jun 2013 09:23 UTC**\nneed more input and preparation"}}
{"actor":{"display_login":"modelica-trac-importer"}}