# Solving a system of integral equations numerically

조회 수: 12 (최근 30일)
Lewis Hancox 2018년 3월 12일
댓글: Star Strider 2018년 3월 12일
I'm trying to find the numerical solution to a system, the first problem I have is that I'm given a system of two integrals with two unknowns where the unknowns are in the integrands and the limits of both equations. How do they do this? I've attached the problem below. I've tried just using the built-in solve function but it doesn't work for this integral as I'm guessing its too complicated. I'm not too great on MATLAB, so any help would be appreciated! Thanks

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

### 채택된 답변

Star Strider 2018년 3월 12일
There are several roots, and it doesn’t always converge on the published solutions.
The Code
a2 = @(b) integral(@(y) 1./sqrt(((y.^2 + b(2))./b(1)).^2 - 1), 0, sqrt(b(1)-b(2))) - 1;
b2 = @(b) integral(@(y) ((y.^2 + b(2))./b(1))./sqrt(((y.^2 + b(2))./b(1)).^2 - 1), 0, sqrt(b(1)-b(2))) - pi/2;
B = fsolve(@(b) [a2(b), b2(b)], rand(2,1))
ym = sqrt(B(1) - B(2))
The Solutions
B =
-1.034659029995483 + 0.000000635413460i
-2.290004434974137 + 0.000000465384426i
ym =
1.120421976301188 + 0.000000075877231i
The imaginary parts are vanishingly small, so you can likely just ignore them.
##### 댓글 수: 20이전 댓글 18개 표시이전 댓글 18개 숨기기
Lewis Hancox 2018년 3월 12일
Exactly what I was thinking, I just wanted to add another curve on it too. It seems impossible, the square root goes negative and then its imaginary for a bit, and then increasing again. Thanks for that anyway!
Star Strider 2018년 3월 12일
As always, my pleasure!

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

### 추가 답변 (2개)

Roger Stafford 2018년 3월 12일
This is a problem you can solve using Matlab's 'fsolve' function. The fact that your objective function requires two numerical integrations at each evaluation does not change the nature of the problem. It only means that execution time will be longer than with simpler objective functions. Each iteration requires the numerical evaluation of two integrals. You can presumably use Matlab's 'integral' function in evaluating the objective function.
You may have to be careful as to the selection of your initial estimate, x0, since it is easy to run into complex values with your particular integrals, both in the integrand and the integral limits.
##### 댓글 수: 0이전 댓글 -2개 표시이전 댓글 -2개 숨기기

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

Roger Stafford 2018년 3월 12일
편집: Roger Stafford 2018년 3월 12일
@Lewis: I noticed that the integrands in both of your integrals become infinite at the upper limit of integration, and this can result in some inaccurate numerical results from the integration process. However, with the appropriate change of variables these integrals can be converted to complete elliptic integrals of the first and second kinds for which Matlab has functions that you can call on directly and thereby avoid using numerical integration at each step of the iteration.
Here is an outline of that change of variable. You are working in a realm where lambda and c must both be negative with lambda having the greater absolute value. Define A = -c and B = -lambda, so that A and B are positive quantities with A < B. Make the following change of variable:
y = sqrt(B-A)*sin(t)
dy = sqrt(B-A)*cos(t)*dt
(After all the smoke clears away) the first of your integrals becomes the integral with respect to t from 0 to pi/2 of
A/sqrt(A+B-(B-A)*sin(t)^2)
which can be evaluated in terms of a complete elliptic integral of the first kind. It is easy to show that your second integral will reduce to a combination of complete elliptic integrals of the first and second kinds.
Hence in computing your objective function for 'fsolve' you need not call on Matlab's 'integral' function at all but only on the complete elliptic integral functions.

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

### 카테고리

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

### Community Treasure Hunt

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

Start Hunting!

Translated by