Opened 9 years ago
Closed 9 years ago
#13096 closed defect (duplicate)
find_maximum_on_interval fails when used with a sage function
Reported by: | aginiewicz | Owned by: | jason, jkantor |
---|---|---|---|
Priority: | minor | Milestone: | sage-duplicate/invalid/wontfix |
Component: | numerical | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | Andrzej Giniewicz | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
The function find_maximum_on_interval fails when used with a sage function that is passed as an argument:
sage: f(x) = sin(x) sage: find_maximum_on_interval(f, 0, 2*pi) Traceback (click to the left of this block for traceback) ... RuntimeError: ECL says: THROW: The catch MACSYMA-QUIT is undefined.
while all of:
sage: find_minimum_on_interval(f, 0, 2*pi) (-1.0, 4.7123889815323858) sage: f.find_minimum_on_interval(0, 2*pi) (-1.0, 4.7123889815323858) sage: f.find_maximum_on_interval(0, 2*pi) (1.0, 1.570796325647202)
works. This was kind of unexpected, esp that documentation says about providing a function as an argument.
Change History (5)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
- Milestone changed from sage-5.1 to sage-duplicate/invalid/wontfix
- Status changed from new to needs_review
Dup of #12032
comment:3 Changed 9 years ago by
- Status changed from needs_review to positive_review
See #2607 also.
comment:4 Changed 9 years ago by
comment:5 Changed 9 years ago by
- Resolution set to duplicate
- Reviewers set to Andrzej Giniewicz
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
I believe this is because find_maximum_on_interval is calling find_minimum_on_interval with lambda z: -f(z) as argument (sage/numerical/optimize.py:127) and doing
just before that should work. Am I right? This might be also related to #3955 (quite old ticket but looks like it proposes a better solution, were there some issues with it, or just no one got into it yet?). If I find enough time to make patch I will post it, but I have to recreate my build environment first (since sage 5.0 does not work with my version of gcc I switched to distribution provided package that is already patched).