New to Matlab - need help with rearranging equation
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have the following equation that I would like to rearrange so that "q" is the subject
w = (0-((p*10)-1000*q^(n-1))/((x-1)*q^(n-1)+((1-q^n)/(1-q))))*((c/100) + 1)
Can this be done in Matlab?
I have tired the following:
syms p q n x c w
eqn=((0-((0*10)-1000*q^(n-1))/((x-1)*q^(n-1)+((1-q^n)/(1-q))))*((c/100) + 1)-w==0)
eqn = rewrite(eqn,'log');
solq = solve(eqn, q, 'IgnoreAnalyticConstraints',1)
However this returns an error:
Warning: Unable to find explicit solution. For options, see help.
0 Kommentare
Antworten (2)
John D'Errico
am 16 Okt. 2020
Bearbeitet: John D'Errico
am 16 Okt. 2020
There was NO error returned. It was a WARNING, that while you want to find a solution, none could be found. There are many things in life we may want, but just wanting is not enough to insure something will exist.
In fact, it is pretty easy to show that for general unknown values of the parameters, especially n, no explicit solution interms of radicals will exist as an algebraic expression.
So no, MATLAB cannot solve that problem. But then, neither can any other tool. You cannot solve what is impossible to solve. In fact, it is amazingly easy to write an expression for which no solution can exist. You just did.
If you KNOW numerical values for all of the parameters, thus p,n,x,c,w, then you can supply them, and use a numerical solver. This would be either vpasolve or fzero, although fsolve could also be used. fzero or vpasolve would be better choices.
0 Kommentare
Jesús Zambrano
am 16 Okt. 2020
Hi Philip,
You are right with your approach. I'm afraid there is not explicit solution of this equation for 'q'.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!