How to find constants when 2 equations are equal?
Show older comments
Hi there! I have a function of (x) (and it's polynomial,degree=5) and I want to make it equal to "c1*exp(c2*x)". How can I find these two constants???? I would appreciate your helps...
Accepted Answer
More Answers (1)
Walter Roberson
on 31 May 2016
You cannot get out any meaningful results if you are working with a single x. In such a case the exact solution is
c2 = ln(a5*x^5+a4*x^4+a3*x^3+a2*x^2+a1*x+a0-c1)/x
so as you change c1, c2 changes as well, and for any given x you can force c2 to become imaginary (by using a large enough c1 that the polynomial minus c1 becomes negative, leading to ln() of a negative number.
For any two given x = x1, x2, you would have
c1 = a5*x2^5+a4*x2^4+a3*x2^3+a2*x2^2+a1*x2-exp(RootOf(exp(Z)-a5*x2^5-a4*x2^4-a3*x2^3-a2*x2^2-a1*x2+a5*x1^5+a4*x1^4+a3*x1^3+a2*x1^2+a1*x1-exp(Z*x1/x2)),Z)+a0
c2 = RootOf(exp(Z)-a5*x2^5-a4*x2^4-a3*x2^3-a2*x2^2-a1*x2+a5*x1^5+a4*x1^4+a3*x1^3+a2*x1^2+a1*x1-exp(Z*x1/x2),Z)/x2
here, RootOf(f(Z),Z) means the set of Z such that f(Z) becomes 0 -- the roots of the expression. You can see that the values you calculate would be very much tied up to the exact values of x1 and x2.
If you were hoping to take a series of values for the polynomial and fit the best c1, c2 for the entire series, then the result is going to depend a lot on which values you fit against.
Categories
Find more on Polynomials 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!