double integral with parameters

7 vues (au cours des 30 derniers jours)
OLGA SAMBATARO
OLGA SAMBATARO le 10 Mar 2021
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 commentaires
Sargondjani
Sargondjani le 10 Mar 2021
Please be more specfic with "I tried everything I found in the documentation".
OLGA SAMBATARO
OLGA SAMBATARO le 10 Mar 2021
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).

Connectez-vous pour commenter.

Réponses (1)

Steven Lord
Steven Lord le 10 Mar 2021
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

Catégories

En savoir plus sur Encryption / Cryptography dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by