Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use equation-section in M_Transformer #1045

Closed
modelica-trac-importer opened this issue Jan 14, 2017 · 7 comments
Closed

Use equation-section in M_Transformer #1045

modelica-trac-importer opened this issue Jan 14, 2017 · 7 comments
Assignees
Labels
bug Critical/severe issue L: Electrical.Analog Issue addresses Modelica.Electrical.Analog
Milestone

Comments

@modelica-trac-importer
Copy link

Reported by sjoelund.se on 24 Mar 2013 07:33 UTC
Modelica.Electrical.Analog.Basic.M_Transformer currently has an algorithm-section instead of the following basic equation (which is much easier to invert):

equation
  for s in 1:N loop
     for z in 1:N loop
       Lm[z,s] = if (z>=s) then L[(s-1)*N+z-div((s-1)*s,2)] else Lm[s,z];
     end for;
  end for;

I'd suggest changing it since there to me doesn't seem to be any reason to keep it an algorithm-section.


Migrated-From: https://trac.modelica.org/Modelica/ticket/1045

@modelica-trac-importer modelica-trac-importer added this to the MSL3.2.1 milestone Jan 14, 2017
@modelica-trac-importer modelica-trac-importer added bug Critical/severe issue L: Electrical.Analog Issue addresses Modelica.Electrical.Analog labels Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Comment by otter on 26 Mar 2013 16:35 UTC
This could be further improved:
Basically Lm depends only on parameter L. Therefore, it should be treated as parameter that is computed during initialization. I would propose to change the code to:

   parameter Modelica.SIunits.Inductance Lm[N,N](final fixed=false);
initial equation 
  for s in 1:N loop
     for z in 1:N loop
       Lm[z,s] = if (z>=s) then L[(s-1)*N+z-div((s-1)*s,2)] else Lm[s,z];
     end for;
  end for;

@modelica-trac-importer
Copy link
Author

Comment by clauss on 27 Mar 2013 08:15 UTC
fixed in 7a56919. Thanks for reporting that.

@modelica-trac-importer
Copy link
Author

Modified by clauss on 27 Mar 2013 08:16 UTC

@modelica-trac-importer
Copy link
Author

Modified by majetta on 5 Apr 2013 12:57 UTC

@modelica-trac-importer
Copy link
Author

Changelog modified by majetta on 5 Apr 2013 12:57 UTC
Model M_Transformer improved

@modelica-trac-importer
Copy link
Author

Modified by majetta on 10 Apr 2013 12:55 UTC

@modelica-trac-importer
Copy link
Author

Changelog modified by majetta on 10 Apr 2013 12:55 UTC
Variable Lm in model M_Transformer changed into parameter. Functionality of the model moved from algorithm section to equation section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Critical/severe issue L: Electrical.Analog Issue addresses Modelica.Electrical.Analog
Projects
None yet
Development

No branches or pull requests

2 participants