Skip to main content

Posts

Showing posts with the label 40 or 48

Function for initializing the matrices 'tt' and 'w' for Gaussian Integration

% Function for initializing the matrices 'tt' and 'w' for Gaussian % Integration; with n = 5, 10, 20, 24, 32, 40 or 48 % SAMPLE CODE FOR IMPLEMENTING DOUBLE INTEGRATION % gaussian_points = 10 ; % Define the number of points to be used % % a = 1; % Lower integration limit for y % b = 2; % Upper integration limit for y % % c = 3; % Lower integration limit for x % d = 4; % Upper integration limit for x % % sum = 0; % % for ii = 1:gaussian_points % % yy = ((d - c)*tt(ii) + d + c)/2; % % inner_sum = 0; % % for jj = 1:gaussian_points % xx = ((b - a)*tt(jj) + b + a)/2; % Fm1 = xx + yy*yy; % I N T E G R A N D % inner_sum = inner_sum + 0.5*(b - a)*Fm1*w(jj); % end % % sum = sum + 0.5*(d - c)*inner_sum*w(ii); % % end % ------------------------------------------------------------------------- function [tt w] = func_gaussian_integration_weights (gaussian_points) switch (gaussian_points)