+ All Categories
Home > Documents > Systems of Nonlinear Algebraic Equations

Systems of Nonlinear Algebraic Equations

Date post: 21-Nov-2015
Category:
Upload: fuchi-del-cachorro
View: 28 times
Download: 6 times
Share this document with a friend
Description:
systems of nonlinear algebraic equations
Popular Tags:
36
Systems of Nonlinear Equations
Transcript
  • Systems of Nonlinear Equations

  • Systems of Nonlinear A general system of n nonlinear equations:

    In general, it is difficult to solve such sets of equations Bounding techniques cannot be used. In addition, plotting a function to locate the solutions,

    which will work for a single nonlinear equation, will not generally work for a system of nonlinear equations.

    Use algorithms to minimize the number of equations that must be solved.

    1 2( , , ..., ) ( ) 0 ( 1, 2,..., )n iif x x x f i n x

    Simultaneous Nonlinear Algebraic Equations

    2

  • Precedence Ordering Reduce the number of equations that must

    be solved simultaneously Identify two classes of variables and

    appropriately order equations: Equations that can be solved for an unknown

    variable irrespective of the other equations solve these first

    Variables that appear in only one equation. Solve these equations after all others have been solved.

    Simultaneous Nonlinear Algebraic Equations

    3

  • ExampleEquation Nu

    (Number of unknowns)

    x1x2 + x6x4 = 18 4 (1)x2 + x5 + x6 = 12 3 (2)

    x xx1

    2

    4

    3 ln

    3 (3)

    x x32

    3 2 1 (4)x2 + x4 = 4 2 (5)x3 (x3 + x6) = 7 2 (6)

    1. Solve equation 4 for x3 and remove variable from set.Simultaneous Nonlinear Algebraic

    Equations5

  • Apply algorithmSolution Order Output variable Equation

    1 x3 x x32

    3 2 2 x6 x

    xx6

    33

    7

    3 x4 184

    4 36 44

    4

    4

    x xx

    xx

    ln

    4 x1 x x xx16 4

    4

    184

    5 x2 x2 = 4 - x4

    6 x5 x5 = 12 - x2 - x6

    Simultaneous Nonlinear Algebraic Equations

    8

    Only one non-linear equation (eqn 4) must be solved. All others calculated directly

  • The Tearing Method Is useful when most of the nonlinearity of a problem is

    associated with a single unknown. The nonlinear variable and one nonlinear equation are

    torn from the problem and a value for the nonlinear unknown is assumed.

    The remaining equations are solved for the remaining unknowns using any desired method.

    The values of the calculated unknowns are combined with the assumed value of the nonlinear unknown to evaluate the torn equation.

    Adjust the nonlinear unknown until the torn equation is satisfied thus solving the original problem.

    Simultaneous Nonlinear Algebraic Equations

    9

  • Conclusions Tearing and Precedence ordering algorithms

    can reduce the number of equations that must be solved simultaneously

    These algorithms can increase the potential for finding a solution

    We will focus on techniques for solving the equations, but recall that these algorithms will increase the potential for solving a problem

    Simultaneous Nonlinear Algebraic Equations

    12

  • Numerical Methods All methods implement iterative solution

    techniques. Each method has another way to update the

    solution. All methods may sometimes converge

    toward a solution and may also diverge, depending on Specifics of the problem The initial guess used.

    Simultaneous Nonlinear Algebraic Equations

    13

  • Three broad classes of methods Methods that dont use partial derivatives

    Gauss-Jacobi like direct substitution Wegstein like false position

    Methods that use partial derivatives Analytical partial derivatives Partial derivatives based on finite difference

    estimates Optimization-based methods

    Excels solver Matlab fsolve function

    Simultaneous Nonlinear Algebraic Equations

    14

  • Iterative Methods without Partial Derivatives

    Gauss-Jacobi Similar to method of direct substitution

    Example

    Simultaneous Nonlinear Algebraic Equations

    15

    481

    33

    21

    33

    121

    23

    22

    21

    322

    1

    1

    xxx

    xxxxxx

  • Gauss-Jacobi

    Simultaneous Nonlinear Algebraic Equations

    16

    *

    2

    32

    1*3

    *3

    *2

    *131

    212*

    32*

    1*3

    *2

    *122

    *2

    21*

    1*3

    *2

    *113

    4,,

    81,,

    33,,

    x

    xxxxfx

    xxxxxfx

    xxxxxfx

    Rearrange to obtain an equation for each variable

    Iterate using these equations, check for convergence by comparing change in each variable from one step to the next, e.g. for the kth iteration,

    11

    111

    1 k

    kk

    xxxerror

  • Spreadsheet for Gauss-Jacobi

    Simultaneous Nonlinear Algebraic Equations

    17

    k x1 x2 x3 error1 error2 error31.0000 2.0000 10.0000 5.00002.0000 0.5488 7.2111 3.1586 -0.726 -0.279 -0.3683.0000 1.5229 8.4096 4.4735 1.775 0.166 0.4164.0000 0.7964 7.6595 3.7773 -0.477 -0.089 -0.1565.0000 1.1354 8.1300 4.1919 0.426 0.061 0.1106.0000 0.9157 7.8828 3.9280 -0.194 -0.030 -0.0637.0000 1.0427 8.0457 4.0649 0.139 0.021 0.0358.0000 0.9704 7.9617 3.9747 -0.069 -0.010 -0.0229.0000 1.0144 8.0163 4.0211 0.045 0.007 0.012

    10.0000 0.9901 7.9876 3.9910 -0.024 -0.004 -0.00711.0000 1.0049 8.0057 4.0068 0.015 0.002 0.00412.0000 0.9967 7.9960 3.9968 -0.008 -0.001 -0.00213.0000 1.0017 8.0020 4.0022 0.005 0.001 0.00114.0000 0.9989 7.9987 3.9989 -0.003 0.000 -0.00115.0000 1.0006 8.0007 4.0007 0.002 0.000 0.00016.0000 0.9996 7.9996 3.9996 -0.001 0.000 0.00017.0000 1.0002 8.0002 4.0002 0.001 0.000 0.00018.0000 0.9999 7.9999 3.9999 0.000 0.000 0.000

  • Methods without partial derivatives

    Wegsteins Method Similar to a multi-dimensional false position

    method Generally requires fewer iterations that Gauss-

    Jacobi and less likely to diverge Again write equations as Use direct substitution to obtain 2nd guess

    Simultaneous Nonlinear Algebraic Equations

    18

    mixxxfx mii ,,2,1},,,,{ 21

  • Wegstein method

    Use iterative equations for subsequent guesses

    We usually limit the distance you can extrapolate by setting A typical value for tmax is 10.

    Simultaneous Nonlinear Algebraic Equations

    19

    )1()(

    _1()1(2

    )1(1

    )()(2

    )(1

    )()()(2

    )(1

    )1(

    ,,,,,,

    11

    :,,2,1,1,,,

    ki

    ki

    km

    kki

    km

    kki

    i

    ii

    kii

    km

    kkii

    ki

    xxxxxfxxxfs

    st

    wheremixtxxxftx

    maxtti

  • Wegstein example

    Simultaneous Nonlinear Algebraic Equations

    20

    k x1 x2 x3 f1 s1 t1 f2 s2 t2 f3 s3 t3 error1 error2 error3

    1.0000 2.0000 10.0000 5.0000 0.5488 7.2111 3.1586

    2.0000 0.5488 7.2111 3.1586 1.5229 -0.6712 0.5984 8.4096 -0.4298 0.6994 4.4735 -0.7141 0.5834 -0.726 -0.279 -0.368

    3.0000 1.1317 8.0494 3.9257 1.0219 -0.8595 0.5378 8.0192 -0.4657 0.6823 3.9675 -0.6596 0.6026 1.062 0.116 0.243

    4.0000 1.0727 8.0288 3.9509 1.0149 0.1189 1.1349 8.0150 0.2071 1.2611 3.9812 0.5427 2.1865 -0.052 -0.003 0.006

    5.0000 1.0071 8.0113 4.0171 0.9922 0.3469 1.5313 7.9905 1.4004 -2.4974 3.9939 0.1916 1.2370 -0.061 -0.002 0.017

    6.0000 0.9842 8.0634 3.9884 0.9965 -0.1872 0.8423 8.0078 0.3313 1.4954 3.9695 0.8468 6.5275 -0.023 0.006 -0.007

    7.0000 0.9945 7.9802 3.8654 1.0544 5.6242 -0.2163 8.0666 -0.7071 0.5858 4.0103 -0.3312 0.7512 0.010 -0.010 -0.031

    8.0000 0.9816 8.0308 3.9742 1.0058 3.7514 -0.3635 8.0151 -1.0170 0.4958 3.9858 -0.2247 0.8165 -0.013 0.006 0.028

    9.0000 0.9728 8.0230 3.9837 1.0032 0.2941 1.4166 8.0115 0.4660 1.8725 3.9902 0.4670 1.8763 -0.009 -0.001 0.002

    10.0000 1.0159 8.0014 3.9960 1.0013 -0.0444 0.9575 8.0000 0.5316 2.1349 3.9983 0.6567 2.9131 0.044 -0.003 0.003

    11.0000 1.0020 7.9984 4.0028 0.9992 0.1550 1.1834 7.9984 0.5383 2.1661 4.0007 0.3512 1.5412 -0.014 0.000 0.002

    12.0000 0.9987 7.9984 3.9996 1.0004 -0.3649 10.0000 8.0004 -45.5222 0.0215 4.0009 -0.0714 0.9333 -0.003 0.000 -0.001

    13.0000 1.0158 7.9984 4.0008 0.9999 -0.0279 0.9729 7.9976 -63.7828 0.0154 3.9998 -0.8648 0.5363 0.017 0.000 0.000

    14.0000 1.0003 7.9984 4.0003 1.0001 -0.0131 0.9871 7.9998 -180.0035 0.0055 4.0008 -1.8089 0.3560 -0.015 0.000 0.000

    15.0000 1.0001 7.9984 4.0005 1.0000 0.3033 1.4354 7.9998 -7.8148 0.1134 4.0008 0.0564 1.0598 0.000 0.000 0.000

  • Three broad classes of methods Methods that dont use partial derivatives

    Gauss-Jacobi like direct substitution Wegstein like false position

    Methods that use partial derivatives Analytical partial derivatives Partial derivatives based on finite difference

    estimates Optimization-based methods

    Excels solver Matlab fsolve function

    Simultaneous Nonlinear Algebraic Equations

    21

  • Newtons Method Also called Newton-Raphson method Write equations as Write a Taylor series expansion of each equation

    about the guess value Rearrange the equation to solve for a new guess

    value Newtons method applied to a general set of n

    nonlinear equations is given by

    1

    1, 2, ,j

    nj jk

    i ki i x

    fd f k n

    x

    x

    x

    Simultaneous Nonlinear Algebraic Equations

    22

    0},,,{ 21 mi xxxf

  • Newtons method This equation generates a system of n linear

    equations for which the coefficient matrix, called the Jacobian, is the partial derivatives of the nonlinear equations evaluated at the current values of the unknowns

    The right hand side vector is a vector of the negative values of the function values evaluated at the current values of the unknowns and di=xi(j+1) -xi(j)

    Simultaneous Nonlinear Algebraic Equations

    23

  • Newtons method

    Equations can be written

    Simultaneous Nonlinear Algebraic Equations

    24

    mm

    m

    mmm

    m

    m

    x

    xxx

    xf

    xf

    xf

    xf

    xf

    xf

    xf

    xf

    xf

    2

    1

    3

    2

    1

    **2*1

    *

    2

    *2

    2

    *1

    2

    *

    1

    *2

    1

    *1

    1

  • Newtons Method

    The Jacobian used by Newtons method can be calculated using analytical expressions for the elements of the Jacobian or it can be calculated numerically using finite difference formulas.

    The finite difference approach is easier to apply, but is susceptible to reliability issues for highly nonlinear systems of equations.

    Simultaneous Nonlinear Algebraic Equations

    25

  • Newtons Method Newtons method will solve over 95% of

    the nonlinear equation problems encountered in engineering.

    Similar to the results for a single nonlinear equation, A good initial guess for the unknowns is many

    times required for reliable convergence. The more linear that equations can be

    formulated, the greater the reliability for convergence and the better the computational efficiency.

    Simultaneous Nonlinear Algebraic Equations

    26

  • Newtons Method Davis provides a VBA macro QUASINEWTON

    to solve a set of equations using Jacobian calculated by finite difference (see section 6.3.4, page 209)

    Lecture notes show VBA and Matlab code to solve an example with analytically determined Jacobian

    Lecture notes show Matlab code to solve example with Jacobian determined with finite difference approximation.

    Simultaneous Nonlinear Algebraic Equations

    27

  • Three broad classes of methods Methods that dont use partial derivatives

    Gauss-Jacobi like direct substitution Wegstein like false position

    Methods that use partial derivatives Analytical partial derivatives Partial derivatives based on finite difference

    estimates Optimization-based methods

    Excels solver Matlab fsolve function

    Simultaneous Nonlinear Algebraic Equations

    28

  • Optimization-based Techniques

    Write problem as f(x) = 0. For any value of x other than the solution,

    f(x) will not be zero. Could be positive or negative.

    Write a new function Use a multidimensional optimization code

    to minimize this function. If the minimum is equal to zero, then it solves the problem.

    2)]([)( xfxF

    Simultaneous Nonlinear Algebraic Equations

    29

  • Excel and Matlab tools

    Excel solver implements optimization Matlab fsolve function performs

    optimization of the same function. Lecture notes show implementation of these

    tools. See section 2.8 on page 62 of Davis for how to turn on the Solver in Excel.

    Excel solver and Matlab fsolve optimize the same function.

    Simultaneous Nonlinear Algebraic Equations

    30

  • Example of Excel Solver

    Again, consider

    Rearrange to

    Simultaneous Nonlinear Algebraic Equations

    31

    481

    33

    21

    33

    121

    23

    22

    21

    322

    1

    1

    xxx

    xxxxxx

    04),,(081),,(

    033),,(

    21

    33

    1213213

    23

    22

    213212

    322

    1

    13211

    xxxxxxf

    xxxxxxfxxxxxxf

  • Excel Solver

    Simultaneous Nonlinear Algebraic Equations

    32

  • Excel Solver

    Simultaneous Nonlinear Algebraic Equations

    33

  • Excel Solver

    Solution obtained

    Simultaneous Nonlinear Algebraic Equations

    34

  • Matlab fsolve

    Simultaneous Nonlinear Algebraic Equations

    35

  • Matlab fsolve

    Simultaneous Nonlinear Algebraic Equations

    36

  • Convergence and Accuracy

    Iterative solutions are required; therefore, convergence is an issue. Similar to a single nonlinear equation, a relative convergence criterion is recommended. For convergence all the unknowns should satisfy the relative convergence criteria.

    Accuracy is met by reducing the convergence criteria until the desired accuracy is attained.

    Simultaneous Nonlinear Algebraic Equations

    37

  • Stability and Computational Efficiency

    Divergence during the iterative solution process can be referred to as unstable convergence.

    The computational efficiency is primarily related to the computational efficiency of the linear equation solver because Newtons method is based on solving a series of linearized problems.

    Simultaneous Nonlinear Algebraic Equations

    38

  • Important issues

    Ensure equations formulated properly. Make the equations as linear as possible Make sure you have reasonable starting values for the

    unknowns. Physical considerations may provide a good starting value, as can simplifications of the nonlinear equations.

    Ensure that the answers are accurate. Choose the proper convergence criterion and check your answers in the original functions.

    Always ensure the solution makes sense from an engineering standpoint.

    Simultaneous Nonlinear Algebraic Equations

    39

  • Conclusions

    Solution of Simultaneous non-linear algebraic equations is difficult

    Several tools at our disposal Always reduce the set of equations as much

    as possible using precedence ordering or tearing methods.

    Many can be solved with Newtons method

    Simultaneous Nonlinear Algebraic Equations

    40

  • End of Simultaneous non-linear algebraic equations


Recommended