Hominttetrahedral

Contents

%__________________________________________________________________________
%|HOMOGEN INTEGRATE ON TETRAHEDRAL VOLUME                  (A.Ö)27.01.2007 |
%|_________________________________________________________________________|
%|Integrate technique :Gamma function format   |   PARAMETRIC APPLICATION  |
%|                    :Beta function format    |     Symbolic toolbox      |
%|_____________________________________________|___________________________|
%|FUNCTION                                                                 |
%|function [Integrate]=THhomogenint(Cor,mainfunction,flag)                 |
%|                                                                         |
%|Integrate: Tetrahedral volume homogen integrate value                    |
%|Cor: Tetrahedral 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 Z real

Tetrahedral volumes for global cartesian coordinates.

      %[X] [Y]  [Z]
Cor=[0.00 0.00 0.00      %Node(1)
     3.00 0.00 1.00      %Node(2)
     1.00 3.00 0.00      %Node(3)
     1.00 1.00 4.00];    %Node(4)

Definite multi parameter parametric matrix [Nparametric]

                         %#5# Point-Gaussian integrate results
Nparametric = [1         %17/3    (Exact!)
               X         %85/12   (Exact!)
               X^2       %51/5    (Exact!)
               X*Y       %34/5    (Exact!)
               X^3       %493/50  (Exact!)
               X^2*Y     %136/15  (Exact!)
               X*Y*Z ]'  %374/45  (Exact!)
 
Nparametric =
 
[     1,     X,   X^2,   X*Y,   X^3, X^2*Y, X*Y*Z]
 
 

Definite multi parameter homogen matrix [Nhomogen]

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) ]';

Homogen or parametric function integrate on tetrahedral volumes

syms X Y Z e1 e2 e3 e4 t1 t2 real

px=Cor(:,1) ;
py=Cor(:,2) ;
pz=Cor(:,3) ;

%Tetrahedral volume
%Volume=1/6*abs(det([ 1   1   1   1
%                     X1  X2  X3  X4
%                     Y1  Y2  Y3  Y4
%                     Z1  Z2  Z3  Z4 ]));

V=1/6*abs(det([ 1      1      1      1
               px(1)  px(2)  px(3)  px(4)
               py(1)  py(2)  py(3)  py(4)
               pz(1)  pz(2)  pz(3)  pz(4) ]));



%Cartesian axises are connecting homogen axises
%X = e1*px(1) + e2*px(2) + e3*px(3) + e4*px(4)
%Y = e1*py(1) + e2*py(2) + e3*py(3) + e4*py(4)
%Z = e1*pz(1) + e2*pz(2) + e3*pz(3) + e4*pz(4)


%Homogen axises depends
%e2=(1-e1)*t2

%e3=(1-e1-e2)*t1 =>
%e3=(1-e1-(1-e1)*t2)*t1 =>
%e3=(1-e1)*(1-t2)*t1

%e4=(1-e1-e2-e3)=>
%e4=(1-e1-(1-e1)*t2-(1-e1)*(1-t2)*t1) =>
%e4=(1-e1)*[(1-t2)*(1-t1)]

%                                       e1 = e1
%                                       e2 = (1-e1)*t2
%                                       e3 = (1-e1)*(1-t2)*t1
%                                       e4 = (1-e1)*[(1-t2)*(1-t1)]

Acon=subs(Nparametric ,{X,Y,Z}, ...
                       {e1*px(1) + e2*px(2) + e3*px(3) + e4*px(4), ...
                        e1*py(1) + e2*py(2) + e3*py(3) + e4*py(4), ...
                        e1*pz(1) + e2*pz(2) + e3*pz(3) + e4*pz(4) });

%Parametric function transform
Ahparametric = subs(Acon,{e2,e3,e4},...
                         {(1-e1)*t2,...
                          (1-e1)*(1-t2)*t1,...
                          (1-e1)*(1-t2)*(1-t1)});




%Homogen function transform
Ahhomogen = subs(Nhomogen , {e2,e3,e4},...
                            {(1-e1)*t2,...
                             (1-e1)*(1-t2)*t1,...
                             (1-e1)*(1-t2)*(1-t1)});

Homogen integrate(1): Parametric function

%Chain-Rules on integration
%Integra1=int(6*V*Ah*(1-e1)*(1-e1)*(1-t2),e1,0,1);
%Integra2=int(Integra1,t1,0,1);
%Integra3=int(Integra2,t2,0,1);

Integra1=int(int(int(6*V*Ahparametric*(1-e1)*(1-e1)*(1-t2),e1,0,1),t1,0,1),t2,0,1);
Integra1
 
Integra1 =
 
[   17/3,  85/12,   51/5,   34/5, 493/30, 136/15, 374/45]
 
 

Parametric integrate(2):Homogen function

Integra2=int(int(int(6*V*Ahhomogen*(1-e1)*(1-e1)*(1-t2),e1,0,1),t1,0,1),t2,0,1);
Integra2
 
Integra2 =
 
[ -17/60, -17/60, -17/60, -17/60,  17/15,  17/15,  17/15,  17/15,  17/15,  17/15]
 
 

Contact us