Double area intergral (4D integral)

We are trying to calculate the integrals in the attached file below. And we are having trouble doing it in matlab.
We have tried using this for reference: https://se.mathworks.com/matlabcentral/answers/77571-how-to-perform-4d-integral-in-matlab but sadly to no sucess.
We would appriciate any help we could get :)

9 个评论

Torsten
Torsten 2020-3-31
编辑:Torsten 2020-3-31
What problems do you encounter ? What errors do you get ?
In my opinion, the integral does not exist due to the singular part (0,0,a,a) with 0 <= a <= 0.5.
What is the result of this integral? Is this a homework question?
@Torsten We get a bunch of errors ;)
And this is the code we try to use:
clear all
%syms x y z w
L = 0.5;
%R = sqrt(x^2+y^2+(z-w)^2);
%cos1 = y/R;
%cos2 = x/R;
func = @(x,y,z,w) (x*y/(pi*(x^2+y^2+(z-w)^2)^2));
F = integral(@(x)integral3(@(y,z,w)func,0,L,0,L,0,L),0,L,'ArrayValued',true)
%Here are all the errors:
Error using integral2Calc>integral2t/tensor (line 231)
Input function must return 'double' or 'single' values. Found 'function_handle'.
Error in integral2Calc>integral2t (line 55)
[Qsub,esub] = tensor(thetaL,thetaR,phiB,phiT);
Error in integral2Calc (line 9)
[q,errbnd] = integral2t(fun,xmin,xmax,ymin,ymax,optionstruct);
Error in integral3/innerintegral (line 137)
Q1 = integral2Calc( ...
Error in integralCalc/iterateScalarValued (line 314)
fx = FUN(t);
Error in integralCalc/vadapt (line 132)
[q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
Error in integralCalc (line 75)
[q,errbnd] = vadapt(@AtoBInvTransform,interval);
Error in integral3 (line 121)
Q = integralCalc(@innerintegral,xmin,xmax,integralOptions);
Error in View_factor>@(x)integral3(@(y,z,w)func,0,L,0,L,0,L)
Error in integralCalc/iterateArrayValued (line 156)
fxj = FUN(t(1)).*w(1);
Error in integralCalc/vadapt (line 130)
[q,errbnd] = iterateArrayValued(u,tinterval,pathlen);
Error in integralCalc (line 75)
[q,errbnd] = vadapt(@AtoBInvTransform,interval);
Error in integral (line 88)
Q = integralCalc(fun,a,b,opstruct);
Error in View_factor (line 12)
F = integral(@(x)integral3(@(y,z,w)func,0,L,0,L,0,L),0,L,'ArrayValued',true)
@Birdman
We are solving this problem in our bachelor thesis.
We are calculating view factors between two planes.
For reference, this is where the problem originates from. Where we are trying to solve equation (3), with a=b=c=d=0.5
HI Torsten,
the x and y integrals are instantly doable, leaving (for the contribution evaluated at the lower limit x = y = 0) , the integrand
log((w-z)^2) which should be all right.
Good suggestion - I'm convinced.
To Viktor Koenemann:
viewfactor is approximately 0.05( without warranty ).
Thanks Torsten, that's the right answer. How did you do it in matlab? :)
Integrate analytically with respect to x, evaluate the integral at its limits.
Function to integrate has the form a*x/(x^2+b)^2
Integrate analytically with respect to y, evaluate the integral at its limits.
Functions to integrate have the form a*y/(y^2+b)
These two tasks can either be done with pencil and paper or using the symbolic toolbox.
Now you have a double integral depending on z and w that can be evaluated numerically using Matlab's integral2.
It contains a combination of functions of the form log((z-w)^2+a).

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by