Example2.m
%__________________________________________________________________________
%|HOMOGEN INTEGRATE ON TRIANGULAR AREAS                    (A.)27.01.2007 |
%|_________________________________________________________________________|
%|Integrate technique :Gamma function format   |   PARAMETRIC APPLICATION  |   
%|                    :Beta function format    |     Symbolic toolbox      |
%|_____________________________________________|___________________________|
%|FUNCTION                                                                 |
%|function [Integrate]=TRhomogenint(Cor,mainfunction,flag)                 |
%|                                                                         |
%|Integrate: Tetrahedral volume homogen integrate value                    |
%|Cor: Triangular element global cartesian node coordinates                |
%|mainfunction:                                                            |
%|             1-Only multi parametric parameter polinom or function       |
%|  FLAG=1     2-Multi parameter parametric matrix                         |
%|  FLAG=2     3-Homogen multi parameter function or matrix                |
%|                                                                         |
%|_____________________________________________________Matlab ver(7.1)_____|

clc
clear

syms X Y  real
help TRhomogenint

%################## INPUT VERIABLES #############

%############
%Triangular area global cartesian coordinates.
     %[X]  [Y] 
Cor=[1.00  1.00       %Node(1)
     3.00  2.00       %Node(2)
     2.00  3.00];     %Node(3)

%############
% Definite multi parameter parametric  matrix [Nparametric]
                         %#7# Point-Gaussian integrate results
Nparametric = [1         %3/2     (Exact!)
               X         %3       (Exact!)
               X^2       %25/4    (Exact!)
               X*Y       %49/8    (Exact!)
               X^3       %27/2    (Exact!)
               X^2*Y ]'  %259/20  (Exact!)
               
%#############



%ONE DIMENSIONAL POLINOM or FUNCTION (Parametric)
for i=1:size(Nparametric,2)
    
%THhomogenint(Cor,mainfunction)
Integra1(i,:)=TRhomogenint(Cor,Nparametric(i),1);
end
clear i
%Homogen integration results
Integra1'



%ONE TOTAL MATRIX or FUNCTION (Parametric)
Integra2=TRhomogenint(Cor,Nparametric,1)
%Integra2



%ONE TOTAL MATRIX or FUNCTION (Homogen)
syms e1 e2 e3 real
Nhomogen =[   e1*(-1+2*e1)
              e2*(-1+2*e2)
              e3*(-1+2*e3)
              (2*e1-1+2*e2+2*e3)*(e1-1+e2+e3)
              4*e1*e2
              4*e2*e3
              4*e3*e1
             -4*e1*(e1-1+e2+e3)
             -4*e2*(e1-1+e2+e3)
             -4*e3*(e1-1+e2+e3) ]';
 
%                    Notice flag==2 
Integra3=TRhomogenint(Cor,Nhomogen,2)
%Integra3'




Contact us at files@mathworks.com