Hello, how to write a code to find an excat value of this integral?
I really need help with this one! I wrote a code to approximate the value but i can't create a code to find the exact one

댓글 수: 8

Walter Roberson
Walter Roberson 2019년 3월 20일
How do you want the exact value expressed? erf? hypergeometric function? Fresnel C function?
Erika Plekaviciute
Erika Plekaviciute 2019년 3월 20일
편집: Erika Plekaviciute 2019년 3월 20일
The exact value must be a number equal to this: ?????? ~ 0.904524237900272
I created a code but it calculates only the approximate value, so I keep getting: 0.904524456832745
Walter Roberson
Walter Roberson 2019년 3월 20일
That isn't the exact value. The exact value is likely an irrational number when expressed in decimal; sqrt(pi) is part of the expression of it. Any finite truncation of it would be only an approximation.
What is your numeric approximation code? You only need 9 terms to get that particular numeric value.
Torsten
Torsten 2019년 3월 21일
Because you write down a series representation of the integral, maybe your task is to add up until you get the required accuracy ?
Walter Roberson
Walter Roberson 2019년 3월 21일
You are just doing a summation of values at end points as if the value were constant for the entire interval. That is not going to be accurate. You should look at the trapizoid rule for greater accuracy. trapz()
Torsten
Torsten 2019년 3월 21일
You are trying to approximate the integral, not summing up the series.
James Tursa
James Tursa 2019년 3월 21일
Erika, it is very poor online etiquette to delete your question after there have been comments and answers posted. This is a disservice to the Answers community.
Rena Berman
Rena Berman 2019년 4월 2일
(Answers Dev) Restored edit

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

 채택된 답변

Torsten
Torsten 2019년 3월 21일
편집: Torsten 2019년 3월 22일

0 개 추천

format long
I = 0.0;
Iexact = 0.904524237900272;
eps = 1e-15;
n = 0;
while abs(I-Iexact) > eps
I = I + (-1)^n/(factorial(2*n)*(4*n+1))
n = n+1;
end
n-1
I

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

질문:

2019년 3월 20일

댓글:

2019년 4월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by