[SciPy-User] fsolve with restriction on variable

Chris Colbert sccolbert@gmail....
Mon Aug 3 12:00:32 CDT 2009


you can use one of the constrained solvers here:
http://docs.scipy.org/doc/scipy/reference/optimize.html


On Mon, Aug 3, 2009 at 12:49 PM, Ashley DaSilva<amd405@psu.edu> wrote:
> Hello,
>
> I am using fsolve to solve a function, f(v), v=[x,y,z] is a list of three
> variables. However, I have a factor in f which contains (1-x**2)**(7./2).
> So, when I do the following,
> fsolve(f,x0)
> the code eventually tries x= -1.57, which clearly produces an error in my
> function due to the power 7./2.
>
> I know that the solution for x should be between 0 and 1, is there a way to
> put this restriction on x while using fsolve?
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>


More information about the SciPy-User mailing list