"drgz " <syrehue@hotmail.com> wrote in message
news:h76033$82s$1@fred.mathworks.com...
> Just got a small question regarding the result after using the finverse()
> function from the Symbolic ath Toolbox.
>
> I'm want to find the inverse function f(x)^(1) of f(x), which is the
> approximation of a Pin/Pout curve for an amplifier (used polyfit() to find
> the coefficients).
>
> p = polyfit(Pin,Pout,n); %Fit and invert curve for Pin vs. Pout
> f = polyval(p,Pin);
> syms x
> fx = p(1)*x^5+p(2)*x^4+p(3)*x^3+p(4)*x^2+p(5)*x+p(6);
> g = finverse(fx, x);
>
> The last line gives the output:
>
> g = RootOf(X1^5  (7491982768887505*X1^4)/7959406428844147 +
> (5364834080844069*X1^3)/15918812857688294 
> (7239056818688443*X1^2)/127350502861506352 +
> (4547589339036133*X1)/1018804022892050816 
> (68719476736*x)/7959406428844147 
> 4939238748794939/8346042555531680284672, X1)
>
> My question; what is X1 here?
If FINVERSE can't determine the inverse of your function (or your function
doesn't have an inverse) and your function is a polynomial, it will return a
RootOf expression, as described in this section from the Mfile help of
FINVERSE in release R2009a.
If no inverse can be found g is either the empty sym object
or, if f is a polynomial, a RootOf expression.
The X1 inside that RootOf expression is a "dummy variable"  the polynomial
inside the RootOf expression needed to be expressed in terms of a variable,
so it chose an arbitrary name that wasn't being used in the toolbox.
> If I find the inverse function of any other "known" function, f(x) (i.e
> tan(x)), the output is given as a function of x, and not another variable.
That's because FINVERSE can find the inverse of tan(x)  but your function
may not have an inverse. I took the data you posted above and I believe I
reconstructed your fx function. I then used EZPLOT to examine your function
and when I zoomed in to look at the section around X1 = 0.05 to X1 = 0.3 I
found multiple X1 values that resulted in the same value of Y. That means
your function is not invertible.

Steve Lord
slord@mathworks.com
comp.softsys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
