Opened 12 years ago
Closed 6 years ago
#2530 closed defect (fixed)
translation error of model in comment1: "model MatricesExp...."
| Reported by: | Owned by: | Martin Sjölund | |
|---|---|---|---|
| Priority: | high | Milestone: | 1.16.0 |
| Component: | Backend | Version: | trunk |
| Keywords: | Cc: |
Description
When trying to instantiate Modelica.Math.exp in MSL 3.2.1, one gets the following errors:
Error: Internal error Cannot vectorize call with dimension [size(A, 1)]
Error: No matching function found for abs in component <NO COMPONENT>
candidates are .SystemModeler.Internal.intAbs<function>(Integer v) => Integer
-.SystemModeler.Internal.realAbs<function>(Real v) => Real
Error: Failed to elaborate expression: abs(B[:,i]).
Error: Wrong type or wrong number of arguments to sum(abs(B[:,i]))'.
(in component <NO COMPONENT>).
Error: Failed to elaborate expression: sum(abs(B[:,i])).
Error: Failed to elaborate expression: sum(abs(B[:,i])) - abs(B[i,i]).
Error: Internal error Cannot vectorize call with dimension [size(A, 1)]
Error: No matching function found for abs in component <NO COMPONENT>
candidates are .SystemModeler.Internal.intAbs<function>(Integer v) => Integer
-.SystemModeler.Internal.realAbs<function>(Real v) => Real
Error: Failed to elaborate expression: abs(B[:,i]).
Error: Wrong type or wrong number of arguments to sum(abs(B[:,i]))'.
(in component <NO COMPONENT>).
Error: Failed to elaborate expression: sum(abs(B[:,i])).
Error: Failed to elaborate expression: sum(abs(B[:,i])) - abs(B[i,i]).
Error: Failed to elaborate rhs of CO:=sum(abs(B[:,i])) - abs(B[i,i]);.
Error: Failed to instantiate statement:
CO:=sum(abs(B[:,i])) - abs(B[i,i]);
Error: Failed to instantiate statement:
for i in 1:na loop
CO:=sum(abs(B[:,i])) - abs(B[i,i]);
RO:=sum(abs(B[i,:])) - abs(B[i,i]);
G:=RO / radix;
F:=1;
S:=CO + RO;
while (not (CO >= G or CO == 0)) loop
F:=F * radix;
CO:=CO * radix2;
end while;
G:=RO * radix;
while (not (CO < G or RO == 0)) loop
F:=F / radix;
CO:=CO / radix2;
end while;
if not (CO + RO) / F >= 0.95 * S then
G:=1 / F;
D[i]:=D[i] * F;
B[i,:]:=B[i,:] * G;
B[:,i]:=B[:,i] * F;
noconv:=true;
else
end if;
end for;
Error: Failed to instantiate statement:
while (noconv) loop
noconv:=false;
for i in 1:na loop
CO:=sum(abs(B[:,i])) - abs(B[i,i]);
RO:=sum(abs(B[i,:])) - abs(B[i,i]);
G:=RO / radix;
F:=1;
S:=CO + RO;
while (not (CO >= G or CO == 0)) loop
F:=F * radix;
CO:=CO * radix2;
end while;
G:=RO * radix;
while (not (CO < G or RO == 0)) loop
F:=F / radix;
CO:=CO / radix2;
end while;
if not (CO + RO) / F >= 0.95 * S then
G:=1 / F;
D[i]:=D[i] * F;
B[i,:]:=B[i,:] * G;
B[:,i]:=B[:,i] * F;
noconv:=true;
else
end if;
end for;
end while;
Error: Failed to instantiate function .Modelica.Math.Matrices.balance in scope Modelica.Math.Matrices.exp.
Error: Failed to elaborate expression: balance(A).
Error: Failed to instantiate statement:
(Diag,Atransf):=balance(A);
Error: Failed to instantiate function .Modelica.Math.Matrices.exp in scope MatricesExp.
Error: Failed to elaborate expression: Modelica.Math.Matrices.exp(A).
Error: Error occurred while flattening model MatricesExp
Error: Internal error Instantiation of MatricesExp failed with no error message.
Change History (9)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
I get a different error (the bug described in the messages above is a duplicate of #2529):
[Modelica 3.2.1/Math/package.mo:3259:5-3259:22:writable] Error: Wrong type or wrong number of arguments to identity(na)'.
I will keep it open until we fix the rest though.
comment:3 by , 12 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:5 by , 8 years ago
| Component: | Frontend → Backend |
|---|---|
| Milestone: | 1.9.1 → 1.13.0 |
| Resolution: | fixed |
| Status: | closed → reopened |
| Summary: | Can not instantiate Modelica.Math.exp → translation error of model in comment1: "model MatricesExp...." |
comment:7 by , 7 years ago
The issue reported in comment:2 is still there.
Is it because na is a protected parameter with binding
na = size(A, 1)
where A is a variable?
comment:8 by , 6 years ago
| Milestone: | 1.14.0 → 1.16.0 |
|---|
Releasing 1.14.0 which is stable and has many improvements w.r.t. 1.13.2. This issue is rescheduled to 1.16.0
comment:9 by , 6 years ago
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |
works now on
Windows: OpenModelica v1.16.0-dev-232-g98b88856b (64-bit)
Linux: OpenModelica v1.16.0-dev-246-g46500237 (64-bit)
OM result verified with
- Julia exp([1 2; 3 4])
- WolframAlpha

Here is a model: