About double integral which includes non-linear equations in it

Hi I am a mechanical engineer and I am dealing with double integrals which includes nonlinear eauation but Matlab can t solve the problem exactly. I have been using int(int) but it doesn t work at a message appears like "Explicit integral could not be found". How can I solve this problem;
syms x y alpha beta V
K=1/(le/2-x*(sin(alpha*pi/180))*sin(beta*pi/180)-y*cos(alpha*pi/180))^2;
f=int ((K)*x,x,0,lm/2)
M=int(f,y,0,lm/2)
I also attached the real question. In this question I would like to have an equation related to V,alpha and beta.
E0 lm and Le are constants.

2 Commenti

It is possible to find a closed form for f, but you need to go piecewise as some of the combinations of conditions can generate infinities. Some of the failing conditions are based mostly on the lm and le values, but others are based more on the angles. For example at -Pi to +Pi radians there get to be exceptions.
I do not have the formula up on my screen now as I made the mistake of trying to visualize at too high of a density and choked my system to a crawl by using up tons of memory :(
Thank you Walter how can I solve this analytically?

Accedi per commentare.

 Risposta accettata

The symbolic toolbox is quite capable of solving your double integral. For simplicity of notation I substituted a = Le/2, b = -sin(alpha)*cos(beta), c = -cos(alpha), and d = lm/2. Here is the expression it gives after simplification:
int(int(x/(a+b*x+c*y)^2,x,0,d),y,0,d) =
(a+c*d)*log((a+b*d+c*d)/(a+c*d))-a*log((a+b*d)/a))/c/b^2
(In fact it is quite possible to solve this merely by looking it up in integral tables together with a certain amount of algebraic manipultion.)
There is one pitfall you need to be careful about. In the entire square range of 0<=x<=d and 0<=y<=d the quantity a+b*x+c*y must not cross zero. Otherwise the double integral becomes divergent and the above formula is invalid.

7 Commenti

Thank you roger but I am afraid this code does not work. :( It say that ;
Error using <= Not enough input arguments.
Error in doubleintegral (line 18) a= le/2;
I don't know what you mean when you say "this code does not work". It is not matlab code. It is an explicit formula for the form of double integral you presented, just as though it were given in a table of integrals. It is a valid formula provided the variable a+b*x+c*y is not zero anywhere within the square range I mentioned. It is up to you to use this formula appropriately.
Sorry Mr Roger my English is poor so I could not understand what you mean in your answer about my first question. If you say make some simplifications I have tried it. But it did not work either. If you can solve this integral exactly I will be appreciated to you so much.
What I have been trying to tell you, Mehmet, is that I did already solve your double integral exactly with the formula I wrote out for you. If for the variable a you substitute the value of Le/2, for b you substitute the value of -sin(alpha)*cos(beta), for c you substitute the value of -cos(alpha), and for d the value of lm/2 in the following expression (where alpha and beta are in radians)
(a+c*d)*log((a+b*d+c*d)/(a+c*d))-a*log((a+b*d)/a))/c/b^2
then that will give you the exact double integral you are trying to evaluate in your first question. As I indicated before, I actually solved it using my rather ancient version of the Symbolic Toolbox 'int' together with its simplification tools, but it can also be solved using ordinary methods in calculus. It is not a difficult integral to evaluate. Your calculus teacher could well have given it to you as an exercise. I do not know why your version of matlab could not solve it.
Mr Stafford I have used your method and I have solved almost but when I have calculated integrals some imaginary terms appear and my professor said that this means integral could not be solved. How can I get rid of these imaginary parts?
If you used the formula I gave you, the only way you could get a complex result would be to have a negative argument in one or both of the two logarithms, and that in turn would mean that the denominator of your integrand must have equaled zero somewhere within your square region, 0<=x<=d and 0<=y<=d. If you recall I warned you about that. It would mean that you have a divergent integral, and there is no remedy for that. In that sense your professor would be right. But surely you can easily check for that directly by considering the values of a, b, and c for x and y over the range from 0 to d. By the way, remember when using matlab's sin and cos, these assume that their arguments are in radians. You need to take that into account when evaluating b and c from alpha and beta.
yeah I have solved it and changed the boundaries now I do not have imaginary parts. But at last I have two equations which are V1 and V2 and they include alpha and beta in themselves. I mean I have two equations and two unknowns (alpha beta). In my project I have to plot alpha versus V1 and alpha versus V2. But I do not know how to do it. Firstly I have to find a function for V1 and V2 related to alpha and beta. I have used these codes; Ty=Ty25; Tx=Tx25;
V1=vpa(solve(Ty-Ty25,V)); V1=vpa(eval(V1))
V2=vpa(solve(Tx-Tx25,V)); V2=vpa(eval(V2))
I must change V values from 0 to 100 and must show how alpha and beta change in two plot like this;

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by