How to define variables using triple integrals
조회 수: 6 (최근 30일)
이전 댓글 표시
Ive been at this for to long. I need to calculate the triple integral of 1 dz dy dx..
fun = @ (z,y,x) 1
but not I do not know how to type in the limits of integration.
The first one is from 0 to -3/2x-y+3
I put xmin = 0
xmax = -3/2.*x.-y.+3
I get an undefined matlab operator where the period is to the right of x. I've tried every combination and can't seem to be able to type in a simple equation.
If anyone can help me to where matlab will take the upper bound limit of integration that would help a lot!
댓글 수: 0
답변 (1개)
Roger Stafford
2015년 3월 28일
편집: Roger Stafford
2015년 3월 28일
See Mathworks' documentation site:
http://www.mathworks.com/help/matlab/ref/integral3.html
As you can see, if you have variable limits of integration in 'integral3', these must be defined in terms of functions, either anonymous functions or other kinds of functions, and not an expression such as you used here.
Also the dots following x and y in your expression are definitely not valid in any case. What were you trying to accomplish there?
댓글 수: 2
Roger Stafford
2015년 4월 2일
You haven't made it clear what three-dimensional space you are integrating over. In particular you haven't defined your lower integration limits. I have guessed from your remarks that it is over the following tetrahedron:
xmin = 0;
xmax = 3;
ymin = 0;
ymax = @(x)-3/2*x+3;
zmin = 0;
zmax = @(x,y)-3/2-y+3;
The desired integral would then be:
I = integral3(@(x,y,z)1,xmin,xmax,ymin,ymax,zmin,zmax);
If this is the intended region of integration, you could of course have done the integration mentally and gotten
1/6*3*3*2 = 3 (1/6*base*height)
as the answer without ever bothering to use matlab.
참고 항목
카테고리
Help Center 및 File Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!