solving for a single unknown variable(non-linear equation)

1 次查看(过去 30 天)
E=0.0313; E^2=0.00098; E^3=0.00003;
d=5000; K=100; h=5; lamda=0.5; C=25; S=50; P=0.05;
a=1-E;
b=((2*y)+(y*E)+1))^2;
y=(1/a)*(1/b)*((2*d*S)-(2*d*C)-(2*d*lamda)+(4*D*K)+(2*d*K*E)-(2*h*y^2)+(2*h*y^2*E^2)-(h*y^2*E)+(h*y^2*E^3)-(2*h*y)+(2*h*y*E^2);

回答(1 个)

Ameer Hamza
Ameer Hamza 2020-3-17
编辑:Ameer Hamza 2020-3-17
You need to use fsolve to solve such an equation. First, define a function handle and then use fsolve
E=0.0313;
d=5000; K=100; h=5; lamda=0.5; C=25; S=50; P=0.05;
a=1-E;
b=@(y) ((2*y)+(y*E)+1)^2;
f = @(y) y - (1/a)*(1/b(y))*((2*d*S)-(2*d*C)-(2*d*lamda)+(4*d*K)+(2*d*K*E)-(2*h*y^2)+(2*h*y^2*E^2)-(h*y^2*E)+(h*y^2*E^3)-(2*h*y)+(2*h*y*E^2));
y_solution = fsolve(f, 0);
  2 个评论
shunmugam hemalatha
Thankyou Mr. Ameer Hamza for your response.But still I could't find the solution. Will you please, suggest some other codings.
Ameer Hamza
Ameer Hamza 2020-3-18
Why do you think the solution is incorrect? Check the value of y_solution.

请先登录,再进行评论。

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by