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!