|
![](/i/fill.gif) |
"SharkD" <nomail@nomail> wrote:
> I have defined a function (function "fn_E", below) and would like to determine
> a. the maximum possible value of the function, and b. the coordinates where the
> maximum occurs. How can I accomplish this?
>
> Thanks!
>
> -Mike
>
> #declare Blob_threshold = 0.2;
> #declare Blob_start = 1;
> #declare Blob_radius = 1;
> #declare fn_A = function { pow(x+1,2) + pow(y,2) + pow(z,2) - pow(Blob_radius,2)
> };
> #declare fn_B = function { pow(x-1,2) + pow(y,2) + pow(z,2) - pow(Blob_radius,2)
> };
> #declare fn_C = function { Blob_start + Blob_threshold }
> #declare fn_D = function { pow(Blob_threshold, fn_A(x,y,z)) +
> pow(Blob_threshold, fn_B(x,y,z)) - fn_C(x,y,z) };
> #declare fn_E = function { max(0,fn_D(x,y,z)) };
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
Post a reply to this message
|
![](/i/fill.gif) |