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.
Birdman
Birdman 2020년 3월 31일
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)
Viktor Könemann
Viktor Könemann 2020년 3월 31일
@Birdman
We are solving this problem in our bachelor thesis.
We are calculating view factors between two planes.
Viktor Könemann
Viktor Könemann 2020년 3월 31일
For reference, this is where the problem originates from. Where we are trying to solve equation (3), with a=b=c=d=0.5
David Goodmanson
David Goodmanson 2020년 4월 1일
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.
Torsten
Torsten 2020년 4월 1일
Good suggestion - I'm convinced.
To Viktor Koenemann:
viewfactor is approximately 0.05( without warranty ).
Viktor Könemann
Viktor Könemann 2020년 4월 2일
Thanks Torsten, that's the right answer. How did you do it in matlab? :)
Torsten
Torsten 2020년 4월 2일
편집: Torsten 2020년 4월 2일
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에 대해 자세히 알아보기

질문:

2020년 3월 31일

편집:

2020년 4월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by