Beruflich Dokumente
Kultur Dokumente
Systems of Nonlinear
A general system of n nonlinear equations:
fi ( x1 , x2 , ..., xn ) fi ( x) 0
(i 1, 2,..., n)
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
Example
Equation
Nu
(Number of unknowns)
4
3
(1)
(2)
x2
x1 ln 3
x4
(3)
x x3 2
(4)
x2 + x4 = 4
x3 (x3 + x6) = 7
2
2
(5)
(6)
x1x2 + x6x4 = 18
x2 + x5 + x6 = 12
2
3
Apply algorithm
Solution Order
Output variable
Equation
x3
x32 x3 2
x6
x6
x4
4 x4
18 x6 x4
ln
3
4 x4
x4
x1
x1
x2
x2 = 4 - x4
x5
x5 = 12 - x2 - x6
7
x3
x3
18 x6x4
4 x4
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
Optimization-based methods
Excels solver
Matlab fsolve function
Simultaneous Nonlinear Algebraic
Equations
14
Example
x1 2 x2 x3 33
x12 x22 x32 81
x1 x2
x3 2 4
15
Gauss-Jacobi
Rearrange to obtain an equation for each variable
33 x1*
*
*
*
x3 f1 x1 , x2 , x3
x2*
x
4 x
* 2
3
* 2
1
x2 f 2 x , x , x 81 x
*
1
*
2
*
3
*
3
x2*
k 1
1
k 1
1
16
1.0000
2.0000
3.0000
4.0000
5.0000
6.0000
7.0000
8.0000
9.0000
10.0000
11.0000
12.0000
13.0000
14.0000
15.0000
16.0000
17.0000
18.0000
x2
x3
error1
error2
error3
2.0000 10.0000
0.5488 7.2111
1.5229 8.4096
0.7964 7.6595
1.1354 8.1300
0.9157 7.8828
1.0427 8.0457
0.9704 7.9617
1.0144 8.0163
0.9901 7.9876
1.0049 8.0057
0.9967 7.9960
1.0017 8.0020
0.9989 7.9987
1.0006 8.0007
0.9996 7.9996
1.0002 8.0002
0.9999 7.9999
5.0000
3.1586
4.4735
3.7773
4.1919
3.9280
4.0649
3.9747
4.0211
3.9910
4.0068
3.9968
4.0022
3.9989
4.0007
3.9996
4.0002
3.9999
-0.726
1.775
-0.477
0.426
-0.194
0.139
-0.069
0.045
-0.024
0.015
-0.008
0.005
-0.003
0.002
-0.001
0.001
0.000
-0.279
0.166
-0.089
0.061
-0.030
0.021
-0.010
0.007
-0.004
0.002
-0.001
0.001
0.000
0.000
0.000
0.000
0.000
-0.368
0.416
-0.156
0.110
-0.063
0.035
-0.022
0.012
-0.007
0.004
-0.002
0.001
-0.001
0.000
0.000
0.000
0.000
x1
17
18
Wegstein method
Use iterative equations for subsequent
guesses
1
1 si
max
19
Wegstein example
k
x1
x2
x3
f1
s1
t1
f2
s2
t2
1.0000
2.0000
10.0000
5.0000
0.5488
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
7.2111
f3
s3
t3
error1
error2
error3
3.1586
20
Optimization-based methods
Excels solver
Matlab fsolve function
Simultaneous Nonlinear Algebraic
Equations
21
Newtons Method
Also called Newton-Raphson method
Write equations as f i {x1 , x2 ,, xm } 0
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
n f k x
j
j
d
f
x
i
k
x
j
1
i
i
x
Simultaneous Nonlinear Algebraic
Equations
k 1, 2, , n
22
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
f1
x1
f 2
x1
f
m
x1
f1
x 2
f 2
x 2
f m
x 2
x
1
1
*
x2 2
x3
*
f m x m m
x m *
f1
x m
f 2
x m
24
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
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 F ( x) [ f ( x)]
Use a multidimensional optimization code
to minimize this function. If the minimum is
equal to zero, then it solves the problem.
2
29
30
x1 2 x2 x3 33
x12 x22 x32 81
x1 x2
x3 2 4
Rearrange to
1
f1 ( x1 , x2 , x3 ) x1 2 x2 x3 33 0
f 2 ( x1 , x2 , x3 ) x12 x22 x32 81 0
f 3 ( x1 , x2 , x3 ) x1 x2 3 x3 2 4 0
1
31
Excel Solver
32
Excel Solver
33
Excel Solver
Solution obtained
34
Matlab fsolve
35
Matlab fsolve
36
37
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