inverting variables with two matrices

1 view (last 30 days)
Rocco
Rocco on 12 Mar 2011
Answered: John D'Errico on 2 Apr 2020
I have two matrices of scattered data describing two quantities as a function of two variables as such:
g = f(x,y)
h = f(x,y)
The resulting surfaces are smooth and increasing (pic links below).
My goal is to invert the system so as to have two new matrices that represent this:
x = f(g, h)
y = f(g, h)
I have been unable to fit the data with any simple equation that would allow me to invert algebraically, so I thought there may be a way I could do it by manipulating the matrices.
any advice?

Answers (1)

John D'Errico
John D'Errico on 2 Apr 2020
Too late to be of any value to the OP, but others may have the same question...
In general, if you have LINEAR surfaces, thus perfectly planar relations, then the solution you desire will also have been simple. However, by your own statement, while the surfaces were "smooth", you could also not fit them. That invalidates the planarity requirement above.
As such, you have non-planar data, representing two nonlinear functions. The "inverse" you desire to see produced may be arbitrarily complex. And all you have is data, not even functions, just a list of numbers repersenting points on those surfaces. (I cannot see the surfaces, as they have since been purged from the internet.)
The inverse relationship you desire would require you to find some functional form for each surface. It might be an interpolation tool, one that could handle scattered data. Then for any value of g and h, you would solve for the solution(s) to your problem.
Note that I said solution(s), since there will often be multiple solutions to any nonlinear system. That means the inverse relationship you desire need not have a unique solution.
A common and good approach to such problems lies in the use of contour plots, which at least allow a graphical solution.
For example, if you wish for the solution of
g0 = g(x,y)
h0 = h(x,y)
for known values of g0 and h0, then generate contour plots for the pair of surfaces, at those levels. Where the contour lines intersect are your desired solutions. For scattered data, that will force you to use tools for contouring scattered data. There are several to be found on the File Exchange.

Categories

Find more on Contour Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!