Find the critical points

  • Thread starter antoniosacchi85
  • Start date
A

antoniosacchi85

someone can help me??
I am new to programing,
but I need to make some script like this:
http://blogs.nyu.edu/blogs/agc282/zia/2008/11/using_python_to_solve_optimiza.html
so th equestion is :
is possible to open it than it ask something and it tell me the
result??
thank you!!
p.s.
this is my hessiana.py:

import sympy as S
x,y=S.symbols('xy')
f=x**4+x**2-6*x*y+3*y**2
a=S.diff(f,x)
S.pprint(a)
b=S.diff(f,y)
S.pprint(b)
S.solve_system([a,b],[x,y])
H=S.hessian(f,[x,y])
M1=S.Matrix([14,-6],[-6,6])
M2=S.Matrix([2,-6],[-6,6])
S.Matrix.berkowitz_minors(M2)
S.Matrix.berkowitz_minors(M1)
 
T

Tim Roberts

someone can help me??
I am new to programing,
but I need to make some script like this:
http://blogs.nyu.edu/blogs/agc282/zia/2008/11/using_python_to_solve_optimiza.html
so th equestion is :
is possible to open it than it ask something and it tell me the
result??

I'm not exactly sure what you're asking. The script as you wrote it works,
but it was designed to be entered from the interactive interpreter, so if
you run it in a script it won't print anything. Basically, just add
"print" in front of the expressions that you want printed:
import sympy as S
x,y=S.symbols('xy')
f=x**4+x**2-6*x*y+3*y**2
a=S.diff(f,x)
S.pprint(a)
b=S.diff(f,y)
S.pprint(b)
S.solve_system([a,b],[x,y])

print S.solve_system([a,b],[x,y])
H=S.hessian(f,[x,y])
M1=S.Matrix([14,-6],[-6,6])
M2=S.Matrix([2,-6],[-6,6])
S.Matrix.berkowitz_minors(M2)
S.Matrix.berkowitz_minors(M1)

print S.Matrix.berkowitz_minors(M2)
print S.Matrix.berkowitz_minors(M1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,297
Messages
2,571,536
Members
48,282
Latest member
Xyprime

Latest Threads

Top