code for solving given equations. Eq1 = x == 10-(1.5835*(y^1.7643)); Eq2 = x == (2^y-2)/(0​.3143*(2)^​y+0.3329*(​1.5)^y+0.3​528*(1)^y)​;

1 次查看(过去 30 天)
please provide me the code for solving these 2 equations
Eq1 = x == 10-(1.5835*(y^1.7643));
Eq2 = x == (2^y-2)/(0.3143*(2)^y+0.3329*(1.5)^y+0.3528*(1)^y);

采纳的回答

Davide Masiello
Davide Masiello 2022-10-11
编辑:Davide Masiello 2022-10-11
It seems like MatLab can't find a symbolic solution and returns instead a numerical one
syms x y
Eq1 = x == 10-(1.5835*(y^1.7643));
Eq2 = x == (2^y-2)/(0.3143*(2)^y+0.3329*(1.5)^y+0.3528*(1)^y);
solve([Eq1;Eq2])
Warning: Unable to solve symbolically. Returning a numeric solution using vpasolve.
ans = struct with fields:
x: 1.2828532005832256353146494059188 y: 2.6294109442595236460264103143885
Another way of solving it
f = @(x) [10-(1.5835*(x(2)^1.7643))-x(1);...
(2^x(2)-2)/(0.3143*(2)^x(2)+0.3329*(1.5)^x(2)+0.3528*(1)^x(2))-x(1)];
fsolve(f,[1 1])
Equation solved. fsolve completed because the vector of function values is near zero as measured by the value of the function tolerance, and the problem appears regular as measured by the gradient.
ans = 1×2
1.2829 2.6294

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by