bugGNU Octave - Bugs: bug #53576, [octave forge] (symbolic) dsolve...


bug #53576: [octave forge] (symbolic) dsolve errors on sqrt coefficient

Submitted by:  Doug Stewart <dastew>
Submitted on:  Fri 06 Apr 2018 04:24:39 PM UTC  
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  1 - Later Item Group:  Unexpected Error
Status:  Postponed Assigned to:  None
Originator Name:  Doug Stewart Open/Closed:  Open
Release:  4.2.2 Operating System:  GNU/Linux

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


( Jump to the original submission)

Thu 22 Nov 2018 08:36:01 AM UTC, comment #7: 

should be fixed in the next sympy 1.4, can be closed

Colin Macdonald <cbm>
Mon 09 Apr 2018 09:55:39 PM UTC, comment #6: 

I've filed https://github.com/cbm755/octsympy/issues/883 with a Python example showing the same error. One of us will chase this up to SymPy.

Mike Miller <mtmiller>
Project Administrator
Fri 06 Apr 2018 06:51:27 PM UTC, comment #5: 

I would like to see it fixed in sympy.
I think that sqrt(2)  is used in so many places that any symbolic code should handle it.

Doug Stewart <dastew>
Fri 06 Apr 2018 06:07:01 PM UTC, comment #4: 

Should I close this as not-a-bug or do you think we should pursue getting this error fixed in SymPy?

Mike Miller <mtmiller>
Project Administrator
Fri 06 Apr 2018 06:03:27 PM UTC, comment #3: 

Mike you are correct. thanks for looking at this.
I will change the wiki to
 de =diff(y, 3 ) +sqrt2*diff(y,2) + diff(y) == 0;

Doug Stewart <dastew>
Fri 06 Apr 2018 05:47:38 PM UTC, comment #2: 

In version 2.5.0, if the equation was written as

de = diff (y, 3) + sqrt (sym(2)) * diff (y,2) + diff (y) == 0;

then it would have failed with the same error. Thus I am changing this from regression.

Mike Miller <mtmiller>
Project Administrator
Fri 06 Apr 2018 05:41:36 PM UTC, comment #1: 

I think the relevant piece that has changed here is that the symbolic package now tries to work around any floating point values it sees by applying various heuristics to convert it into a symbolic expression.

In version 2.5.0, the DE was converted into this symbolic expression, with a rational approximation to sqrt(2):

de = (sym)

                    2           3
  d               dx           d
  ──(y(x)) + ────────────── + ───(y(x)) = 0
  dx              985           3

In the current symbolic 2.6.0, it is

de = (sym)

                  2           3
  d              d           d
  ──(y(x)) + √2⋅───(y(x)) + ───(y(x)) = 0
  dx              2           3
                dx          dx

And the sqrt(2), which wasn't there before, seems to be where SymPy's dsolve is erroring.

If you convert the coefficient to some other number, it will work again. It would be best to show an example with all integer or rational coefficients.

Mike Miller <mtmiller>
Project Administrator
Fri 06 Apr 2018 04:24:39 PM UTC, original submission:  

running this code from octave wiki symbolic demos now fails.

 syms y(x)
de =diff(y, 3 ) +sqrt(2)*diff(y,2) + diff(y) == 0;
f = dsolve(de, y(0) == 0, diff(y,1)(0) == 0 , diff(y,2)(0) == 1)
grid minor on

with this error:

OctSymPy v2.6.0: this is free software without warranty, see source.
Initializing communication with SymPy using a popen2() pipe.
Some output from the Python subprocess (pid 3852) might appear next.
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> >>>
OctSymPy: Communication established.  SymPy v1.1.1.
>> testsym111
warning: passing floating-point values to sym is dangerous, see "help sym"
warning: called from
    double_to_sym_heuristic at line 50 column 7
    sym at line 373 column 13
    mtimes at line 65 column 5
    mtimes at line 61 column 5
    testsym111 at line 18 column 6
error: Python exception: NotImplementedError: CRootOf is not supported over EX
    occurred at line 2 of the Python code block:
error: called from
    python_cmd at line 179 column 7
    dsolve at line 200 column 10
    testsym111 at line 19 column 4

I am using ubuntu 16.04

Doug Stewart <dastew>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by cbm (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by dastew (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-04-09 mtmiller Priority5 - Normal => 1 - Later
        StatusNone => Postponed
    2018-04-06 mtmiller Item GroupRegression => Unexpected Error
    2018-04-06 mtmiller SummarySymbolic pkg dsolve now not woeking => [octave forge] (symbolic) dsolve errors on sqrt coefficient

    Back to the top

    Powered by Savane 3.5