how can I solve a triple integral (x,y,z) with y not defined
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi I want to solve the following integral in matlab (this is from maple)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/148240/image.png)
so i tried:
>> fun3 = @(z,x,y) 1
fun3 =
@(z,x,y)1
>> q = integral3(fun3,0,(y/0.348+13.95),-SQRT(3.85^2-y^2),SQRT(3.85^2-y^2),-3.85,3.85)
Undefined function or variable 'y'.
But it should be solved since you insert y in the integral......
Does some one know how to do this?
Thnx a lot!!
Amber
0 Commenti
Risposte (2)
Walter Roberson
il 19 Ago 2015
Use function handles to specify your bounds. See the description of ymin, ymax, zmin, zmax in http://www.mathworks.com/help/matlab/ref/integral3.html
0 Commenti
Mike Hosea
il 21 Ago 2015
Your integrand will be evaluated at an array of points each time (not just with one x, y, and z!), so it must return an array of the same size as the input. It doesn't matter what you name the variables in this case, but y is the outermost integration, and so in general it must be the first input of the integrand function. I mention that in case you have an integrand someday that does not happen to be a constant. You can use functions for the bounds of the integration. The first pair of bounds must be scalars, the second pair of bounds can be functions of the first variable, and the third pair can be functions of the first two variables. In this case the innermost integration limits are functions only of the outermost variable value y, but in order for the software to work properly, we must provide a function that accepts both of the inputs that would be needed in general. The solution looks like this:
>> fun3 = @(y,x,z)ones(size(y));
>> integral3(fun3,-3.85,3.85,@(y)-sqrt(14.8225 - y.^2),@(y)sqrt(14.8225 - y.^2),0,@(y,x)2.873563218*y+13.94)
ans =
6.491336240832158e+02
0 Commenti
Vedere anche
Categorie
Scopri di più su Operating on Diagonal Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!