Ticket #10682: trac_10682-reviewer-local.patch

File trac_10682-reviewer-local.patch, 5.4 KB (added by jpflori, 10 years ago)

Reviewer patch

  • sage/calculus/calculus.py

    # HG changeset patch
    # User Jean-Pierre Flori <jean-pierre.flor@ssi.gouv.fr>
    # Date 1331113422 -3600
    # Node ID 834ac6c5ef93e143a2ad4c968adccc66c1016c4e
    # Parent  0a84cd9c2c97b45d3bf8e2e8a10d337f7139b98f
    #10682: Reviewer patch
    * corrected typos
    * removed trailing whitespaces
    * split long lines
    * put back removed remark about precision
    * modified doctest for n-th roots
    
    diff --git a/sage/calculus/calculus.py b/sage/calculus/calculus.py
    a b  
    632632      - ``5`` - integral is probably divergent or slowly
    633633        convergent
    634634
    635       - ``6`` - the input is invalid; this includes the case of desired_relative_error
    636         being too small to be achieved
     635      - ``6`` - the input is invalid; this includes the case of
     636                desired_relative_error being too small to be achieved
    637637
    638638    ALIAS: nintegrate is the same as nintegral
    639639
     
    642642    integration using the GSL C library. It is potentially much faster
    643643    and applies to arbitrary user defined functions.
    644644
     645    Also, there are limits to the precision to which Maxima can compute
     646    the integral due to limitations in quadpack.
     647    In the following example, remark that the last value of the returned
     648    tuple is ``6``, indicating that the input was invalid, in this case
     649    because of a too high desired precision.
     650
    645651    ::
    646652
    647653        sage: f = x
     
    716722        else:
    717723            raise TypeError, err
    718724
    719     #This is just a work around until there is a response to
    720     #http://www.math.utexas.edu/pipermail/maxima/2008/012975.html
     725    # Maxima returns unevaluated expressions when the underlying library fails
     726    # to perfom numerical integration. See:
     727    # http://www.math.utexas.edu/pipermail/maxima/2008/012975.html
    721728    if 'quad_qags' in str(v):
    722729        raise ValueError, "Maxima (via quadpack) cannot compute the integral"
    723730
  • sage/calculus/desolvers.py

    diff --git a/sage/calculus/desolvers.py b/sage/calculus/desolvers.py
    a b  
    359359        sage: desolve(x*diff(y,x)-x*sqrt(y^2+x^2)-y == 0, y, contrib_ode=True)
    360360        [x - arcsinh(y(x)/x) == c]
    361361
    362     Trac #10682 updated Maxima to 5.26, and it started to show a different solution in the complex domain for the ODE above::
     362    Trac #10682 updated Maxima to 5.26, and it started to show a different
     363    solution in the complex domain for the ODE above::
    363364
    364         sage: sage.calculus.calculus.maxima('domain:complex')  # back to the dafault, complex, domain
     365        sage: sage.calculus.calculus.maxima('domain:complex')  # back to the default complex domain
    365366        complex
    366367        sage: desolve(x*diff(y,x)-x*sqrt(y^2+x^2)-y == 0, y, contrib_ode=True)
    367         [1/2*(2*x^2*sqrt(x^(-2)) - 2*x*sqrt(x^(-2))*arcsinh(y(x)/sqrt(x^2)) 
    368         - 2*x*sqrt(x^(-2))*arcsinh(y(x)^2/(sqrt(y(x)^2)*x)) 
    369         + log(4*(2*x^2*sqrt((x^2*y(x)^2 + y(x)^4)/x^2)*sqrt(x^(-2)) + x^2 + 2*y(x)^2)/x^2))/(x*sqrt(x^(-2))) == c] 
     368        [1/2*(2*x^2*sqrt(x^(-2)) - 2*x*sqrt(x^(-2))*arcsinh(y(x)/sqrt(x^2))
     369        - 2*x*sqrt(x^(-2))*arcsinh(y(x)^2/(sqrt(y(x)^2)*x))
     370        + log(4*(2*x^2*sqrt((x^2*y(x)^2 + y(x)^4)/x^2)*sqrt(x^(-2)) + x^2 + 2*y(x)^2)/x^2))/(x*sqrt(x^(-2))) == c]
    370371
    371372    Trac #6479 fixed::
    372373
  • sage/calculus/wester.py

    diff --git a/sage/calculus/wester.py b/sage/calculus/wester.py
    a b  
    383383::
    384384
    385385    sage: # (YES) Assuming Re(x)>0, Re(y)>0, deduce x^(1/n)*y^(1/n)-(x*y)^(1/n)=0.
    386     sage: # Maxima 5.26 does not do "just" simpify() here. Thus simplify_exp() used.
    387     sage: # assume(real(x) > 0, real(y) > 0) # (not needed for simplify_exp())
    388     sage: n = var('n');
     386    sage: # Maxima 5.26 has different behaviours depending on the current
     387    sage: # domain.
     388    sage: # To stick with the behaviour of previous versions, the domain is set
     389    sage: # to 'real' in the following.
     390    sage: # See Trac #10682 for further details.
     391    sage: n = var('n')
    389392    sage: f = x^(1/n)*y^(1/n)-(x*y)^(1/n)
    390     sage: f.simplify_exp()
     393    sage: assume(real(x) > 0, real(y) > 0)
     394    sage: f.simplify()
     395    x^(1/n)*y^(1/n) - (x*y)^(1/n)
     396    sage: maxima = sage.calculus.calculus.maxima
     397    sage: maxima.set('domain', 'real') # set domain to real
     398    sage: f.simplify()
    391399    0
     400    sage: maxima.set('domain', 'complex') # set domain back to its default value
    392401    sage: forget()
    393402
    394403::
  • sage/symbolic/relation.py

    diff --git a/sage/symbolic/relation.py b/sage/symbolic/relation.py
    a b  
    486486        sage: solve([x+y==6, x-y==4], x, y)
    487487        [[x == 5, y == 1]]
    488488        sage: solve([x^2+y^2 == 1, y^2 == x^3 + x + 1], x, y)
    489         [[x == -1/2*I*sqrt(3) - 1/2, y == -sqrt(-1/2*I*sqrt(3) + 3/2)], 
    490          [x == -1/2*I*sqrt(3) - 1/2, y == sqrt(-1/2*I*sqrt(3) + 3/2)], 
    491          [x == 1/2*I*sqrt(3) - 1/2, y == -sqrt(1/2*I*sqrt(3) + 3/2)], 
    492          [x == 1/2*I*sqrt(3) - 1/2, y == sqrt(1/2*I*sqrt(3) + 3/2)], 
    493          [x == 0, y == -1], 
     489        [[x == -1/2*I*sqrt(3) - 1/2, y == -sqrt(-1/2*I*sqrt(3) + 3/2)],
     490         [x == -1/2*I*sqrt(3) - 1/2, y == sqrt(-1/2*I*sqrt(3) + 3/2)],
     491         [x == 1/2*I*sqrt(3) - 1/2, y == -sqrt(1/2*I*sqrt(3) + 3/2)],
     492         [x == 1/2*I*sqrt(3) - 1/2, y == sqrt(1/2*I*sqrt(3) + 3/2)],
     493         [x == 0, y == -1],
    494494         [x == 0, y == 1]]
    495495        sage: solve([sqrt(x) + sqrt(y) == 5, x + y == 10], x, y)
    496496        [[x == -5/2*I*sqrt(5) + 5, y == 5/2*I*sqrt(5) + 5], [x == 5/2*I*sqrt(5) + 5, y == -5/2*I*sqrt(5) + 5]]