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

Issue with balancing in Modelica_LinearSystems2.StateSpace.Plot.bodeMIMO #115

Open
UlfNordstrom opened this issue Feb 5, 2021 · 0 comments
Assignees

Comments

@UlfNordstrom
Copy link

Hi,
This is related to #44
One of our customer have problems with the Bode plot in M_LS2.
In the attached package, the example model Model.Sample.Model_sample_step_fodr can be used to reproduce the issue.
Running the bode plot
Modelica_LinearSystems2.ModelAnalysis.TransferFunctions("Model.Sample.Model_sample_step_fodr");
only the phase plot is generated, the magnitude plot is not ok.

The customer has worked around the issue by bypassing the balancing. Examples in the attachment in the sub package "Functions", the function with "_f" is the customer modified code (version numbers in the function refers to Dymola versions).

What is done is to bypass the balancing

// Balance system
(,A,Bfull,Cfull) :=Internal.balanceABC(A=ss.A, B=ss.B, C=ss.C);
//----------------------------------------------------------------------
  A := ss.A;  //add
//----------------------------------------------------------------------

and

//----------------------------------------------------------------------
  // Perform computation from every input to every output
  for i1 in 1:size(ss.C, 1) loop
    for i2 in 1:size(ss.B, 2) loop
      // Compute zeros
      B :=matrix(ss.B[:, i2]);
      C :=transpose(matrix(ss.C[i1, :]));
      D :=matrix(ss.D[i1, i2]);
//----------------------------------------------------------------------

//----------------------------------------------------------------------
//  // Perform computation from every input to every output
//  for i1 in 1:size(Cfull, 1) loop
//    for i2 in 1:size(Bfull, 2) loop
//      // Compute zeros
//      B :=matrix(Bfull[:, i2]);
//      C :=transpose(matrix(Cfull[i1, :]));
//      D :=matrix(ss.D[i1, i2]);
//----------------------------------------------------------------------

Could you analyze the issue, is there a problem with the balancing?

Model_2022.txt
The attached model is using Modelica 4 and compatible M_LS, but the customer code fix is based on an older version.

Best regards,
Ulf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants