Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4691 closed defect (fixed)

Issue with smooth() in the NF

Reported by: Francesco Casella Owned by: Per Östlund
Priority: high Milestone: 2.0.0
Component: New Instantiation Version:
Keywords: Cc:

Description

Please check https://libraries.openmodelica.org/branches/newInst/Modelica_3.2.2/files/Modelica_3.2.2_Modelica.Electrical.Analog.Examples.SimpleTriacCircuit.err

The following error is reported:

Error: Cannot resolve type of expression
' simpleTriac.thyristor.vConmain + smooth(0, ifsimpleTriac.thyristor.iGK < 0.95 .* simpleTriac.thyristor.IGT then 0.0
else ifsimpleTriac.thyristor.iGK < 0.95 .* simpleTriac.thyristor.IGT + 0.001 then 10000.0 .* (simpleTriac.thyristor.iGK - 0.95 .* simpleTriac.thyristor.IGT) .* simpleTriac.thyristor.vAK 
else 10.0 .* simpleTriac.thyristor.vAK) '. 
The operands have types ' Real + <RealArrayOrRecord> ' in component 
:
Addition operations involving an array and a scalar are not valid
in Modelica. Try using elementwise operator '.+'.

It is not clear to me if the problem is with smooth or with the if-expression (or both), but clearly the second operand should be Real as well.

It is also not clear why the .* operator is reported in the error message.

Change History (2)

comment:1 by Francesco Casella, 7 years ago

Resolution: fixed
Status: newclosed

Fixed in 105aad9

comment:2 by Francesco Casella, 7 years ago

Some issues are still present, see #4724

Note: See TracTickets for help on using tickets.