#16007: give solution constants of ODEs unique names
-------------------------------------+-------------------------------------
       Reporter:  rws                |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.3
      Component:  calculus           |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Ralf Stephan       |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/rws/ticket/16007                 |  92a3fa3739fb069939c741cb310a0ba3cddad9fe
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by kcrisman):

 > > We ''might'' prebind `_C` etc. if someone thinks it's too difficult
 for users otherwise.
 > I would like to. How would I do it?
 I think my point is that presumably if one then retyped the answer, or
 tried to use it somehow, one would get an error about an undefined
 variable.
 {{{

 sage: var('d')
 d
 sage: y=function('y',x); eq=diff(y,x)==d*x; eq
 D[0](y)(x) == d*x
 sage: desolve(eq,y,ivar=x)
 1/2*d*x^2 + c
 sage: c
 ---------------------------------------------------------------------------
 NameError                                 Traceback (most recent call
 last)
 <ipython-input-4-2cd6ee2c70b0> in <module>()
 ----> 1 c

 NameError: name 'c' is not defined
 }}}
 That said,
 {{{

 sage: D = desolve(eq,y,ivar=x)
 sage: D.subs(c=3)
 1/2*d*x^2 + 3
 }}}
 works.  So I would be comfortable with very good documentation or
 something ahead of time - and Nils' comment indicates that better
 documentation for how to use these is best.

--
Ticket URL: <http://trac.sagemath.org/ticket/16007#comment:23>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to