필터 지우기
필터 지우기

Problem with non-linear implicit equation using fsolve

조회 수: 6 (최근 30일)
Nikolaos Barmpatsalos
Nikolaos Barmpatsalos 2022년 9월 15일
편집: John D'Errico 2022년 9월 15일
Hi guys,
I am trying to solve the following implicit equation using fsolve.
L = ( (B./sinh(a.*A.*L-B.*R)) - bmin) ./ (bmax-bmin);
I am trying to solve for L.
A, B are array inputs (A is in the 10^-3 range and B is [0:0.05:2.5])
a = 1.5
R = 190
bmax = 0.0024139
bmin = 9.779e-10
The expected L (blue points in graph) should be around 0.9. However, I get values in the range of 10^-7.
I am using the following script:
anonFun = @(L,B,A) L -(((B./sinh(a.*A-B.*R)) - bmin)./(bmax-bmin));
guess = 1;
for i = 1:numel(input{1}(:,1))
fun = @(lamda) los(lamda,input{1}(i,2),input{1}(i,1));
sol(i) = fsolve(lostos,guess);
guess = sol(i);
end
In the graph below you can see the desired answer in blue and the one I'm getting in orange.
Could you please tell me what's wrong with it?
Thank you for your time!

답변 (1개)

John D'Errico
John D'Errico 2022년 9월 15일
편집: John D'Errico 2022년 9월 15일
a = 1.5;
R = 190;
bmax = 0.0024139;
bmin = 9.779e-10;
Since you do not tell us the values of A and B, only the range, I'll pick some numbers in that range.
B = 1;
A = 1e-3;
fun = @(L) L - ( (B./sinh(a.*A.*L-B.*R)) - bmin) ./ (bmax-bmin);
fplot(fun)
grid on
xlabel L
Now, to me, it looks like something very near zero is quite reasonable for L.
What did the solver produce? AMAZING! Something generally near zero.
Do you have the wrong equation? Perhaps. But that is something we cannot know.

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by