Opened 14 years ago

Last modified 14 years ago

#1273 closed defect (fixed)

Flattenning of Modelica.Electrical.Analog does not work for all components

Reported by: Jan Brugård Owned by: Jan Brugård
Priority: blocker Milestone: Red October
Component: Version:
Keywords: Cc: Jan Brugård, Per Östlund

Description

The following models do not work to check, because flattening fails:

Check of Modelica.Electrical.Analog.Examples.Utilities.RealSwitch failed.
Check of Modelica.Electrical.Analog.Examples.Utilities.Nand failed.
Check of Modelica.Electrical.Analog.Examples.AmplifierWithOpAmpDetailed failed
Check of Modelica.Electrical.Analog.Sources.StepVoltage failed.
Check of Modelica.Electrical.Analog.Sources.RampVoltage failed.
Check of Modelica.Electrical.Analog.Sources.SineVoltage failed.
Check of Modelica.Electrical.Analog.Sources.ExpSineVoltage failed.
Check of Modelica.Electrical.Analog.Sources.ExponentialsVoltage failed.
Check of Modelica.Electrical.Analog.Sources.PulseVoltage failed.
Check of Modelica.Electrical.Analog.Sources.SawToothVoltage failed.
Check of Modelica.Electrical.Analog.Sources.TrapezoidVoltage failed.
Check of Modelica.Electrical.Analog.Sources.TableVoltage failed.
Check of Modelica.Electrical.Analog.Sources.StepCurrent failed.
Check of Modelica.Electrical.Analog.Sources.RampCurrent failed.
Check of Modelica.Electrical.Analog.Sources.SineCurrent failed.
Check of Modelica.Electrical.Analog.Sources.ExpSineCurrent failed.
Check of Modelica.Electrical.Analog.Sources.ExponentialsCurrent failed.
Check of Modelica.Electrical.Analog.Sources.PulseCurrent failed.
Check of Modelica.Electrical.Analog.Sources.SawToothCurrent failed.
Check of Modelica.Electrical.Analog.Sources.TrapezoidCurrent failed.
Check of Modelica.Electrical.Analog.Sources.TableCurrent failed.
Check of Modelica.Electrical.Analog.Sensors.PowerSensor failed.
Check of Modelica.Electrical.Analog.Lines.OLine failed
Check of Modelica.Electrical.Analog.Lines.M_OLine failed
Check of Modelica.Electrical.Analog.Lines.ULine failed
Check of Modelica.Electrical.Analog.Lines.TLine2 failed
Check of Modelica.Electrical.Analog.Lines.TLine3 failed
Check of Modelica.Electrical.Analog.Interfaces.VoltageSource failed
Check of Modelica.Electrical.Analog.Interfaces.CurrentSource failed
Check of Modelica.Electrical.Analog.Basic.EMF failed.
Check of Modelica.Electrical.Analog.Basic.TranslationalEMF failed.
Check of Modelica.Electrical.Analog.Basic.OpAmpDetailed failed

Change History (9)

comment:2 by Adrian Pop, 14 years ago

These are partial models, so you cannot run instantiateModel or checkModel on them:

Modelica.Electrical.Analog.Interfaces.VoltageSource
Modelica.Electrical.Analog.Interfaces.CurrentSource

comment:3 by Adrian Pop, 14 years ago

Models:

Modelica.Electrical.Analog.Examples.AmplifierWithOpAmpDetailed
Modelica.Electrical.Analog.Basic.OpAmpDetailed

contain if equations in the form:

if initial() 
  ...
end if;

which cannot be currently handled by the OpenModelica back-end,
so we cannot run checkModel on these models, but instantiation
works fine. I assume they will work in MathModelica.

comment:4 by Adrian Pop, 14 years ago

Added test /testsuite/libraries/msl31/Modelica.Electrical.Analog.mos, see SCM Commits.

comment:5 by Adrian Pop, 14 years ago

Fixed in revision 6119

comment:6 by Adrian Pop, 14 years ago

Closed by mistake. Model Modelica.Electrical.Analog.Lines.M_OLine fails, and models
Modelica.Electrical.Analog.Interfaces.VoltageSource, Modelica.Electrical.Analog.Interfaces.CurrentSource
need to be checked using the new checkModel(PartialModel) functionality.

comment:7 by Adrian Pop, 14 years ago

Now only model Modelica.Electrical.Analog.Lines.M_OLine remains to be solved.
All the others check fine, including the partial ones.

comment:8 by Adrian Pop, 14 years ago

The problem with model: Modelica.Electrical.Analog.Lines.M_OLine is that is using array indexing using REAL indexes\\
Is this kind of indexing: C[((1+(j-1)*lines)-((j-2)*(j-1))*0.5)].p even allowed in Modelica? I will check!

  connect(inductance.n[j],C[((1+(j-1)*lines)-((j-2)*(j-1))*0.5)].p); // weird indexing!

  parameter Integer lines(final min=2) = 4 "Number of lines";
  protected
  parameter Integer dim_vector_lgc=div(lines*(lines+1),2); // even here you have a div that you later cast to Integer
  public
  parameter Real r[lines](
    final min=Modelica.Constants.small,
    unit="Ohm/m") = {4.76e5,1.72e5,1.72e5,1.72e5} "Resistance per meter";

  parameter Real l[dim_vector_lgc](
    final min=Modelica.Constants.small,
    unit="H/m") = {5.98e-7,4.44e-7,4.39e-7,3.99e-7,5.81e-7,4.09e-7,4.23e-7,5.96e-7,4.71e-7,
        6.06e-7} "Inductance per meter";

comment:9 by Per Östlund, 14 years ago

The Modelica.Electrical.Analog.Lines.M_OLine.segment model has been fixed in MSL v3.2, and no longer use a real expression as array index. But since we probably want to support MSL v3.1 I added a special case for Modelica.Electrical.Analog.Lines.OLine.segment to allow it to use Real as array index. All models in Modelica.Electrical.Analog should therefore work with checkModel now.

Note: See TracTickets for help on using tickets.