Ticket #9421: trac_9421.patch

File trac_9421.patch, 1012 bytes (added by Paul Zimmermann, 9 years ago)
  • sage/calculus/desolvers.py

    # HG changeset patch
    # User Paul Zimmermann <zimmerma@loria.fr>
    # Date 1377437070 -7200
    # Node ID 472e6238d4d4282266b7f9c6ef9065227eb54458
    # Parent  50e4bca6dc56b9e512897136e60dd9a5caa23133
    #9421: desolve mixes user parameters and integration constants
    
    diff --git a/sage/calculus/desolvers.py b/sage/calculus/desolvers.py
    a b  
    421421            raise ValueError("Unable to determine independent variable, please specify.")
    422422        ivar = ivars[0]
    423423    def sanitize_var(exprs):
    424         return exprs.replace("'"+dvar_str+"("+ivar_str+")",dvar_str)   
     424        return exprs.replace("'"+dvar_str+"("+ivar_str+")",dvar_str)
     425    # print a warning if the equation contains c (see #9421, #6882, #8734)
     426    if 'c' in map(str,de.variables()):
     427       print "Warning: equation contains 'c', might be confused with integration constant 'c' from Maxima"
    425428    de00 = de._maxima_()
    426429    P = de00.parent()
    427430    dvar_str=P(dvar.operator()).str()