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!
