필터 지우기
필터 지우기

Triple integral using integral3

조회 수: 7 (최근 30일)
DM
DM 2014년 11월 24일
댓글: Roger Stafford 2014년 11월 24일
The following is a triple integral I am trying to compute using MATLAB, (please check link for clear illustration)
syms a
syms b
syms c
fabc= (a+b+c)*exp(a+b+c);
f=matlabFunction(fabc) % @(a,b,c)
cmin= @(a,b) b;
integral3(f,-inf,+inf,0,+inf,cmin,+inf)
Is the code correct? Please note that this is not my real function but I wrote an easy one for purpose of illustration...
Thanks

답변 (1개)

Roger Stafford
Roger Stafford 2014년 11월 24일
The 'integral3' function performs numerical integration for which numerical values must be supplied. The form of your code looks correct for numerical integration except that the 'syms' lines should be removed.
If you want to perform symbolic triple integration, you will have to construct it using the 'int' function in triple form - that is, use it to integrate with respect to 'c' first, then use the answer to integrate with respect to 'b', and finally use that answer to integrate with respect to 'a'. You should be prepared for the possibility of exceedingly long answers with a symbolic triple integral. It may be advisable to apply the 'simplify' command in between the above steps to avoid needless complexity in your answer.
  댓글 수: 2
DM
DM 2014년 11월 24일
Thanks, but if I remove the syms line, MATLAB cannot recognize the variables a,b,c. Right?
Roger Stafford
Roger Stafford 2014년 11월 24일
That's not necessarily true. To use 'integral3' what you must provide are the numerical values of all parameters that are used to define your integrand function and any numerical values involved in integration limits. In your case there are apparently none of this latter kind, but you may well have numerical parameters in your actual integrand function.
One further note: If you attempt to do symbolic integration instead, you should also be aware that 'int' can easily fail to find an explicit solution. It all depends on the nature of the integrand function and the integration limits. If you took integral calculus, you probably learned that there are many functions whose integrals don't show up in any integral tables, simply because they are unknown to mathematics.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by