#3707 closed defect (fixed)
Handle roots of negative values don't work well
Reported by: | Vitalij Ruge | Owned by: | Lennart Ochel |
---|---|---|---|
Priority: | high | Milestone: | 1.9.4 |
Component: | Code Generation | Version: | v1.9.4-dev-nightly |
Keywords: | Cc: |
Description
e.g.
model assertPow parameter Real Null = 0; Real pow1 = Null^(-0.1); Real pow2 = (-abs(sin(time*10)/2))^(-0.1); end assertPow;
simulate without assert or warnings.
I would expect some assert/warning
A test(s) for the extra lines are missing.
Change History (12)
follow-up: 2 comment:1 by , 9 years ago
comment:2 by , 9 years ago
Replying to lochel:
Is this just about to handle
0^x
withx < 0
?
Why pow1 inside the model 0^(-0.1)
return no assert?
I guess inf == inf is true.
BTW. In this case you should move this check inside the first "if case", where you check already has a check for 0^x
with x < 0
.
comment:6 by , 9 years ago
I have see you PR.
I mean you will have issues with:
model powAssert Real pow2 = (-abs(cos(time*10)/2))^(-0.1); end assertPow;
comment:7 by , 9 years ago
Of the other hand:
model tets parameter Real one = 1; Real pow2 = (-one)^(1/3); end tets;
will return same error in other modelica tool.
comment:9 by , 9 years ago
I don't know the right strategie, but this has some potencial for solver issues with e.g. bad startvalues.
comment:10 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed with cb732fc280ac2d8940713d8a104c18952a0634da/OMCompiler.
Tests added with PR203.
Is this just about to handle
0^x
withx < 0
?