1 | initial version |
First, with the newest versions of Sage the domain you create a variable with is propagated to the assumption database so you can say:
var('R r L omega k s', domain='real')
I am not sure how you get to the output you give, I got:
sage: Z(s,L) = s * L
sage: Z.diff(s)
(s, L) |--> L
sage: Z
(s, L) |--> L*s
sage: Z(R,r,L,k,omega,s) = R + I * omega * L + ((s * omega**2 * L**2 * k**2) * (r - I * omega * L)) / (r**2 + omega**2 * s **2 * L**2)
sage: Z.diff(s)
(R, r, L, k, omega, s) |--> -2*(-I*L*omega + r)*L^4*k^2*omega^4*s^2/(L^2*omega^2*s^2 + r^2)^2 + (-I*L*omega + r)*L^2*k^2*omega^2/(L^2*omega^2*s^2 + r^2)
sage: Z
(R, r, L, k, omega, s) |--> (-I*L*omega + r)*L^2*k^2*omega^2*s/(L^2*omega^2*s^2 + r^2) + I*L*omega + R
Also, you say that the derivative should be zero. But that's only the case if s is a constant, no?