POV-Ray : Newsgroups : povray.general : How to find the maximum value of a function? : Re: How to find the maximum value of a function? Server Time
30 Jul 2024 16:26:25 EDT (-0400)
  Re: How to find the maximum value of a function?  
From: SharkD
Date: 15 Nov 2008 05:40:01
Message: <web.491ea6a6c0004fc9d43c2bae0@news.povray.org>
"triple_r" <nomail@nomail> wrote:
> In general?  I would evaluate it on a sparse grid, then refine that guess with
> something like Powell's method or conjugate gradient.
>
> Here?  The maximum is at (1,0,0), and happens to be equal to 34.5012.
>
>  - Ricky

Thanks for your reply!

The maximum in this particular case can't be 34.5012, as plugging <1,0,0,> into
the function results in a value of 3.808.

I was hoping for a general method that I could apply anywhere, but I see now
that there could possibly be multiple maximums--or no maximum at all!--unless a
strict range were also given. This is not an issue in this case, however, since
the function is not continuous.

Through trial and error I came up with an equation that is pretty close (less
than 1% error in many cases), but is still in need of some work:

#declare max_value = pow(Blob_threshold,-pow(Blob_radius,2))/2 +
pow(Blob_threshold,-pow(Blob_radius,2))/2

-Mike


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.