how to solve this non-linear equations?
Show older comments
I couldnot find the value of v and w. let me know what is the mistake in the following code.
function solveeqs()
guess=[200 110];
[result,fval,exit,output]= fsolve(@eqns,guess);
result
fval
eqns(guess)
output
end
function fcns=eqns(z)
v=z(1);
w=z(2);
p=30;d=1;lamda=0.8;c=10;r=35;h=0.05;chi=1000;k=0.02;b=7;a =0.01;T =107;
%w=k*(1-exp(-a*chi));
M=k*a;
fcns(1)=(1/T)*[p*d-((lamda*p*d*v)/T)-(d*exp(-(w-k)*v)-(d*v/T))*c-d*((v/T)-1)*r-(d/(w-k))*(1-exp(-(w-k)*v)*h)];
fcns(2)=(1/T)*[-(d*c*v*exp(-(w-k)*v)*M/(w-k))+(((d*c*(1-exp(-(w-k)*v))+h*d*v*(1+exp(-(w-k)*v)))*M)/(w-k)^2)+((2*h*d*(exp(-(w-k)*v)-1)*M)/(w-k)^3)-1];
end
3 Comments
Walter Roberson
on 4 Jan 2020
There are 5 solutions (at least)
v w
-28.10280187792797 0.03473301045167086
-16.2096524070405 0.1370974840938061
16.18891302817524 -0.09423693954485336
41.33934474242945 0.04322111411337436
98.16780448047724 0.07005372591592726
John D'Errico
on 4 Jan 2020
Please don't use an answer to make a comment.
"how do u get ? I didnot get the answer. let me know what is the mistake made by me"
M.Rameswari Sudha
on 18 Mar 2020
Accepted Answer
More Answers (1)
M.Rameswari Sudha
on 11 Dec 2020
Edited: Walter Roberson
on 11 Dec 2020
2 Comments
Walter Roberson
on 11 Dec 2020
You should start a new Question for this.
When you do, you should add more documentation as to what you are trying to solve.
for i=1:length(R1)
M1=(S*(r*Cp-(1-2*D/P)*r*Cv))/((A+R1(i))*(r*Cv*(1-D/P)+g*D*th0));
M(j)=M1;
j=j+1;
end
Why are you not just using
for i=1:length(R1)
M1=(S*(r*Cp-(1-2*D/P)*r*Cv))/((A+R1(i))*(r*Cv*(1-D/P)+g*D*th0));
M(i)=M1;
end
with no j ?
M.Rameswari Sudha
on 18 Dec 2020
Categories
Find more on Systems of Nonlinear Equations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!