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

possible wrong array size in Modelica.Mechanics.MultiBody.Visualizers.Colors.ColorMaps.jet #956

Closed
modelica-trac-importer opened this issue Jan 14, 2017 · 1 comment
Assignees
Labels
bug Critical/severe issue L: Mechanics.MultiBody Issue addresses Modelica.Mechanics.MultiBody
Milestone

Comments

@modelica-trac-importer
Copy link

Reported by christian.schubert on 4 Jan 2013 14:37 UTC
We had problems with the function

Modelica.Mechanics.MultiBody.Visualizers.Colors.ColorMaps.jet 

which is why I worked out the dimensions of all variables:

size(v1) = if (a<=2) then 1 else if (a <= 4) then 2 else floor(a/2);
size(v2) = a
size(v3) = a
size(v4) = floor(a/2)

The right hand side of cm has always 3 columns and the numbers of rows equals

size(cm_rhs,1) = size(v1) + size(v2) + size(v2) + size(v3) + size(v4) 
# size(v1) + 3*a + size(v4)

However, cm is defined as

Real cm[integer(a)*4,3];

which only matches the right hand side if a is an even number.
If we chose n_colors = 60, then we had a = 15 and size(cm,1) = 60 conflicting with size(cm_rhs,1) = 58.


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

@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: Mechanics.MultiBody Issue addresses Modelica.Mechanics.MultiBody labels Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Comment by otter on 3 Mar 2013 13:13 UTC
Fixed by Andreas Heckmann (the author) in b8f9baf

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

No branches or pull requests

2 participants