I want to find point B on a surface in R3 with an algebraic expression
f(x,y) = x^3 + y^2,
given point A, so that point B is closest in Euclidean distance, and lies on the surface. [Please note that the surface on the plot is not x^3 + y^2, and it is for illustrative purposes only].
I am not a Matlab user, but I see that the function fmincon or fminsearch may be the way to go as suggested in this online accessible paper by J. BAEK, A. DEOPURKAR, AND K. REDFIELD (p. 24, Appendix). Alternatively I thought of parameterizing a sphere by its radius around the point A, and looking for its first tangent point to the surface, but that would spawn many more questions.
For fmincon it seems like the first order of things is to define a function to minimize, and that would be mathematically the Euclidean distance: So if point A is in a matrix, and corresponds to A(:,1) and B is defined as (b1,b2,b3), the formula to minimize would be
(A(1,1) - b1)^2 + (A(2,1) - b2)^2 + (A(3,1) - b3)^2
As in the first comment, since B has to be on the surface, the constraining condition would be
b3= b1^3 + b2^2.
I don't know how to formalize this in Matlab, and whether I would need for some initial point to start the process, or A is a valid starting point.