questions about solving equations in scipy

fdu.xiaojf at gmail.com fdu.xiaojf at gmail.com
Tue Jun 12 13:12:48 EDT 2007


Hi all,

I have two questions about scipy.

1) When I was trying to solve a single variable equations using scipy, I
found two methods: scipy.optimize.fsolve, which is designated to find the
roots of a polynomial, and scipy.optimize.newton, which is used for Scalar
function root finding according to the help().

I have tried both, and it seemed that both worked well, and fsolve ran
faster.

My questions is, which is the right choose ?

2) I have to solve a linear equation, with the constraint that all
variables should be positive. Currently I can solve this problem by
manually adjusting the solution in each iteration after get the solution
bu using scipy.linalg.solve().

Is there a smart way ?

Thanks in advance.

Xiao Jianfeng



More information about the Python-list mailing list