Clear Filters
Clear Filters

Gauss quadrature Integral - exponential function (help please)

2 views (last 30 days)
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

Answers (0)

Categories

Find more on Numerical Integration and Differential Equations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!