
Solving non linear equation for x
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mayank Sharma
am 10 Dez. 2018
Bearbeitet: Alan Weiss
am 10 Dez. 2018
Solving non linear equation for x
x^2 ln(0.4956/x) = (1-x)^2 ln(0.47198/(1-x)
Can somebody solve this equation for me?
I'm finding little difficulty in this
0 Kommentare
Akzeptierte Antwort
Alan Weiss
am 10 Dez. 2018
Bearbeitet: Alan Weiss
am 10 Dez. 2018
eqn = @(x) x.^2 .* log(0.4956./x) - (1-x).^2 .* log(0.47198./(1-x));
t = linspace(0.01,0.99);
plot(t,eqn(t)) % Shows a single real root in this interval

x = fzero(eqn,[0.01 0.99])
x =
0.5115
No toolboxes needed.
Alan Weiss
MATLAB mathematical toolbox documentation
0 Kommentare
Weitere Antworten (2)
madhan ravi
am 10 Dez. 2018
Bearbeitet: madhan ravi
am 10 Dez. 2018
syms x
x=vpasolve((x.^2.*log(0.4956./x) == (1-x).^2.*log(0.47198./(1-x))))
Gives:
x =
0.52091005935042057378274263984089 - 1.0079858568869724875750086505265i
>>
0 Kommentare
Star Strider
am 10 Dez. 2018
Using the Optimization Toolbox fsolve function:
eqn = @(x) x.^2 .* log(0.4956./x) - (1-x).^2 .* log(0.47198./(1-x));
xval = fsolve(eqn, 10)
produces:
xval =
0.51145093065171 + 9.06147769514677e-09i
0 Kommentare
Siehe auch
Kategorien
Mehr zu Linear Algebra finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!