If you want to define advanced things you need to subclass from
Function rather than using symbols(cls=Function). For derivatives, you
should define fdiff, which should return the derivative of the
function without consideration of the chain rule. For example, search
for "fdiff" in this file to see some examples for exp, log, and
LambertW 
https://github.com/sympy/sympy/blob/master/sympy/functions/elementary/exponential.py.

Aaron Meurer

On Fri, Oct 14, 2016 at 4:53 AM, Riccardo Rossi <rouger...@gmail.com> wrote:
> Dear List,
>
> i am writing since i would like to define the output of the derivative of a
> function, and i don't have a clue of how to achieve it
>
> to explain what i wish to do, let's consider the following script
>
> from sympy import *
>
> u = symbols('u')
> der = symbols('der')
> e = symbols('e', cls=Function)(u)
> s = symbols('s', cls=Function)(e)
> Derivative(e,u) = der #essentially i would like to teach to sympy to use a
> symbol for the Derivative
> ---> but here i get "SyntaxError: can't assign to function call"
>
> print(diff(e,u))
> print(diff(s,e))
> print(diff(s,u)) #here i would like "der" to be replaced within the chain
> rule
>
> any suggestion would be very welcome...
>
> regards
> Riccardo
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/a4511ef2-2a10-4dbe-b6a0-01fe2fc47a05%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2Bn_jrwzkANbe6tSF_EdrM2LeZrFDjEyVLA7puoNvCCuA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to