﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2265	simplify after replace variable	Vitalij Ruge	probably noone	"Simplify missing for {{{der(x1) }}} in

{{{
model missingSimplify

        Real x1(start = 1, fixed = true);
        Real x1_dummy;
        Real x2(start = 1);
        Real x3(start = 1);
equation
        x1_dummy = x1;
        der(x1) = sin(x1_dummy)/x1 - sin(x1)/x1; /*  != 0 (don't work) */
        der(x2) = sin(x1)/x1 - sin(x1)/x1; /* = 0 */
        der(x3) = x1_dummy - x1; /*  = 0 */
end missingSimplify;
}}}

with {{{ der(x2)  = der(x1) }}}. So simplify should work for {{{ der(x1) }}} too.
Here the C code:
{{{
/*
 equation index: 3
 type: SIMPLE_ASSIGN
 
 der(x1) = DIVISION(sin(x1), x1, #SHARED_LITERAL_2(String)#) + DIVISION(-sin(x1), x1, #SHARED_LITERAL_3(String)#)
 */
static void eqFunction_3(DATA *data)
{
  modelica_real tmp0;
  modelica_real tmp1;
  modelica_real tmp2;
  modelica_real tmp3;
  tmp0 = sin($Px1);
  tmp1 = DIVISION(tmp0, $Px1, _OMC_LIT2);
  tmp2 = sin($Px1);
  tmp3 = DIVISION((-tmp2), $Px1, _OMC_LIT3);
  $P$DER$Px1 = (tmp1 + tmp3);
}
}}}


"	enhancement	new	normal	2.0.0	Backend	trunk		simplify, replace	
