how to solve this non-linear equations?
이전 댓글 표시
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
Walter Roberson
2020년 1월 4일
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
2020년 1월 4일
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
2020년 3월 18일
채택된 답변
추가 답변 (1개)
M.Rameswari Sudha
2020년 12월 11일
편집: Walter Roberson
2020년 12월 11일
댓글 수: 2
Walter Roberson
2020년 12월 11일
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
2020년 12월 18일
카테고리
도움말 센터 및 File Exchange에서 Mathematics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
