0

I have a problem with form similar to the following:

I have a set of equations that is f(x, y) = 0. For each x, I can use FindRoot to find a value of y. Suppose I want to select the x such that the implied value of y is minimises something like (y- y*)^2.

I feel like I want to combine NMinimize or FindMinimum with FindRoot but have difficulty achieving this.

  • Similar (combining numeric functions): https://mathematica.stackexchange.com/q/333. See also https://mathematica.stackexchange.com/a/26037. – Michael E2 Feb 26 '18 at 12:14

1 Answers1

3

Without information about y* you could solve your problem in one step using NMinimize:

NMinimize[{(y-ystar)^2,f[x,y]==0},{x,y}]
Michael E2
  • 235,386
  • 17
  • 334
  • 747
Ulrich Neumann
  • 53,729
  • 2
  • 23
  • 55