Opened 12 years ago
Last modified 12 years ago
#2265 closed enhancement
simplify after replace variable — at Initial Version
| Reported by: | Vitalij Ruge | Owned by: | probably noone |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.9.0 |
| Component: | Backend | Version: | trunk |
| Keywords: | simplify | Cc: | Jens Frenkel |
Description
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);
}
Note:
See TracTickets
for help on using tickets.
