# Solving a system of integral equations numerically

27 views (last 30 days)

Show older comments

Lewis Hancox
on 12 Mar 2018

Commented: Star Strider
on 12 Mar 2018

##### 0 Comments

### Accepted Answer

Star Strider
on 12 Mar 2018

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 Comments

### More Answers (2)

Roger Stafford
on 12 Mar 2018

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 Comments

Roger Stafford
on 12 Mar 2018

Edited: Roger Stafford
on 12 Mar 2018

@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.

##### 0 Comments

### See Also

### Categories

### Community Treasure Hunt

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

Start Hunting!