me471_hwk06ans

Embed Size (px)

Citation preview

  • 8/9/2019 me471_hwk06ans

    1/3

    ME471 Assignment 6 Solutions

    1.) Textbook p.195, problem 6.1. In one dimension, the master element (M   = [−1, 1]) quadraticisoparametric shape functions are  H (s) = [s(−1 + s)/2, 1 − s2, s(1 + s)/2]T , and the mapping fromM  to the element [x1, x3] = [2, 6] with interior node  x2 = 4 is given by

    x = x̂(s) = ( 2 4 6 ) H 

    with Jacobian (or derivative in 1D)

    J  = dx̂

    ds  = ( 2 4 6 )

    (−1 + 2s)/2−2s

    (1 + 2s)/2

    = 2.

    The derivative of the shape functions are found from the definition  Ĥ (x̂) =  H (s),   i.e.,   d Ĥ/dx  =(dH/ds)J −1 so that d  Ĥ 1/dx = (−1 + 2s)/4.  Utilizing this information we have

    K 11  =    1

    −1 J −2

    dH 1

    ds 2

    + H 21 Jds =    1

    1 1

    4

    (−1 + 2s)2

    4  +

     s2(−1 + s)2

    4 2ds.Integrating we find  K 11  = 67/60

    2.) Textbook p.195, problem 6.3. The master element for bilinear shape functions on rectanglesis the square   M   =   {(s, t) :   −1   ≤   s, t   ≤   1}. The bilinear master element shape functions areH (s, t) = [(1− s)(1− t)/4, (1 + s)(1− t)/4, (1 + s)(1+ t)/4, (1− s)(1+ t)/4]T  and the isoparametrictransformation from the master element to the rectangle  R   (physical element) shown in Fig.P6.3may be written as

    xy

    =

    x̂(s, t)ŷ(s, t)

    =

    −1 3 5   −2−1   −2 4 5

    H  ≡ XH 

    The Jacobian matrix of this transformation is

    J  =

    ∂ ̂x/∂ s ∂  ̂y/∂t∂ ̂y/∂ s ∂  ̂y/∂t

    = X  ( ∂H/∂s ∂H/∂t ) =  1

    4X −(1 − t)   −(1 − s)

    (1 − t)   −(1 + s)(1 + t) (1 + s)−(1 + t) (1 − s)

    or

    J  = 1

    4

    11 + 3t   1 + 3s−2 12

    .

    The inverse of this matrix is

    J −1 =  2

    67 + 3s + 18t

    12   −1 − 3s2 11 + 3t

    .

    The matrix of partial derivatives of the shape functions for the physical element with respect to

    x, y  is given by (Recall that the physical element shape functions  ˆH j(x, y) are related to the masterelement shape functions by  Ĥ j(x̂(s, t), ŷ(s, t)) =  H j(s, t).)

    [∂  Ĥ 

    ∂x ,

     ∂  Ĥ 

    ∂y ] = [

    ∂H 

    ∂s ,

     ∂H 

    ∂t  ]J −1.

    1

  • 8/9/2019 me471_hwk06ans

    2/3

    Since all the requisite matrices have been computed, the derivatives may be found by matrix algebra.The problem requires  ∂  Ĥ i/∂x  and  ∂  Ĥ i/∂y   for i  = 1, 2.  These are computed as follows:

    ∂  Ĥ 1/∂x   = 2 [−3(1 − t) − (1 − s)/2] /(67 + 3s + 18t),∂  Ĥ 1/∂y   = 2 [(1 − t)(1 + 3s)/4 − (1 − s)(11 + 3t)/4] /(67 + 3s + 18t),∂  Ĥ 2/∂x   = 2 [3(1− t) − (1 + s)/2] /(67 + 3s + 18t),∂  Ĥ 2/∂y   = 2 [−(1 − t)(1 + 3s)/4 − (1 + s)(11 + 3t)/4] /(67 + 3s + 18t).

    It is clear that numerical integration of the element K 12 is the best approach to the computation. Onepossibility is to compute the required integral manually, i.e.,

     M 

     F (s, t) dsdt =n

    i,j=1 F (si, tj)wiwjwhere sk, tk, wk   k  = 1, . . . , n are the Gauss-Legendre points and weights listed in the text, and fora hand computation  n  = 2 would be a reasonable choice. An efficient approach, and certainly thepreferred one if more than one stiffness element were to be computed, is to modify the file  ex661.mprovided by with the text. An appropriate modification is shown below. (The initial commentssupplied with the file have been deleted to save space.)

    function k=prob6_3(xpts, ypts, ngx, ngy)

    nnel=4; % number of nodes per element

    ndof=1; % degrees of freedom per node

    edof=nnel*ndof; % degrees of freedom per element

    nglx=ngx; ngly=ngy; % use ngx x ngy integration rule

    xcoord=xpts; % x coordinate values

    ycoord=ypts; % y coordinate values

    [point2,weight2]=feglqd2(nglx,ngly); % sampling points & weights

    %--------------------------------

    % numerical integration

    %--------------------------------

    k=zeros(edof,edof); % initialization to zero

    for intx=1:nglx

    x=point2(intx,1); % sampling point in x-axis

    wtx=weight2(intx,1); % weight in x-axis

    for inty=1:ngly

    y=point2(inty,2); % sampling point in y-axis

    wty=weight2(inty,2) ; % weight in y-axis

    [shape,dhdr,dhds]=feisoq4(x,y); % compute shape functions and

    % derivatives at sampling point

    jacob2=fejacob2(nnel,dhdr,dhds,xcoord,ycoord); % compute Jacobian

    detjacob=det(jacob2); % determinant of Jacobian

    invjacob=inv(jacob2); % inverse of Jacobian matrix

    [dhdx,dhdy]=federiv2(nnel,dhdr,dhds,invjacob); % derivatives w.r.t.

    % physical coordinate

    2

  • 8/9/2019 me471_hwk06ans

    3/3

    %------------------------------

    % element matrix loop

    %------------------------------

    for i=1:edof

    for j=1:edofk(i,j)=k(i,j)+(dhdx(i)*dhdx(j)+dhdy(i)*dhdy(j))*wtx*wty*detjacob;

    end

    end

    end

    end

    %-----------------------------------------------------------------

    This file produces the entire stiffness matrix as follows:

    EDU>> prob6_3([-1,3,5,-2],[-1,-2,4,5],4,4)

    ans =

    0.8529 -0.3175 -0.3951 -0.1404

    -0.3175 0.7163 -0.1092 -0.2896

    -0.3951 -0.1092 0.6344 -0.1302

    -0.1404 -0.2896 -0.1302 0.5602

    From which we read that  K 12  = −0.3175

    3.) Textbook p.195, problem 6.5. The bilinear shape functions,  H i(s, t), i = 1, . . . , 4, on the mastersquare are given on p.163 of the textbook. The isoparametric map between the master square andthe element shown in Fig. P6.5 is given by

    x̂ŷ

    =

    1 2 2.5 1.51 1 2 2

    H  =  X H 

    with H  = (H 1, . . . , H  4)T . The Jacobian of the mapping is

    J  = X  ( ∂H/∂s ∂H/∂t ) = 1

    4X 

    −(1 − t)   −(1 − s)(1 − t)   −(1 + s)(1 + t) (1 + s)−(1 + t) (1 − s)

    = 0.5 0.25

    0 0.5

    3