title: parameter unable to change through _ini.xml in OpenModelica
body: <p>my intention is to change a parameter of a component through the <em>_init.xml</em>:</p>
  <p>The model is declared as:</p>
  <pre><code>model ModelA
    ...
    parameter Types.ActivePower PRefConst = 0
    ...
    Types.ActivePower PRef(nominal = SNom) =  PRefConst
     ...
  end ModelA;
  </code></pre>
  <p>During the instantiation of <code>ModelA</code>, the <code>PRefConst</code> is assigned to a value:</p>
  <pre><code>  model_a ModelA(..., PRefConst = 14.9e6, ...);
  </code></pre>
  <p>In the compiled C code, it can be noticed that the <code>PRefConst</code>'s value is assigned hard-coded:</p>
  <pre><code>
  /*
  equation index: 6068
  type: SIMPLE_ASSIGN
  model_a .PRefConst = 14900000.0
  */
  void modelName_eqFunction_6068(DATA *data, threadData_t *threadData)
  {
    TRACE_PUSH
    const int equationIndexes[2] = {1,6068};
    data-&gt;simulationInfo-&gt;realParameter[1565] /* model_a .PRefConst PARAM */ = 14900000.0;
    TRACE_POP
  }
  
  /*
  equation index: 6067
  type: SIMPLE_ASSIGN
  model_a .PRef = model_a .PRefConst
  */
  void modelName_eqFunction_6067(DATA *data, threadData_t *threadData)
  {
    TRACE_PUSH
    const int equationIndexes[2] = {1,6067};
    data-&gt;simulationInfo-&gt;realParameter[1564] /* model_a .PRef PARAM */ = data-&gt;simulationInfo-&gt;realParameter[1565] /* model_a .PRefConst PARAM */;
    TRACE_POP
  }
  
  
  
  </code></pre>
  <p>So that even I chang the value of <code>PRefConst</code> in the <em>_init.xml</em> file, in the end the simulation result shows that even though the <code>PRefConst</code> is correctly changed, however the value of <code>PRef</code> is still 14900000.0, because it is already assigned by the original PRefConst's value in the C code. How can I avoid this? Maybe through some options in <strong>preOptModules</strong> or <strong>postOptModules</strong>?<br />
  My current preOptModules is set to</p>
  <pre><code>setPreOptModules(&quot;normalInlineFunction,expandDerOperator,clockPartitioning,findStateOrder,inlineArrayEqn,encapsulateWhenConditions&quot;)
  </code></pre>