Opened 7 years ago

Last modified 3 years ago

#4630 new defect

Rethink mathematical simplifications — at Version 1

Reported by: hkiel Owned by: somebody
Priority: high Milestone:
Component: *unknown* Version: v1.13.0-dev-nightly
Keywords: Cc: sjoelund.se, casella, ptaeuber, lochel, wbraun, vwaurich

Description (last modified by hkiel)

I propose to have in this ticket a list of (more complex) mathematical simplifications to be implemented in OMC (ExpressionSimplify).

To quote sjoelund.se from github discussion:

acos(cos(x)) is not equal to x...
For example acos(cos(13)) = 0.4336293856408271

And cos(acos(13)) is an error, not 13...

acos(cos(x)) could be mod(x, pi)?

The same argumentation holds for typical math simplification
e^(ln(x)) = x which is an error for x<0

always correct simplifications

  • ln(ex) = x
  • sin2(x)+cos2(x) = 1
  • cosh2(x) - sinh2(x) = 1
  • sin(acos(x)) = sqrt(1-x2)
  • cos(asin(x)) = sqrt(1-x2)

problematic simplifications

  • asin(sin(x)) = ?
  • tan(atan(x) = ?
  • atan(tan(x)) = ?
  • sin(asin(x)) = ?
  • acos(cos(x)) = mod(x, pi) -> is wrong, it is a triangle function
  • asin(sin(x)) is shifted triangle function

incorrect simplifications

  • cos(acos(x)) = x (only true for -1<=x<=1)
  • sin(asin(x)) = x (only true for -1<=x<=1)
  • eln(x)= x (only true for x>0)

Change History (1)

comment:1 Changed 7 years ago by hkiel

  • Description modified (diff)
Note: See TracTickets for help on using tickets.