Numerical calculation of an integral

106 Views Asked by At

I need to calculate the expression in this picture enter image description here

Let $x = 0, \; y = 0, \; e = 0, \; k = 1.$

Let the integration be carried out by one variable $$ S(\omega) =\frac{\pi c}{2 \omega^6} \cdot \exp \left(-\frac{4,575}{\omega^2 \cdot h^{0,8}} \right),$$ where $h = 3.5; \; c = 3.05; \; \omega = 0, 0.01, ... , 2$

Then calculate: $$ \eta(t) = \int_{0}^{\infty} \sin(-\omega \cdot t) \cdot \sqrt{2 \cdot \frac{\pi c}{2 \omega^6} \cdot \exp \left(-\frac{4,575}{\omega^2 \cdot h^{0,8}} \right)} \,d \omega.$$

What I calculated in Matlab looks like this:

fun = @(omega,c,h) sqrt(2*pi*c./(2.*omega.^6).*exp(-4.575./(omega.^2*h^0.8)));
q = integral(@(omega) fun(omega, 3.05,3.5),0,inf)

However, I can't calculate it completely. I don't understand how to integrate with the sine term?

At the end I have to get the time function and build it. I assume that there should be a sum of sinusoids, that the sum should give something similar to noise.


Added: Now that I have been helped with the single integral, I want to calculate the double integral: $$ \eta(t) = \int_{0}^{\infty} \int_{0}^{2\pi}\sin(-\omega \cdot t) \cdot \sqrt{2 \cdot \frac{\pi c}{2 \omega^6} \cdot \exp \left(-\frac{4,575}{\omega^2 \cdot h^{0,8}} \right) \cdot \frac{2}{\pi} \cdot \cos^2(\psi)} \,d \omega \,d \psi.$$

figure
t=0:0.1:40;
c=3.05;
h=3.5;
fun=@(omega,psi,c,h,t) sin(omega.*t).*sqrt(2*pi*c./(2.*omega.^6).*exp(-4.575./(omega.^2*h^0.8)).*2./pi.*cos(psi.^2));
q=integral2(@(omega,psi) fun(omega,psi,c,h,t),0,Inf, 0,2*pi,'ArrayValued',true);
plot(t,q)

but it doesn't work. Do I need to specify a calculation method?

1

There are 1 best solutions below

2
On BEST ANSWER

You can easily evaluate the full integral numerically in Matlab by using the 'ArrayValued' option of the integral function to vectorize the evaluation of the integral over t:

t=0:0.1:40;
c=3.05;
h=3.5;
fun=@(omega,c,h,t)sin(omega.*t).*sqrt(2*pi*c./(2.*omega.^6).*exp(-4.575./(omega.^2*h^0.8)));
q=integral(@(omega)fun(omega,c,h,t),0,Inf,'ArrayValued',true);
plot(t,q)

Which returns a plot that looks like this:

enter image description here