Numerical Integration of scalar function

Hi Dear researchers. I want to calculate numerically the integral f(z)=exp(i*I*pi*z+cos(z)) where n eisai a matrix. i am using the above command
function out=I1mn(g,N,L,d,ai,si)
M=length(ai);
I=-N:N;
I=I(ones(2*N+1,1),:);
I=I.'-I;
fp=(@(z,n)exp(j*2*pi*n*z+(g)*(d*cos*2*pi*z/L))));
out=quadv(@(z)fp(z,I),ai,ai+si)
but when i execute my code i take the above message
Warning:Maximum function count exceeded; singularity likely.
>in quadv
in I1mn
How i can solve this problem to take good results
With best Regards DImitrios Gerontitis.

댓글 수: 6

Jan
Jan 2019년 2월 27일
편집: Jan 2019년 2월 27일
"n eisai a matrix" ? f(z)=exp(i*I*pi*z+cos(z)) does not contain an "n"?
What are the variables g,N,L,d,ai,si?
I do not see, why you implement:
exp(i*I*pi*z + cos(z))
as
exp(j*2*pi*n*z + (g)*(d*cos*2*pi*z/L)))
This is at least confusing.
Bob Thompson
Bob Thompson 2019년 2월 27일
Does the code run to completion and give you a result? If so, how do you know that the result isn't 'good'? What qualfies as a 'good' result with respect to the answers you are getting?
Unfortunately i don't take any result. Do you know any numerical integration routine?
Walter Roberson
Walter Roberson 2019년 2월 27일
Could you give us some sample input values?
Are you using an old MATLAB that does not have integrate() ?
Jan
Jan 2019년 2월 27일
@Dimitrios: Did you see my comment?
i find the solution with the command integral(fun,0,1,'ArrayValue',true)

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

태그

질문:

2019년 2월 27일

댓글:

2019년 3월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by