Is it possible to double integrate a function with three variables?

조회 수: 6 (최근 30일)
Sandra Maria Cherian
Sandra Maria Cherian 2018년 7월 16일
댓글: Sandra Maria Cherian 2018년 7월 18일
I have a function interms of three variables. Can I integarte with respect to two variables in matlab?

답변 (1개)

Tejas Jayashankar
Tejas Jayashankar 2018년 7월 16일
Hi Sandra,
It is possible to perform integration with respect to only 2 variables in a 3 dimensional space. Consider the integral of the function f(x, y, z) = xyz, where x ranges from 0 to y/2 and y ranges from 0 to 1.
You can perform integration using the int or integral function in MATLAB. The int function performs indefinite and definite integration over symbolic variables whereas the integral, integral2 and integral3 functions perform definite integrals. Check the documentation for further information.
Coming back to the integral mentioned above, one can implement it as follows in MATLAB:
syms x y z
f = x * y * z;
int(int(f, x, [0 y/2]), y, [0 1])
I am declaring x, y, z as symbolic variables and first performing the inner integral with respect to x and then the outer integral with respect to y. As expected the answer returned is z/32.
  댓글 수: 1
Sandra Maria Cherian
Sandra Maria Cherian 2018년 7월 18일
I tried the code, but whenever I run that code my system get hang and automatically close all applications running. Do you have any solution for this?

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

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by