Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Modelica.Math.Matrices.cholesky(.)

Modelica.Math.Matrices.cholesky(.)

Hello Everybody,

I tried to use the Cholesky decomposition and got an unexpected error.
The simplest example of the model is:

model test
  Real msr_mat[2, 2];
equation
  msr_mat = Modelica.Math.Matrices.cholesky({{1,0},{0,1}}, false);
end test;


The corresponding error message is:

"[/usr/lib/omlibrary/Modelica 3.2.1/Math/package.mo:2463:7-2466:15:readonly]
Error: Type mismatch in assignment in H := {} of Real[size(A, 1), size(A, 2)] := Integer[0, 0]
Error: Error occurred while flattening model test"


Please help to explain this behavior.

Thanks in anticipation.

Re: Modelica.Math.Matrices.cholesky(.)

It's a bug see ticket #3058.

As work-a-round you can copy the function
and comment the line with

Code:


H := fill(0.0,0,0);

since that's the one that, cause the issues.

so long.
Willi

Edited by: wbraun - Jan-05-15 10:14:53

Re: Modelica.Math.Matrices.cholesky(.)

Hello Willi,

Thank you very much! It seems to work.

Best regards.

There are 0 guests and 0 other users also viewing this topic
You are here: