ELEC3030 Notes v1

download ELEC3030 Notes v1

of 118

Transcript of ELEC3030 Notes v1

  • 8/7/2019 ELEC3030 Notes v1

    1/118

    http://www.a-pdf.com/?pc-demo
  • 8/7/2019 ELEC3030 Notes v1

    2/118

  • 8/7/2019 ELEC3030 Notes v1

    3/118

  • 8/7/2019 ELEC3030 Notes v1

    4/118

  • 8/7/2019 ELEC3030 Notes v1

    5/118

  • 8/7/2019 ELEC3030 Notes v1

    6/118

  • 8/7/2019 ELEC3030 Notes v1

    7/118

  • 8/7/2019 ELEC3030 Notes v1

    8/118

  • 8/7/2019 ELEC3030 Notes v1

    9/118

  • 8/7/2019 ELEC3030 Notes v1

    10/118

  • 8/7/2019 ELEC3030 Notes v1

    11/118

  • 8/7/2019 ELEC3030 Notes v1

    12/118

  • 8/7/2019 ELEC3030 Notes v1

    13/118

  • 8/7/2019 ELEC3030 Notes v1

    14/118

  • 8/7/2019 ELEC3030 Notes v1

    15/118

  • 8/7/2019 ELEC3030 Notes v1

    16/118

  • 8/7/2019 ELEC3030 Notes v1

    17/118

  • 8/7/2019 ELEC3030 Notes v1

    18/118

  • 8/7/2019 ELEC3030 Notes v1

    19/118

  • 8/7/2019 ELEC3030 Notes v1

    20/118

  • 8/7/2019 ELEC3030 Notes v1

    21/118

  • 8/7/2019 ELEC3030 Notes v1

    22/118

  • 8/7/2019 ELEC3030 Notes v1

    23/118

  • 8/7/2019 ELEC3030 Notes v1

    24/118

  • 8/7/2019 ELEC3030 Notes v1

    25/118

  • 8/7/2019 ELEC3030 Notes v1

    26/118

  • 8/7/2019 ELEC3030 Notes v1

    27/118

  • 8/7/2019 ELEC3030 Notes v1

    28/118

  • 8/7/2019 ELEC3030 Notes v1

    29/118

  • 8/7/2019 ELEC3030 Notes v1

    30/118

  • 8/7/2019 ELEC3030 Notes v1

    31/118

  • 8/7/2019 ELEC3030 Notes v1

    32/118

  • 8/7/2019 ELEC3030 Notes v1

    33/118

  • 8/7/2019 ELEC3030 Notes v1

    34/118

  • 8/7/2019 ELEC3030 Notes v1

    35/118

  • 8/7/2019 ELEC3030 Notes v1

    36/118

  • 8/7/2019 ELEC3030 Notes v1

    37/118

  • 8/7/2019 ELEC3030 Notes v1

    38/118

  • 8/7/2019 ELEC3030 Notes v1

    39/118

    page 39 E763(part 2) Numerical Methods

    )()(')(')()(' xqxtxqxtxg +=

    )()('')(')('2)('')()('' xqxtxqxtxqxtxg ++=

    L (4.71)

    =

    =i

    j

    jiji xQxt

    jij

    ixg

    0

    )()()( )()(

    )!(!

    !)(

    and since we are interested on the values of the derivatives atx = 0, we have:

    =

    =

    i

    j

    jiji Qtjij

    ig

    0

    )()()( )0()0()!(!

    !)0( (4.72)

    The first derivative of a polynomial, say, )(xQn is 121 2 bxbxnb nn +++

    L , so the second

    derivative will be: 232 232)1( bxbxnbn nn +++

    L and so on. Then these derivatives

    evaluated atx = 0 are successively: jbjbbbb !,,,)432(,)32(,2, 4321 L

    Then, we can write (4.72) as: =

    =

    =

    =i

    j

    jij

    i

    j

    jiji bcibjicj

    jij

    ig

    00

    )( !)!(!)!(!

    !)0( and equating

    this to the ith derivative of )(xPm evaluated atx = 0, that is, iai! gives:

    =

    =i

    j

    jiji bca0

    , but since 10 =b we can finally write:

    i

    i

    j

    jiji cbca =

    =

    1

    0

    for i = 1, , k, (k= m + n). (4.73)

    where we take the coefficients 0=ia for mi > and 0=ib for ni > .

    Example

    Consider the functionx

    xf

    =1

    1)( . This function has a pole at x = 1 and polynomial

    approximations will not perform well.

    The Taylor coefficients of this function are given by: !2

    )12(531

    j

    jc jj

    =

    L

    So the first five are: 10 =c ,2

    11 =c ,

    8

    32 =c ,

    16

    53 =c ,

    128

    354 =c which gives a polynomial of

    order 4.

    From the equations above we can calculate the Pad coefficients. We choose: m = n =2, so

    k= m + n = 4.

    Taking 10 =b , 000 abc = gives 10 =a

    The other equations (from asking the derivatives to fit) are:

  • 8/7/2019 ELEC3030 Notes v1

    40/118

    E763 (part 2) Numerical Methods page 40

    i

    i

    j

    jiji cbca =

    =

    1

    0

    for i = 1, , k, (k= m + n)

    and in detail:

    4132231404

    31221303

    211202

    1101

    cbcbcbcbca

    cbcbcbca

    cbcbca

    cbca

    =

    ==

    =

    but form = n =2, we have 04343 ==== bbaa and the system can be written as:

    41322

    31220

    211202

    1101

    000

    000

    cbcbc

    cbcbc

    cbcbca

    cbca

    =

    =

    =

    =

    and we can see that the second set of equations can be solved for the coefficients bi. Re-writing

    this system:

    42213

    32012

    cbcbc

    cbcbc

    =+

    =+

    In general, when 2kmn == as in this case the matrix that define the system will be of the

    form:

    +++

    0321

    3012

    2101

    1210

    rrrr

    rrrr

    rrrr

    rrrr

    nnn

    n

    n

    n

    L

    LLLLL

    L

    L

    L

    This is a special kind of matrix called the Toeplitz matrix that has the same element along each

    diagonal so it is defined by a total of 2n+1 numbers. There are methods for solving systems with

    this matrix and in particular,

    Solving the system will give:

    ]161,43,1[ =a and ]165,45,1[ =b

    giving:

    2

    2

    2210

    22102

    20.31251.251

    0.06250.751)(

    xx

    xx

    xbxbb

    xaxaaxR

    +

    +=

    ++

    ++=

  • 8/7/2019 ELEC3030 Notes v1

    41/118

    page 41 E763(part 2) Numerical Methods

    Fig. 4.12 shows the function

    xxf

    =

    1

    1)( (blue line) and the Pad

    approximant (red line)

    2

    222

    0.31251.251

    0.06250.751)(

    x

    xxxR

    +

    +=

    The Taylor polynomial up to 4th order:4

    43

    32

    210)( xcxcxcxccxP ++++=

    with a green line.0 1

    0

    2

    4

    6

    8

    Fig. 4.12

    It is clear that the Pad approximant gives a better fit, particularly closer to the pole.

    Increasing the order, the Pad approximation

    gets closer to the singularity.

    Fig. 4.13 shows the approximations for

    m = n = 1, 2, 3 and 4.

    The poles closer to 1 of this functions are:

    333.1:)(11 xR

    106.1:)(22 xR

    052.1:)(33 xR

    031.1:)(44 xR

    0 0.5 10

    2

    4

    6

    8

    Fig. 4.13

    We can see that even )(11 xR , a ratio of linear functions ofx, gives a better approximation than

    the 4th order Taylor polynomial.

    Exercise 4.7

    Using the Taylor (McLaurin) expansion of xxf cos)( = , truncated to order 4:

    2421)(

    424

    0

    xxxcxt

    k

    kk +==

    =

    find the Pad approximant:

    012

    2

    012

    2

    2

    222

    )(

    )()(

    bxbxb

    axaxa

    xQ

    xPxR

    ++

    ++==

  • 8/7/2019 ELEC3030 Notes v1

    42/118

  • 8/7/2019 ELEC3030 Notes v1

    43/118

  • 8/7/2019 ELEC3030 Notes v1

    44/118

  • 8/7/2019 ELEC3030 Notes v1

    45/118

  • 8/7/2019 ELEC3030 Notes v1

    46/118

  • 8/7/2019 ELEC3030 Notes v1

    47/118

  • 8/7/2019 ELEC3030 Notes v1

    48/118

  • 8/7/2019 ELEC3030 Notes v1

    49/118

  • 8/7/2019 ELEC3030 Notes v1

    50/118

  • 8/7/2019 ELEC3030 Notes v1

    51/118

  • 8/7/2019 ELEC3030 Notes v1

    52/118

  • 8/7/2019 ELEC3030 Notes v1

    53/118

  • 8/7/2019 ELEC3030 Notes v1

    54/118

  • 8/7/2019 ELEC3030 Notes v1

    55/118

  • 8/7/2019 ELEC3030 Notes v1

    56/118

  • 8/7/2019 ELEC3030 Notes v1

    57/118

  • 8/7/2019 ELEC3030 Notes v1

    58/118

  • 8/7/2019 ELEC3030 Notes v1

    59/118

  • 8/7/2019 ELEC3030 Notes v1

    60/118

  • 8/7/2019 ELEC3030 Notes v1

    61/118

  • 8/7/2019 ELEC3030 Notes v1

    62/118

  • 8/7/2019 ELEC3030 Notes v1

    63/118

  • 8/7/2019 ELEC3030 Notes v1

    64/118

  • 8/7/2019 ELEC3030 Notes v1

    65/118

  • 8/7/2019 ELEC3030 Notes v1

    66/118

  • 8/7/2019 ELEC3030 Notes v1

    67/118

  • 8/7/2019 ELEC3030 Notes v1

    68/118

  • 8/7/2019 ELEC3030 Notes v1

    69/118

    E763 (part 2) Numerical Methods page 68

    n subintervals.

    Change of Variable

    The above procedure was developed for definite integrals over the interval [1, 1]. Integralsover other intervals can be calculated after a change of variables. For example if the integral tocalculate is:

    b

    a

    dttf )(

    To change from the interval [a, b] to [1, 1] the following change of variable can be made:

    2)(

    2)(

    ab

    batx

    + or

    22

    bax

    abt

    ++

    so dx

    abdt

    2

    =

    Then, the integral can be approximated by:

    =

    ++

    n

    i

    ni

    ni

    b

    a

    bax

    abfw

    abdttf

    1222

    )( (6.43)

    Exercise 6.11

    Use Gaussian quadrature to calculate: +25.1

    25.0

    )5.0(sin dxx

  • 8/7/2019 ELEC3030 Notes v1

    70/118

  • 8/7/2019 ELEC3030 Notes v1

    71/118

  • 8/7/2019 ELEC3030 Notes v1

    72/118

  • 8/7/2019 ELEC3030 Notes v1

    73/118

  • 8/7/2019 ELEC3030 Notes v1

    74/118

  • 8/7/2019 ELEC3030 Notes v1

    75/118

  • 8/7/2019 ELEC3030 Notes v1

    76/118

  • 8/7/2019 ELEC3030 Notes v1

    77/118

  • 8/7/2019 ELEC3030 Notes v1

    78/118

  • 8/7/2019 ELEC3030 Notes v1

    79/118

  • 8/7/2019 ELEC3030 Notes v1

    80/118

  • 8/7/2019 ELEC3030 Notes v1

    81/118

  • 8/7/2019 ELEC3030 Notes v1

    82/118

  • 8/7/2019 ELEC3030 Notes v1

    83/118

  • 8/7/2019 ELEC3030 Notes v1

    84/118

  • 8/7/2019 ELEC3030 Notes v1

    85/118

  • 8/7/2019 ELEC3030 Notes v1

    86/118

  • 8/7/2019 ELEC3030 Notes v1

    87/118

  • 8/7/2019 ELEC3030 Notes v1

    88/118

  • 8/7/2019 ELEC3030 Notes v1

    89/118

    page 87 E763(part 2) Numerical Methods

    Example

    For the problem of the square coaxial (or square capacitor) seen earlier, the BV problem is

    defined by the Laplace equation: 2= 0 with some boundary conditions (L = 2 , u = ,s = 0).

    An appropriate functional (variational expression) for this case is:

    J() = ( )2 d (given) (8.21)

    Using Rayleigh-Ritz: J() = djbj x,y( )j =1

    N

    2

    d

    = dj bj (x,y)j=1

    N

    2

    d

    J() = didjbi (x,y) bj (x,y)j =1

    N

    i =1

    N

    d (8.22)

    This can be written as the matrix equation: J(d) = dTAd,

    where d = { dj} and aij = bi bj

    d

    Now, find stationary value:J

    di= 0 for all i: i = 1, ... ,N

    so, applying it to (8.22):J

    di= aij dj

    j=1

    N

    = 0 , for all i: i = 1, ... ,N

    And the problem reduces to the matrix equation: A d = 0 (8.23)

    Solving the system of equations (8.23) we obtain the coefficients dj and the unknown

    function can be obtained as:

    u(x,y) = dj bj (x,y)j=1

    N

    We can see that both methods, the weighted residuals and the variational method transform

    the BV problem into an algebraic, matrix problem.

    One of the first steps in the implementation of either method is the choice of appropriate

    expansion functions to use in the Rayleigh-Ritz procedure: basis or trial functions and weighting

    functions.

  • 8/7/2019 ELEC3030 Notes v1

    90/118

    E763 (part 2) Numerical Methods page 88

    The finite element method provides a simple form to construct these functions and

    implementing these methods.

  • 8/7/2019 ELEC3030 Notes v1

    91/118

  • 8/7/2019 ELEC3030 Notes v1

    92/118

  • 8/7/2019 ELEC3030 Notes v1

    93/118

  • 8/7/2019 ELEC3030 Notes v1

    94/118

  • 8/7/2019 ELEC3030 Notes v1

    95/118

  • 8/7/2019 ELEC3030 Notes v1

    96/118

  • 8/7/2019 ELEC3030 Notes v1

    97/118

  • 8/7/2019 ELEC3030 Notes v1

    98/118

  • 8/7/2019 ELEC3030 Notes v1

    99/118

  • 8/7/2019 ELEC3030 Notes v1

    100/118

  • 8/7/2019 ELEC3030 Notes v1

    101/118

  • 8/7/2019 ELEC3030 Notes v1

    102/118

  • 8/7/2019 ELEC3030 Notes v1

    103/118

  • 8/7/2019 ELEC3030 Notes v1

    104/118

  • 8/7/2019 ELEC3030 Notes v1

    105/118

    page A1 E763(part 2) Numerical Methods Appendix

    APPENDIX

    1. Taylor theorem

    For a continuous function we have )()()(' afxfdttf

    x

    a

    = , then, we can write:

    +=x

    a

    dttfafxf )(')()( or )()()( 0 xRafxf += (A1.1)

    where the reminder is =x

    a

    dttfxR )(')(0 .

    We can now integrateR0 by parts using:)(

    )()(' )2(

    txvdtdv

    dttfdutfu

    ==

    ==giving:

    +==x

    a

    x

    a

    x

    a

    dttftxtftxdttfxR )()()(')()(')( )2(0 which gives after solving and

    substituting in (A1.1):

    ++=x

    a

    dttftxafaxafxf )()()(')()()( )2( or

    )())((')()( 1 xRaxafafxf ++= (A1.2)

    We can also integrateR1 by parts using this time:

    2

    )()(

    )()(2

    )3()2(

    txvdttxdv

    dttfdutfu

    ==

    ==which gives:

    +==x

    a

    x

    a

    x

    a

    dttftxtxtf

    dttftxxR )()()(2

    )()()()( )3(22

    )2()2(

    1 and again, after

    substituting in (A1.2) gives:

    +++=x

    a

    dttftxaxafaxafafxf )()()(2

    )())((')()( )3(22)2(

    Proceeding in this way we get the expansion:

    nn

    n

    Raxn

    afax

    afax

    afaxafafxf ++++++= )(

    !

    )()(

    !3

    )()(

    2

    )())((')()(

    )(3

    )3(2

    )2(

    L (A1.3)

    where the reminder can be written as: +

    =x

    a

    nn

    n dttfn

    txxR )(

    !

    )()( )1( (A1.4)

    To find a more useful for for the reminder we need to invoke some general mathematicaltheorems:

  • 8/7/2019 ELEC3030 Notes v1

    106/118

    E763 (part 2) Numerical Methods Appendix page A2

    First Theorem for the Mean Value of Integrals

    If the function )(tg is continuous and integrable in the interval [a, x], then there exists a point

    between a and x such that: ))(()( axgdttg

    x

    a

    = .

    This says simply that the integral can be represented by an average value of the function )(g

    times the length of the interval. Because this average value must be between the minimum and

    the maximum values and the function is continuous, there will be a point for which the

    function has this value.

    And in a more complex form:

    Second Theorem for the Mean Value of Integrals

    Now if the functionsgand h are continuous and integrable in the interval and h does not changesign in the interval, there exists a point between a andx such that:

    =x

    a

    x

    a

    dtthgdtthtg )()()()(

    If we now use this second theorem on expression (A1.4), with: )()( )1( tftg n+= and

    !

    )()(

    n

    txth

    n= , we get:

    = +

    x

    a

    nn

    n dtn

    txfxR

    !

    )()()( )1( which can be integrated, giving:

    1)1(

    )()!1(

    )()( +

    +

    +

    = nn

    n txn

    fxR

    (A1.5)

    for the reminder of the Taylor expansion, where is appoint between a andx.

  • 8/7/2019 ELEC3030 Notes v1

    107/118

  • 8/7/2019 ELEC3030 Notes v1

    108/118

  • 8/7/2019 ELEC3030 Notes v1

    109/118

  • 8/7/2019 ELEC3030 Notes v1

    110/118

  • 8/7/2019 ELEC3030 Notes v1

    111/118

  • 8/7/2019 ELEC3030 Notes v1

    112/118

  • 8/7/2019 ELEC3030 Notes v1

    113/118

    page A9 E763(part 2) Numerical Methods Appendix

    4. A variational formulation for the wave equation

    Equation (8.20) in the example on the use of the variational method shows a variational

    formulation for the one-dimensional wave equation. In the following we will prove that indeed

    both problems are equivalent.

    Equation (8.20) stated:

    k2 =s.v.

    dy

    dx

    2

    dx

    a

    b

    y2 dx

    a

    b

    (A4.1)

    Lets examine a variation ofk2 produced by a small perturbation y on the solutiony:

    k2(y + y) = k2 + k2 =

    d(y + y)dx

    2

    dx

    a

    b

    (y +y)2 dxa

    b

    And re-writing:

    k2 +k2( ) (y +y)2 dx

    a

    b

    =d(y + y)

    dx

    2

    dx

    a

    b

    (A4.2)

    Expanding and neglecting higher order variations:

    k2 +k2( ) (y2 + 2yy) dx

    a

    b

    =dy

    dx

    2

    + 2dy

    dx

    dy

    dx

    dx

    a

    b

    or

    k2

    y2

    dx

    a

    b

    + 2k2 yy dxa

    b

    + k2 y2 dxa

    b

    =dy

    dx

    2

    dx

    a

    b

    + 2dy

    dx

    dy

    dxdx

    a

    b

    (A4.3)

    and now using (A4.1):

    2k2

    yy dx

    a

    b

    +k2 y2 dxa

    b

    = 2 dydxdydx

    dx

    a

    b

    (A4.4)

    Now, since we want k2 to be stationary about the solution functiony, we make k2 = 0, and we

    examine what conditions this imposes on the functiony:

    k2

    yy dx

    a

    b

    =dy

    dx

    dy

    dxdx

    a

    b

    (A4.5)

    Integrating the RHS by parts:

    k2

    yy dx

    a

    b

    = dydxy ab y d

    2y

    dx2dx

    a

    b

  • 8/7/2019 ELEC3030 Notes v1

    114/118

    E763 (part 2) Numerical Methods Appendix page A10

    Or re-arranging:

    yd2y

    dx2+ k2y

    dx

    a

    b

    =dy

    dxy

    a

    b

    (A4.6)

    Since y is arbitrary, (A4.6) can only be valid if both sides are zero. That means thaty shouldsatisfy the differential equation:

    d2y

    dx 2+ k2y = 0 (A4.7)

    and any of the boundary conditions:

    dy

    dx= 0 at a and b or y = 0 at a and b (fixed values ofy at the ends). (A4.8)

    Summarizing, we can see that imposing the condition of stationarity of (A4.1) with respect

    to small variations of the function y leads toy satisfying the differential equation (A4.7), which

    is the wave equation, and any of the boundary conditions (A4.8); that is, either fixed values ofy

    at the ends (Dirichlet B.C.), or zero normal derivative (Neumann B.C.).

  • 8/7/2019 ELEC3030 Notes v1

    115/118

  • 8/7/2019 ELEC3030 Notes v1

    116/118

    E763 (part 2) Numerical Methods Appendix page A12

    6. Shape Functions (Interpolation Functions)

    The function u is approximated in each triangle by a first order function (a plane). This

    will be given by an expression of the form: p + qx + ry which can also be written as a vector

    product (equation 9.14).

    u(x,y) = p + qx + ry = (1 x y)

    p

    q

    r

    (A6.1)

    Evaluating this expression at each node of a triangle (with nodes numbered 1, 2 and 3):

    u1 = p+ qx1 + ry1u2 = p + qx2 + ry2

    u3 = p+ qx3 + ry3

    u1

    u2

    u3

    =

    1 x1 y1

    1 x2 y2

    1 x3 y3

    p

    q

    r

    (A6.2)

    And from here we can calculate the value of the constants p, q and rin terms of the nodal values

    and the coordinates of the nodes:

    p

    q

    r

    =

    1 x1 y1

    1 x2 y2

    1 x3 y3

    1u1

    u2

    u3

    (A6.3)

    Replacing (A6. 3) in (A6.1):

    u(x,y) = (1 x y)

    1 x1 y1

    1 x2 y2

    1 x3 y3

    1u1

    u2

    u3

    (A6.4)

    and comparing with (9.15), written as a vector product:

    u(x,y) u(x,y) = u1N1(x,y) + u2N2 (x,y) + u3N3(x,y) = (N1 N2 N3 )

    u1

    u2

    u3

    (A6.5)

    we have finally:

    (N1 N2 N3)= (1 x y)

    1 x1 y1

    1 x2 y2

    1 x3 y3

    1

    (A6.6)

    Solving the right hand side (inverting the matrix and multiplying), gives the expression for

    each shape function (9.16):

    Ni (x,y) =1

    2Aai + bix + ciy( ) (A6.7)

    whereA is the area of the triangle and

  • 8/7/2019 ELEC3030 Notes v1

    117/118

    page A13 E763(part 2) Numerical Methods Appendix

    a1 =x2y3 x3y2 b1 =y2 y3 c1 =x3 x2

    a2 =x3y1 x1y3 b2 =y3 y1 c2 =x1 x3 (A6.8)

    a3 =x1y2 x2y1 b3 =y1 y2 c3 =x2 x1

    Note that from (A5.1), the area of the triangle can be written as:

    A = 12 a1 + a2 + a3( ) (A6.9)

  • 8/7/2019 ELEC3030 Notes v1

    118/118