Gauss quadrature Integral - exponential function (help please)

2 次查看(过去 30 天)
I have been trying for awhile to figure out if my function is correct or not.
The function is G = 100 e^(-2t/T) * sin^2 (2*pi*t/T) as written in the question
I typed the script of Gauss quadrature as two scripts one as sub-function and the other as the main
Sub-function (script):
function [y] = myfun(t) y = 100*exp(-2*t/T)*(sin(2*pi*t/T).^2));
Main (script): Q = quad(@myfun,a,b)
where my inputs are a = 0; b = T/2; % where T is 1
The results appear though I am not quite sure. I did it by hand and I got 3.926
Anyway, please check if it is correct.
Thanks

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by