Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am calling

FindRoot[f[x,y],{{x,xInit,xMin,xMax},{y,yInit,yMin,yMax}}]

where for some points {x,y}, f[x,y] is undefined. I now wonder which value f[x,y] should return at {x,y} in order for FindRoot to neglect these points, and to continue searching. Should f maybe return Null or Indeterminate at the critical {x,y}?

Note, that so far I have not added any domain restrictions on f. I also do not know whether adding domain restrictions would be a possibility?

To give some more background: f[x,y] is a composite function of other functions of x and y. For some points {x,y}, bounds for integrals inside these functions become complex, which is nonsensical.

Currently, I throw an error as far as possible down the tree of interdependent functions - call the function where I do this l. Points {x,y} are infeasible if g[x,y]<h[x,y].

l[x_,y_]:=Module[{...},If[g[x,y]<h[x,y],Throw["Error"],Null],...]

However, I am not catching this error properly and FindRoot terminates.

share|improve this question

closed as off-topic by Louis, MarcoB, m_goldberg, Yves Klett, Öskå Jun 29 at 17:00

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – Louis, MarcoB, m_goldberg, Yves Klett, Öskå
If this question can be reworded to fit the rules in the help center, please edit the question.