How to solve a system of non linear equations one of which is an integral equation ?
Show older comments
I have to solve a system of three non linear equations -
exp(a)=exp(b)*sec^2(exp(b/2))
exp(b)-exp(c) = 5*(a-c)
6 = integral(dy/(exp(y)-exp(c)-y+c), c,a)
The quantities a,b,c are unknowns and integration limits are c to a.
I know how to solve a system of simultaneous non linear equations but I cannot handle if one of the equation is integral equations. Please help .
2 Comments
Roger Stafford
on 31 May 2013
Edited: Roger Stafford
on 31 May 2013
Your integral has a singularity in its integrand at y = c of the type 1/(y-c) which gives the integral an infinite value. It can never possibly equal 6. To see this, use L'Hopital's rule:
(y-c)/((exp(y)-y)-(exp(c)-c)) ---> 1/(exp(c)-1)
as y --> c and the integral of 1/(y-c) becomes infinite with a lower limit of y = c.
Dinesh Kumar
on 31 May 2013
Answers (2)
Roger Stafford
on 31 May 2013
In answer to your revised question, you can make use of matlab's numerical integration function 'integral' combined with the Optimization Toolbox function 'fsolve'. The function, F, to use with 'fsolve' should in your case accept a vector of the three arguments, a, b, and c and compute F(a,b,c) as a vector consisting of the three quantities:
exp(b)*sec(exp(b/2))^2-exp(a)
exp(b)-exp(c)-5*(a-c)
integral("Your integrand function",c,a)-6
At each iteration the first two quantities require only a direct computation but the third one necessitates a complete numerical integration over the stated interval, so the computation may of necessity be rather slow. It is necessary of course that the integrand yield a finite integral over the given limits. If the integrand nevertheless has a singularity, be sure to set the tolerances at appropriately stringent values. See:
http://www.mathworks.com/help/matlab/ref/integral.html
Also you may have to do some experimenting with different values of the initial estimate (x0) for a, b, and c required by 'fsolve' to get satisfactory starting values in the iteration process and to allow for the possibility of more than a single solution.
2 Comments
Dinesh Kumar
on 4 Jun 2013
Walter Roberson
on 5 Jun 2013
"integral" was not present in R2010a. Read about quadgk and similar functions.
Roger Stafford
on 4 Jun 2013
0 votes
Earlier you stated "Suppose, the integral is such that it is finite within the integration limits." However, in this most recent code at y = y(3) your integrand has precisely the same singularity as before and this again makes the integral divergent, that is, infinite in value. This is quite aside from the problem with the missing function 'integral'. If you had 'integral' on your system, you would be getting an infinite value for the integral. I suggest you rethink your basic problem before trying to make use of matlab. You have a condition that cannot be satisfied as things stand now.
2 Comments
Dinesh Kumar
on 5 Jun 2013
Roger Stafford
on 5 Jun 2013
Edited: Jan
on 15 Aug 2013
I have made some suggestions on this latter problem in your previous query at http://www.mathworks.com/matlabcentral/answers/77953 since it is a somewhat different question.
Categories
Find more on Numerical Integration and Differentiation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!