How to solve a system of non linear equations one of which is an integral equation ?

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

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.
Thanks. Suppose, the integral is such that it is finite within the integration limits . Then, can you suggest a way by which I can solve these three non linear equations can be solved ?

Sign in to comment.

Answers (2)

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

I am writing the following code to solve for unknowns y(1),y(2),y(3) :- function F= myfun1(y) F = [exp(y(2))*sec(4.24*10^(-4)*exp(y(2)/2))^(2)- exp(y(1)) exp(y(2))-exp(y(3))-(y(1)-y(3)) integral(1/(exp(y)-exp(y(3))-(y-y(3))),y(3),y(1))^(1/2)- 0.5656*10^(6)]; y0=[1; 1; 1] [y,fval]= fsolve(@myfun1,y0,optimset('Display','iter'))
I am getting the following error:-
??? Undefined function or method 'integral' for input arguments of type 'double'.
Error in ==> myfun1 at 2 F = [exp(y(2))*sec(4.24*10^(-4)*exp(y(2)/2))^(2)- exp(y(1))
Error in ==> fsolve at 254 fuser = feval(funfcn{3},x,varargin{:});
Caused by: Failure in initial user-supplied objective function evaluation. FSOLVE cannot continue.
Sorry, I am new to Matlab. I cannot figure out what these errors mean. Also, I am using Matlab R2010a and i have heard that integral function is compatible with 2012 version. Is this creating a problem here ?
"integral" was not present in R2010a. Read about quadgk and similar functions.

Sign in to comment.

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

Thank you, You are correct in saying that I should rethink the basic problem which I think is itself wrong. Leave this problem apart. Can you help me in solving another problem ?
I am trying to solve two differential equations : y''= exp(y) , 0<x<4 y''= exp(y)-100 -0.5<x<0
The boundary conditions are: y'= 0 at x=-0.5 y'=0 at x=4 y and y' are continuous at x= 0.
The third boundary condition is coupled between these two differential equations. So, normal bvp4c will not help. Can you suggest how to approach for the solution ? It will be a great help.
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.

Sign in to comment.

Tags

Asked:

on 30 May 2013

Community Treasure Hunt

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

Start Hunting!