Hyperbolic Functions series convergence issue

조회 수: 9 (최근 30일)
NILESH PANDEY
NILESH PANDEY 2017년 6월 18일
댓글: NILESH PANDEY 2017년 6월 19일
I'am trying to run a code which has attached with this i'am getting answer as NAN i think the reason behind this is because of term e in this it contains sinh terms as n increases sinh values increases but if i keep x=0 then also it is coming NAN if you see the equation as x=0 then e will be 2*B1*sin(k2*(di+dd-y))/di which i have written as uu in code now after convergence it comes to 1.002(Vbi) which is correct by physics
but again e term is coming NAN because of this phi is coming NAN same goes to x=L or any value of 0<x<L
see the code below
how this can be remove ?
  댓글 수: 1
NILESH PANDEY
NILESH PANDEY 2017년 6월 19일
편집: NILESH PANDEY 2017년 6월 19일
is any thing missing in question? no one replied yet or problem is unsolvable ? also in code i have written x=0:1e-10;L this is a writing mistake i'am declaring x as a vector so x=0:1e-10:L is the right

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2017년 6월 19일
You have
L=120e-9;
[...]
di=5e-9;
[...]
k2=(2*n-1)*pi/(2*di)
[...]
e=e+2*sin(k2*(di+dd-y))*(B1*sinh(k2*(L-x))+B2*sinh(k2*x))/(di*sinh(k2*L));
With di being 5E-9, 2*di is 1E-8, so k2 = 1E8 * (2*n-1) * pi . Multiply that by L = 1.2E-7 and you get 12 * (2*n-1) * pi . When you reach n = 10, that leads you to calculating sinh(12 * 19 * pi), which overflows to infinity. That happens on both the numerator and denominator, leading you to infinity / infinity, which is NaN. That NaN then pollutes the rest of the calculation.
By the time of the overflow, you are probably pretty safe making some approximations on the (B1*sinh(k2*(L-x))+B2*sinh(k2*x))/(di*sinh(k2*L)) . For example you could taylor it, and then get rid of the elements that are going to have no effect. For example,
exp((1199/25)*n*Pi-(1199/50)*Pi)+exp((24*n-12)*Pi)-exp((599/25)*n*Pi-(599/50)*Pi)-1
is completely dominated by the first term, so you can reduce the complexity of the taylored expression.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by