[SciPy-User] fsolve with restriction on variable

Ashley DaSilva amd405 at psu.edu
Mon Aug 3 13:24:40 EDT 2009


Thanks for the reply.

I see that there are some constrained optimization techniques, but I don't
want to find the minimum/maximum of my function, I want to find the root. I
also see that there are some scalar root finding techniques that allow
constraints (brentq,brenth,ridder,bisect). But my function is multivariate,
so these will not work for me.



On Mon, Aug 3, 2009 at 1:00 PM, Chris Colbert <sccolbert at gmail.com> wrote:

> 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 at 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 at scipy.org
> > http://mail.scipy.org/mailman/listinfo/scipy-user
> >
> >
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20090803/11183a3c/attachment.html>


More information about the SciPy-User mailing list