Opened 8 years ago

Closed 7 years ago

#4253 closed defect (fixed)

inverse in OM

Reported by: shabunin_a@… Owned by: Patrick Täuber
Priority: high Milestone: 1.13.0
Component: Backend Version: v1.12.0
Keywords: Cc:

Description (last modified by Martin Sjölund)

Hello.

How I can realize this function:
x = y2, but (-y)2 = -x, sqrt(-x) = -y.

My attempt to make this function in file.

Attachments (1)

reverseTest.onb (1.7 KB ) - added by anonymous 8 years ago.

Download all attachments as: .zip

Change History (5)

by anonymous, 8 years ago

Attachment: reverseTest.onb added

comment:1 by Francesco Casella, 7 years ago

Component: *unknown*Backend
Milestone: Future1.13.0
Owner: changed from somebody to Patrick Täuber
Status: newassigned

I had a look on your example, using OMEdit and the Transformational Debugger.

Point 1, as far as I know, the inverse annotation is still not supported by OMC, so it will just ignored.

Point 2: the Inline annotation has a capital "I", if you write annotation(inline = false))] it will simply be ignored.

Point 3: if you don't put an Inline = false annotation in function x_to_y, the backend somehow tries to inline it and solve it explicitly, but doesn't do it correctly:

(assign) $TMP$VAR$1$0X$ABS := pre(x)
(assign) x := $_signNoNull($TMP$VAR$1$0X$ABS) * abs(y ^ 0.5)

So, a simple solution to your problem is just to add annotation(Inline = false) in x_to_y

@ptaeuber, can you have a look at the wrong solution of the inverse function?

comment:2 by Patrick Täuber, 7 years ago

There was a bug in the variable replacements. After fixing it in OMCompiler/c22c35b the equation cannot be solved explicitly anymore, thus the results are now correct.

comment:3 by Francesco Casella, 7 years ago

shabunin_a@…, please check and close the ticket if everything is fine for you after this fix.

comment:4 by Martin Sjölund, 7 years ago

Description: modified (diff)
Resolution: fixed
Status: assignedclosed
Type: taskdefect

I assume it's fixed and will close this.

Note: See TracTickets for help on using tickets.