Download presentation
1
5. Nonlinear Functions of Several Variables
Jieun Yu Kyungsun Kwon Kyunghwi Kim Sungjin Kim Computer Networks Research Lab. Dept. of Computer Science and Engineering Korea University
2
Contents Introduction Newton’s Method for Nonlinear Systems
Fixed-Point Iteration for Nonlinear Systems Minimum of a Nonlinear Function of Several Variables MATLAB’s Methods Case Study
3
Introduction Chapter 1 Chapter 2 Chapter 3,4 Chapter 5
4
Introduction A zero of a nonlinear function of a single variable
Nonlinear functions of several variables The latter problem is much more difficult Newton’s method is applicable to this problem as well as that of a single variable
5
5.1 Newton’s Method for Nonlinear Systems
6
Newton’s Method Tangent line function Iteration form
Tangent plane function Iteration using r, s
7
Newton’s Method (cont’)
Step1 Step2
8
5.1.1 Matrix-Vextor Notation
Step1 Step2
9
Ex5.1 Intersection of a Circle and a Parabola
10
Ex5.1 Intersection of a Circle and a Parabola
Step1 Partial derivative Initial estimate (x0,y0) = (1/2, 1/2)
11
Ex5.1 Intersection of a Circle and a Parabola
Step2 The second approximate solution (x1,y1)
12
Ex5.1 Intersection of a Circle and a Parabola
Initial estimate and 2 iterations of Newton’s method iteration x y | | 0.5 1 0.875 0.625 2 The true solution is (x, y) = ( , )
13
5.1.2 MATLAB Function for Newton’s Method for Nonlinear Systems
\ operation -> 100p
14
Example 5.2 a System of Three Equations
15
Example 5.2 a System of Three Equations
16
Example 5.3 Intersection of a Circle and an Ellipse
y 1 0.5 x -0.5 -1 -1 -0.5 0.5 1
17
Example 5.3 Intersection of a Circle and an Ellipse
18
Example 5.4 Positioning a Robot Arm
the end of the first link(x1,y1) the end of the second link(x2,y2) We need to solve 10 (x2,y2) 8 6 β 4 (10,4) (x1,y1) 2 α 2 4 6 8 10
19
Example 5.4 Positioning a Robot Arm
Find the angles so that the arm will move to the point(10,4) The length of link (d1,d2) = (5, 6) initial angles (α , β) = (0.7,0.7) The system of equations
20
5.2 Fixed-Point Iteration For Nonlinear Systems
21
5.2 Fixed-Point Iteration For Nonlinear Systems
Ex 5.5 Fixed-Point Iteration for a System of two Nonlinear Function Consider the problem of finding a zero of the system Coverting form The graph of the equations and
22
5.2 Fixed-Point Iteration For Nonlinear Systems
0.2 0.4 0.6 0.8 1 Iteration 1 2 3 4 5 4.9381e-05
23
5.2 Fixed-Point Iteration For Nonlinear Systems
24
5.2 Fixed-Point Iteration For Nonlinear Systems
Using MATLAB function G = ex5_5(x) G = [ (-0.1*x(1)^ *x(2) + 0.5) (0.1*x(1) + 0.1*x(2)^ )]; % Actually using function : Fixed_pt_sys >> [ ], , 5)
25
5.2 Fixed-Point Iteration For Nonlinear Systems
Result
26
5.2 Fixed-Point Iteration For Nonlinear Systems
Ex 5.5 Fixed-Point Iteration for a System of Three Nonlinear Function Coverting this system to a fixed point iteration form
27
5.2 Fixed-Point Iteration For Nonlinear Systems
Using the preceding MATLAB function and a starting estimate of (2, 2, 2) Iteration 2.0000 1 3.7600 2.1000 4.0759 2 3.5729 1.6528 0.5518 3 3.6502 1.7621 4 3.6272 1.7232 5 3.6346 1.7350 6 3.6323 1.7312 7 3.6330 1.7324 8 3.6328 1.7320 9 1.7321 10 5.1098e-05
28
5.2 Fixed-Point Iteration For Nonlinear Systems
Using MATLAB function G = ex5_6(x) G = [ (-0.02*x(1)^ *x(2)^ *x(3)^2 + 4) (-0.05*x(1)^ *x(3)^ ) (0.025*x(1)^ *x(2)^ )]; % Actually using function : Fixed_pt_sys >> [2 2 2], , 10)
29
5.2 Fixed-Point Iteration For Nonlinear Systems
Result
30
5.2 Fixed-Point Iteration For Nonlinear Systems
If g(x) maps D into D, then g has a fixed point in D. In other words, if g(x) is in D whenever x is in D, then there is some point p in D such that p=g(p) If sequence of approximations to the fixed point intial point is sufficiently close to the fixed point p If there is a constant K<1 such that for every x in D For each i= 1,….,n and each j=1,…,n, A bound on the error at the mth step is given by
31
5.2 Fixed-Point Iteration For Nonlinear Systems
Example 5.5 First check to make sure that g(x) maps the retangle That is, for we have In fact and Which are all less than 0.5 (for ), as is required for the corollary
32
5.3 Minimum of a Nonlinear Function of Several Variables
33
Example 5.7 and , we define The minimum value of h(x,y) is 0, which occurs when f(x,y)=0 and g(x,y)=0. The derivatives for the gradient are
34
Table 5.8 Result of ffmin Table 5.8 Approximate zeros at each step of iteration Step x y Change 0.5 1 0.875 0.625 2 3 4 0.6178 5 0.6181 e-05
35
5.3.1 MATLAB Function for Minimization by Gradient Descent
36
5.3.1 MATLAB Function for Minimization by Gradient Descent
function h = ex_min(x) h = (x(1)^2 + x(2)^2 - 1)^2 + (x(1)^2 - x(2) )^2; function dh = ex_min_g(x) dh = [ -(4*(x(1)^2 + x(2)^2 - 1)*x(1) + 4*(x(1)^2 - x(2))*x(1)) -(4*(x(1)^2 + x(2)^2 - 1)*x(2) - 2*(x(1)^2 - x(2)))]'; xmin [ ], 0, 5)
37
Example 5.8 Given three points in the plane, we wish to find the location of the point P=(x,y) sp that the sum of the squares of the distances from P to the three given points, is as small as possible.
38
Figure 5.7
39
5.4 MATLAB’s Methods
40
MATLAB’s METHODS FMINS
finds the minimum of a scalar function of several variables, starting at an initial estimate Note The fmins function was replaced by fminsearch in Release 11 (MATLAB 5.3). In Release 12 (MATLAB 6.0), fmins displays a warning message and calls fminsearch Syntax x = fmins('fun',x0) x = fminsearch(fun,x0) starts at the point x0 and finds a local minimum x of the function described in fun. x0 can be a scalar, vector, or matrix.
41
MATLAB’s METHODS Examples a
A classic test example for multidimensional minimization is the Rosenbrock banana function The traditional starting point is (-1.2,1). The M-file banana.m defines the function. The minimum is at (1,1) and has the value 0. a
42
5.5 Nonlinear system: Case Study
43
Nonlinear system: Case Study
The analytical model to compute the DCF throughput
44
Nonlinear system: Case Study
The stationary probability τ The station transmits a packet in a generic slot time The conditional collision probability p aa
45
Nonlinear system: Case Study
Two Equations represent a nonlinear system in the two unknowns τ and p W = Cwmin m = Maximum backoff stage N = The number of stations
46
Nonlinear system: Case Study
Solve the nonlinear problem of two variables Assumptions W = 32 m = 3 N = 3, 10, 50 Newton’s Method and fminsearch(fun,x0) Problem1 by Newton’s Method (W=32, m = 3, N =3) 64τ p^4 + 34pτ - 33τ - 4p +2 =0 (1) p = 1-(1- τ)^ (2) *Equations (1) and (2) is nonlinear system
47
Nonlinear system: Case Study
function f = newton_case1(x) f = [ (64*x(2)*x(1)^4 + 34*x(1)*x(2) -33*x(2) -4*x(1) +2) (x(2)^2 - 2*x(2) + x(1)) ]; function df = newton_case1_j(x) df = [ (256*x(2)*x(1)^3 + 34*x(2) - 4) (64*x(1)^4 + 34*x(1)-33) ( 2*x(2) -2) ]; τ = p = aa
48
Nonlinear system: Case Study
Problem1 by fminsearch(fun,x0) (W=32, m = 3, N =3) function h = fminsearch_case1(x) h = (64*x(2)*x(1)^4 + 34*x(1)*x(2) -33*x(2) -4*x(1) +2)^ ((1-x(2))^2 -1 +x(1))^2;
49
Nonlinear system: Case Study
Problem2 by Newton’s Method (W=32, m = 3, N =10) 64τ p^4 + 34pτ - 33τ - 4p +2 =0 (1) p = 1-(1- τ)^ (2) *Equations (1) and (2) is nonlinear system τ = p = dd
50
Nonlinear system: Case Study
Problem2 by fminsearch(fun,x0) (W=32, m = 3, N =10) function h = fminsearch_case1(x) h = (64*x(2)*x(1)^4 + 34*x(1)*x(2) -33*x(2) -4*x(1) +2)^ ((1-x(2))^2 -1 +x(1))^9;
51
Nonlinear system: Case Study
Problem3 by Newton’s Method (W=32, m = 3, N =50) 64τ p^4 + 34pτ - 33τ - 4p +2 =0 (1) p = 1-(1- τ)^ (2) *Equations (1) and (2) is nonlinear system τ = p = dd
52
Nonlinear system: Case Study
Problem2 by fminsearch(fun,x0) (W=32, m = 3, N =50) function h = fminsearch_case1(x) h = (64*x(2)*x(1)^4 + 34*x(1)*x(2) -33*x(2) -4*x(1) +2)^ ((1-x(2))^2 -1 +x(1))^49;
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.