devi method of finding root

조회 수: 3 (최근 30일)
unhappy
unhappy 2013년 10월 14일
편집: unhappy 2013년 12월 6일
plz find the attachment and
help me in executing this program
  댓글 수: 4
sixwwwwww
sixwwwwww 2013년 10월 14일
I have few questions here:
  • Why you defining symbols when you are not using them
syms a b
x = a + 1j * b
  • What user can input in this line: (give some example input)
f = input('enter function in terms of x=');
unhappy
unhappy 2013년 10월 14일
actually iam new to this software.
it should b like complex form like a+ij*b i.e x^2+log(x)*1i

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

채택된 답변

sixwwwwww
sixwwwwww 2013년 10월 14일
편집: sixwwwwww 2013년 10월 14일
Dear Unhappy, here is the solution if I understood your problem correctly:
syms a_sym b_sym
x_sym = a_sym + 1j * b_sym;
a = 1;
b = 2;
e = 2.71828;
tol = 1e-5;
da = e + a;
db = e + b ;
count = 0;
while (~(abs(da) < tol) && ~(abs(db) < tol))
f = double(subs(x_sym, [a_sym b_sym], [a b]));
realF = real(f);
imagF = imag(f);
da = (realF * realF + imagF * imagF) / abs(f^2);
db = (realF * realF - imagF * imagF) / abs(f^2);
a = a - da;
b = b - db;
count = count + 1;
if (count > 400)
fprintf('Error...! Solution not converging !!! \n'); % printing the error message
break;
end
end
if (count < 400)
fprintf('The solution = ');
fprintf('\nNumber of iteration taken = %d\n',count);
end
  댓글 수: 18
sixwwwwww
sixwwwwww 2013년 10월 15일
I read it. It is very complicated. Can you tell me what are the inputs and what are the outputs so that I can give you some idea. Also see the following link for initial considerations of Hnakel transform: http://www.mathworks.com/help/matlab/ref/besselh.html
unhappy
unhappy 2013년 10월 15일
ok..i knew its complicated...but once have a look in "theory of bragg fibers". you can get some idea....here outputs are Ai,bi,Ci,Di i.e in eq=14 in "multilayer method"

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

추가 답변 (0개)

카테고리

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

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by