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

Incorrect dimension parameter used when defining A in Modelica.Utilities.Examples.ReadRealMatrixFromFile #3608

Closed
ErikHenningsson opened this issue Jul 16, 2020 · 0 comments · Fixed by #3609
Assignees
Labels
example Issue only addresses example(s) L: Utilities Issue addresses Modelica.Utilities
Milestone

Comments

@ErikHenningsson
Copy link

In the example model Modelica.Utilities.Examples.ReadRealMatrixFromFile the matrix A is defined by
final parameter Real A[:,:] = Modelica.Utilities.Streams.readRealMatrix(file,matrixName,dim1[1],dim1[2]) "Matrix data";
but parameter dim1 is defined using another file variable and matrix name (file1, matrixName1).

Incidentally, the same matrix is read by default by file and file1. However, file and matrixName can be modified making the bug problematic.

Suggested fix:
final parameter Real A[:,:] = Modelica.Utilities.Streams.readRealMatrix(file,matrixName,dim[1],dim[2]) "Matrix data";

@beutlich beutlich added example Issue only addresses example(s) L: Utilities Issue addresses Modelica.Utilities labels Jul 17, 2020
HansOlsson added a commit to HansOlsson/Modelica that referenced this issue Jul 17, 2020
@beutlich beutlich added this to the MSL4.1.0 milestone Jul 17, 2020
beutlich pushed a commit that referenced this issue Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example Issue only addresses example(s) L: Utilities Issue addresses Modelica.Utilities
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants