Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!jato!kalessin!sam From: sam@kalessin.jpl.nasa.gov (Sam Sirlin) Newsgroups: comp.lang.apl Subject: Re: WANTED: APL maximization function Message-ID: <1991Mar31.212330.28955@jato.jpl.nasa.gov> Date: 31 Mar 91 21:23:30 GMT References: <20114@brahms.udel.edu> Sender: news@jato.jpl.nasa.gov Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 18 Nntp-Posting-Host: kalessin.jpl.nasa.gov In article <20114@brahms.udel.edu> fmaster@brahms.udel.edu (Fred A Masterson) writes: >I am seeking an APL function that will maximize a function of >one variable, i.e., find the value of x that maximizes f(x). To do this once, a simple plot is pretty powerful. To automate this, you need to decide a bunch of things such as - is the function differentiable (analytically or numerically) to some order? - is there a single maximum (no local maxima)? - do you know a priori bounds on a (finite) region that contains the desired maxima? Given the last condition, a simple binary search works pretty fast and is simple to code (I have one somewhere). Sam Sirlin Jet Propulsion Laboratory sam@kalessin.jpl.nasa.gov