Hello all,
someone can help me with this little script??
when I try with this f(x,y):
(x+y-3)*exp(x*y)
it crash!!
I'm a newbie just started learning some script with python.
thank u !!

import sympy
from sympy import *

x = sympy.Symbol('x')
y = sympy.Symbol('y')

f = input("write f(x,y) :")
print "f(x,y): ", f

a = sympy.diff(f, x)
print "La derivata prima in x:"
sympy.pprint(a)

b = sympy.diff(f, y)
print "La derivata prima in y:"
sympy.pprint(b)

z = sympy.diff(a, x)
print "La derivata seconda in xx:"
sympy.pprint(z)

k = sympy.diff(b, y)
print "La derivata seconda in yy:"
sympy.pprint(k)

q = sympy.diff(a, y)
print "La derivata seconda in xy:"
sympy.pprint(q)

u = sympy.diff(b, x)
print "La derivata seconda in yx:"
sympy.pprint(u)

print "I punti critici sono:"
p = sympy.solve([a, b], [x, y])
print p

H = sympy.hessian(f, [x,y])
print "La matrice Hessiana :"
print H

D = H.det()
print "Il determinante dell'Hessiana:"
print D

##here when I run the script:

scrivi la funzione :(x+y-3)*exp(x*y)
hai scritto:  -(3 - x - y)*exp(x*y)
La derivata prima in x:
                 x*y    x*y
- y*(3 - x - y)*e    + e
La derivata prima in y:
                 x*y    x*y
- x*(3 - x - y)*e    + e
La derivata seconda in xx:
     x*y    2              x*y
2*y*e    - y *(3 - x - y)*e
La derivata seconda in yy:
     x*y    2              x*y
2*x*e    - x *(3 - x - y)*e
La derivata seconda in xy:
   x*y      x*y                x*y                    x*y
x*e    + y*e    - (3 - x - y)*e    - x*y*(3 - x - y)*e
La derivata seconda in yx:
   x*y      x*y                x*y                    x*y
x*e    + y*e    - (3 - x - y)*e    - x*y*(3 - x - y)*e
I punti critici sono:
Traceback (most recent call last):
  File "E:\unico_2.py", line 36, in <module>
    p = sympy.solve([a, b], [x, y])
  File "C:\Python25\Lib\site-packages\sympy\solvers\solvers.py", line
272, in solve
    raise NotImplementedError()
NotImplementedError

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to