I need to calculate in Matlab the 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.$$
where $h = 3.5; \; c = 3.05; \; t = 0, 0.1, ... , 30$
my attempts to do this
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?
There is no
ArrayValuedoption forintegral2. You have to iterate manually:Also, there was an error in your expression.
cos(psi.^2)should becos(psi).^2.