Integral calculation using matlab
조회 수: 8 (최근 30일)
이전 댓글 표시
Hello i wish to calculate the following integral
My difficulty stems from the absolute value which is "outside" of the integral with respect to θ
댓글 수: 0
채택된 답변
Bruno Luong
2020년 8월 4일
편집: Bruno Luong
2020년 8월 4일
Feel free to change these hyper-parameters
n = 3
k = 2*pi*rand()
integral(@(phi) arrayfun(@(phi) abs(integral(@(theta) exp(1i*k*cos(theta-phi)).*cos(n*theta), 0, 2*pi)).^2, phi), 0, 2*pi)
댓글 수: 4
추가 답변 (1개)
Matt J
2020년 8월 4일
편집: Matt J
2020년 8월 4일
My difficulty stems from the absolute value which is "outside" of the integral
Why is this a difficulty? Because it prevents you from using integral2()? Just apply integral() twice instead.
댓글 수: 5
Steven Lord
2020년 8월 4일
Write a function to compute the inner integral. This function should accept phi. One wrinkle here is that since the outer integral call is going to pass a vector of values into it as phi, your inner integral call will need to say that the function is ArrayValued.
Write a function that takes the absolute value of that inner integral function.
Write a function to compute the outer integral of the absolute value function.
If you try this and it doesn't work, show us the code you wrote and we may be able to offer some guidance.
참고 항목
카테고리
Help Center 및 File Exchange에서 Number Theory에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!