Definite integral without symbolic variables

조회 수: 28 (최근 30일)
Pilar Jiménez
Pilar Jiménez 2020년 2월 18일
답변: Star Strider 2020년 2월 18일
Hi good day.
I want to request your support to know if it is possible to perform a definite integral without the use of matlab integration commands since it asks for symbolic variables to be established and I need to work with variables that are defined. I need to perform this integration as part of a larger algorithm and that is why I need them not to be symbolic variables.
An example of the function that I must integrate is the following:
k = 2*pi;
L1=0.5;
L2=0.5;
d=0.2;
R1 = sqrt(d^2 + 0.5^2);
R2 = sqrt(d^2 + 0.6^2);
R0 = sqrt(d^2 + 0.7^2);
G1 = exp(-j*k*R1)./R1;
G2 = exp(-j*k*R2)./R2;
G0 = exp(-j*k*R0)./R0;
fun = (G1 + G2 - 2*cos(k*L1/2) * G0) .* sin(k*(L2/2-abs(z)));
The integral is defined with respect to z from -L1 / 2 to L1 / 2. I hope you can help me.
Thanks in advance.

답변 (1개)

Star Strider
Star Strider 2020년 2월 18일
Create ‘fun’ as an anonymous function, then use the integral function:
fun = @(z) (G1 + G2 - 2*cos(k*L1/2) * G0) .* sin(k*(L2/2-abs(z)));
Iz = integral(fun, -L1/2, L1/2)
producing:
Iz =
-0.912687739195403 + 0.513810248651795i

카테고리

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

제품


릴리스

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by