(9.) Non-linear Systems

6
1 CHE338_Lecture#08 For reading Reference Chapter Page Chapra 6.6 167-171 Non-linear systems

description

nls

Transcript of (9.) Non-linear Systems

Page 1: (9.) Non-linear Systems

1

CHE338_Lecture#08

For reading

Reference Chapter Page

Chapra 6.6 167-171

Non-linear systems

Page 2: (9.) Non-linear Systems

2

Objectives

To introduce Jacobian matrix.

To how to solve a set of non-linear equations.

To introduce matlab function, fsolve.

Page 3: (9.) Non-linear Systems

3

A single and one-dimensional non-linear equation

x

f(x)

To find the roots for f(x)=0.

Page 4: (9.) Non-linear Systems

4

Non-linear systems

x

y

To find the roots

Page 5: (9.) Non-linear Systems

5

Jacobian matrix

n

ininin

n

iii

n

iii

x

f

x

f

x

f

x

f

x

f

x

f

x

f

x

f

x

f

J

,,,

,,,

,,,

21

2

2

2

1

2

1

2

1

1

1

Page 6: (9.) Non-linear Systems

6

Matlab function: fsolve

From the matlab help,

“FSOLVE solves systems of nonlinear equations of

several variables.”

>>[X,FVAL] = fsolve(FUN,X0,...)% returns the value of the

equations FUN at X.

f =@(x) [ 2*x(1) - x(2) - exp(-1*x(1))

-x(1) + 2*x(2) - exp(-1*x(2))];

[xroot, fval]=fsolve(f, [-5;-5])