double integral with parameters

조회 수: 7 (최근 30일)
OLGA SAMBATARO
OLGA SAMBATARO 2021년 3월 10일
답변: Steven Lord 2021년 3월 10일
Hello everyone,
I need to calculate the integral
I have A = matrix( 256x257) elements, phi = matrix( 256x257), theta = array(257) elements, tau = array(256) elements, and also dtheta and dtau (the arrays are uniform).
t and omega will be the same of tau and theta, but for the calculation they are symbols.
I tried everything I found in the documentation, but I can't solve this integral quickly.
do you have any suggestions on how to set up the integral?
  댓글 수: 2
Sargondjani
Sargondjani 2021년 3월 10일
Please be more specfic with "I tried everything I found in the documentation".
OLGA SAMBATARO
OLGA SAMBATARO 2021년 3월 10일
this was the only test that did not give an error, but it takes a very long time to compile:
syms t omega
fun = symfun( A.*PHI.*exp(-1i*(theta.*t+tau.*omega)),[t omega]);
F =symfun( sum(fun,'All'),[t,omega]);
FUN = double(F(theta,tau));
I also tried with integral2 function, but I don't have an analytic function to integrate (A and phi are matrices).

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

답변 (1개)

Steven Lord
Steven Lord 2021년 3월 10일
Matrices that small don't give you a lot of data to compute the value of your integrand function over an infinitely large region of integration.
If you just have data, not functions, use trapz or cumtrapz to integrate the data. But keep in mind that we have absolutely no idea what any function underlying that data might do outside the region in which you have data. It might soar off to positive infinity. It might plummet to negative infinity. It may settle down to a constant. It may oscillate forever.
hold on
fplot(@(x) x.^50, 'DisplayName', 'soar')
fplot(@(x) -x.^50, 'DisplayName', 'plummet')
fplot(@(x) x.^-50, 'DisplayName', 'settle')
fplot(@(x) sin(5*x), 'DisplayName', 'oscillate')
axis([0 pi -10 10])
legend show
Granted, I took some extreme examples, but if I gave you the value of these functions at x = 0.99 (when they're all in the range [-2, +2]) could you easily tell me what their values should be at x = 1.1?
v = [0.99 1.1];
format longg
soar = v.^50
soar = 1×2
0.605006067137536 117.390852879696
plummet = -v.^50
plummet = 1×2
-0.605006067137536 -117.390852879696
settle = v.^(-50)
settle = 1×2
1.6528759864034 0.00851855127950061
oscillate = sin(5*v)
oscillate = 1×2
-0.971903069401821 -0.705540325570392

카테고리

Help CenterFile Exchange에서 Encryption / Cryptography에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by