I have a user-defined function that doesn't seem to work with NMinimum, FindMinimum, or any of the other optimization commands. I think this is due to the fact that the function uses elliptic integrals and matricies to obtain an output. It has multiple variables, but I want to keep them all constant and minimize one. Does anyone know how to minimize ANY function? We'll just treat it as a black box, receiving inputs and producing outputs.(adsbygoogle = window.adsbygoogle || []).push({});

Oh, and also, the domain of the function is constricted. I don't know how to calculate the domain of the function either.

I've tried using a gradient search method already. I find the gradient at a point by calculating two points and doing it the old-fashioned way. Then I subtract the gradient from its point to get a new point. I keep searching this way until the gradient is relatively small (.000001). However, the code breaks a good deal because when the gradient is extremely large, this sends the calculated, new point out of the function's domain, and everything goes haywire.

Any thoughts? If there was simply a way to determine the function's domain that would be helpful too. Thanks!!!

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Mathematica: minimize black box function

Loading...

Similar Threads - Mathematica minimize black | Date |
---|---|

Mathematica Cannot do the integral of the Hyper-geometric function? | Mar 11, 2018 |

Mathematica Cannot Plot This Function in Mathematica | Feb 26, 2018 |

Mathematica While Loop in Mathematica | Feb 25, 2018 |

Mathematica Mathematica Real Part | Feb 24, 2018 |

Minimization help in mathematica | Mar 25, 2009 |

**Physics Forums - The Fusion of Science and Community**