
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

function [res] = XINT(XU2,XL2,A1,B1,C1,D1,A2,B2,C2,D2,A3,B3,C3,D3) % This function is used by Cubic Spline Rayleigh Ritz Method % (Algoritm 11.6) to exactly integrate products of cubic % polynomials. syms('AA','BB','CC','DD','EE','FF','GG','XHIGH','XLOW','I'); C = zeros(1,10); AA = A1A2; BB = A1B2+A2B1; CC = A1C2+B1B2+C1A2; DD = A1D2+B1C2+C1B2+D1A2; EE = B1D2+C1C2+D1B2; FF = C1D2+D1C2; GG = D1D2; C(10) = AAA3; C(9) = (AAB3+BBA3)/2; C(8) = (AAC3+BBB3+CCA3)/3; C(7) = (AAD3+BBC3+CCB3+DDA3)/4; C(6) = (BBD3+CCC3+DDB3+EEA3)/5; C(5) = (CCD3+DDC3+EEB3+FFA3)/6; C(4) = (DDD3+EEC3+FFB3+GGA3)/7; C(3) = (EED3+FFC3+GGB3)/8; C(2) = (FFD3+GGC3)/9; C(1) = (GGD3)/10; XHIGH = 0; XLOW = 0; for I = 1 : 10 XHIGH = (XHIGH+C(I))XU2; XLOW = (XLOW+C(I))XL2; end; res = XHIGH-XLOW;