﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3159	Duplicate modification error	Rüdiger Franke	somebody	"Currently 25 of 104 models from the PowerSystems library fail to translate (r24582). 20 of them raise translation errors for the parameterization of models with data records. Typically they fail if they use the records in functions that set up internal data, e.g.:
   `PowerSystems.Examples.Spot.DrivesAC3ph.SM_ctrlAv`
Some more examples raise the same translation error but simulate successfully afterwards. e.g.:
   `PowerSystems.Examples.Spot.DrivesDC.DCmotor_ser`

The following example summerizes the used pattern:
{{{
package DuplicateModification
  record R1
    Real v = 1;
  end R1;

  record R2
    extends R1(v = 2);
    Real w = 0.2;
  end R2;

  record R3
    extends R2(v = 3, w = 0.3);
  end R3;

  model A
    replaceable parameter R1 r;
  end A;

  model B
    extends A(redeclare replaceable parameter R2 r);
  end B;

  model Test
    parameter R3 r;
    B b(r=r);
  end Test;
end DuplicateModification;
}}}

The following error is raised for DuplicateModification.Test:
{{{
[1] Translation Error
Duplicate modification of element =(untyped) 2 and = (typed)3.0 DAE.PROP(Real, C_CONST), value: 3.0 on component v.

[2] Translation Error
[/home/user/work/DuplicateModification.mo: 16:5-16:31]: Variable b.r: Duplicate modification of element =(untyped) 2 and = (typed)3.0 DAE.PROP(Real, C_CONST), value: 3.0 on component v.
}}}

Note: You might find it strange to first redeclare a record in `model B` and then modify it in `model Test`. The advantage of the modification is that it requires less GUI support -- see e.g. `PowerSystems.Examples.Spot.DrivesAC3ph.ASMcharacteristic` -- the machine parameters `asyn400_30k` can be edited in the GUI. The more general pattern of replaceable classes used by Fluid and already working with omc should be introduced into the PowerSystems library once OMEdit will support it.
"	defect	closed	high	1.9.4	Frontend	trunk	fixed		
