26
2 3 3 2 2 2 2 1 11 SO a O Fe a O FeS a 3 2 3 1 2 1 2 3 22 2 2 a a a a a a 22 2 3 0 0 0 2 0 0 2 3 2 1 3 2 1 3 2 1 a a a a a a a a a 22 0 0 2 3 0 1 0 2 0 2 1 3 2 1 a a a Lecture 4 The Gauß scheme A linear system of equations 22 2 3 0 0 0 2 0 0 2 3 1 2 1 3 3 2 1 3 2 2 1 a a a a a a a a a a a a Matrix algebra deals essentially with linear linear systems. Multiplicative elements. A non-linear system Solving simple stoichiometric equations n n a a a a a u u u u x ... 3 3 2 2 1 1 0

Lecture 4

  • Upload
    amelia

  • View
    89

  • Download
    0

Embed Size (px)

DESCRIPTION

Lecture 4. Solving simple stoichiometric equations. A linear system of equations. The Gauß scheme. Multiplicative elements . A non-linear system. Matrix algebra deals essentially with linear linear systems. Solving a linear system. - PowerPoint PPT Presentation

Citation preview

Page 1: Lecture  4

23322221 11 SOaOFeaOFeSa

32

31

21

2322

2

2

aa

aa

aa

22230

002

002

321

321

321

aaa

aaa

aaa

22

0

0

230

102

021

3

2

1

a

a

a

Lecture 4

The Gauß scheme A linear system of equations

22230

002

002

3121

3321

3221

aaaa

aaaa

aaaa

Matrix algebra deals essentially with linear linear systems.

Multiplicative elements.A non-linear system

Solving simple stoichiometric equations

nnaaaaa uuuux ...3322110

Page 2: Lecture  4

2

1

222121

212111

2

1

2221

1211 ;

c

c

baba

baba

b

b

aa

aa

CBA

BA

2221

1211

2

1

2

1 /aa

aa

b

b

c

c

BC

2221212

2121111

babac

babac

The division through a vector or a matrix is not defined!

2 equations and four unknowns

230

102

021

/

22

0

0

3

2

1

a

a

a

Solving a linear system

22

0

0

230

102

021

3

2

1

a

a

a

Page 3: Lecture  4

For a non-singular square matrix the inverse is defined as

IAA

IAA

1

1

987

642

321

A

1296

654

321

A

r2=2r1 r3=2r1+r2

Singular matrices are those where some rows or columns can be expressed by a linear

combination of others.Such columns or rows do not contain additional

information.They are redundant.

nnkkkk VVVVV ...332211

A linear combination of vectors

A matrix is singular if it’s determinant is zero.

122122112221

1211

2221

1211

aaaaaa

aaDet

aa

aa

AA

A

Det A: determinant of AA matrix is singular if at least one of the parameters k is not zero.

Page 4: Lecture  4

1112

2122

21122211

1

2212

2111

1aa

aa

aaaa

aa

aa

A

A

(A•B)-1 = B-1 •A-1 ≠ A-1 •B-1

nn

nn

a

a

a

a

a

a

1...00

............

0...1

0

0...01

...00

............

0...0

0...0

22

11

1

22

11

A

A

Determinant

The inverse of a 2x2 matrix The inverse of a diagonal matrix

The inverse of a square matrix only exists if its determinant differs from zero.

Singular matrices do not have an inverse

The inverse can be unequivocally calculated by the Gauss-Jordan algorithm

Page 5: Lecture  4

1 2 3 4

1 2 3 4

1 2 3 4

1 2 3 4

a 2a a 2a 5

2a 3a 2a 3a 6

3a 4a 4a 3a 7

5a 6a 7a 8a 8

1 1

1

2

3

4

1

1

2

3

4

a1 2 1 2 1 2 1 2 1 2 1 2 5

a2 3 2 3 2 3 2 3 2 3 2 3 6

a3 4 4 3 3 4 4 3 3 4 4 3 7

a5 6 7 8 5 6 7 8 5 6 7 8 8

a 1 2 1 2 5

a 2 3 2 3 6

a 3 4 4 3 7

a 5 6 7 8 8

8

7

6

5

8765

3443

3232

2121

8765

3443

3232

2121

4

3

2

1

4321

4321

4321

4321

a

a

a

a

aaaa

aaaa

aaaa

aaaa

Page 6: Lecture  4

1 2 3 4

1 2 3 4

1 2 3 4

1 2 3 4

a 2a a 2a 5

2a 3a 2a 3a 6

3a 4a 4a 3a 7

5a 6a 7a 8a 8

Page 7: Lecture  4

22

0

0

230

102

021

230

102

021

230

102

0211

3

2

1

3

2

1

3

2

1

1

a

a

a

a

a

a

a

a

a

I

Solving a simple linear system

23222 82114 SOOFeOFeS

23322221 11 SOaOFeaOFeSa

Page 8: Lecture  4

BAX

IAA

BAAXABAX

1

1

11

XXIIX

I

1...00

............

0...10

0...01

Identity matrix

Only possible if A is not singular.If A is singular the system has no solution.

The general solution of a linear system

13.25.09

12833

10423

zyx

zyx

zyxSystems with a unique solution

The number of independent equations equals the number of unknowns.

3.25.09

833

423

13.25.09

12833

10423

X: Not singular The augmented matrix Xaug is not singular and has the same rank as X.

The rank of a matrix is minimum number of rows/columns of the largest non-singular submatrix

0678.0

5627.4

3819.0

1

12

10

3.25.09

833

4231

z

y

x

Page 9: Lecture  4

1 1 1A X B A A X A B X A B

Consistent systemSolutions extist

rank(A) = rank(A:B)

Multiplesolutions extist

rank(A) < n

Singlesolution extists

rank(A) = n

Inconsistent systemNo solutions

rank(A) < rank(A:B)

Page 10: Lecture  4

1 2 3 4 1

1 2 3 4 2

31 2 3 4

41 2 3 4

1 2 3 4

1 2 3 4

1 2 3

2x 6x 5x 9x 10 x2 6 5 9 10

2x 5x 6x 7x 12 x2 5 6 7 12

x4x 4x 7x 6x 14 4 4 7 6 14

5 3 8 5 16x5x 3x 8x 5x 16

2x 3x 4x 5x 10

4x 6x 8x 10x 20

4x 5x 6x

1

2

34

41 2 3 4

1 2 3 4

1 2 3 4

1 2 3 4

1 2 3 4

x2 3 4 5 10

x4 6 8 10 20

x7x 14 4 5 6 7 14

5 6 7 8 16x5x 6x 7x 8x 16

2x 3x 4x 5x 10 2 3 4 5

4x 6x 8x 10x 12 4 6 8 10

4x 5x 6x 7x 14 4 5 6 7

5 6 75x 6x 7x 8x 16

1

2

3

4

11 2 3 4

21 2 3 4

31 2 3 4

4

1 2 3 4

1

x 10

x 12

x 14

8 16x

x2x 3x 6x 9x 10 2 3 6 9 10

x2x 4x 5x 6x 12 2 4 5 6 12

x4 5 4 7 144x 5x 4x 7x 14

x

2x 3x 4x 5x 10

4x

1

2 3 42

1 2 3 43

1 2 3 44

1 2 3 4

1 2 3 4

1 2

102 3 4 5x

6x 8x 10x 12 124 6 8 10x

4x 5x 6x 7x 14 144 5 6 7x

165 6 7 85x 6x 7x 8x 16x

1610 12 14 1610x 12x 14x 16x 16

2x 3x 4x 5x 10

4x 6x 8

1

3 42

1 2 3 43

1 2 3 44

1 2 3 4

102 3 4 5x

x 10x 12 124 6 8 10x

4x 5x 6x 7x 14 144 5 6 7x

165 6 7 85x 6x 7x 8x 16x

3210 12 14 1610x 12x 14x 16x 32

Consistent

Rank(A) = rank(A:B) = n

Consistent

Rank(A) = rank(A:B) < n

Inconsistent

Rank(A) < rank(A:B)

Consistent

Rank(A) = rank(A:B) < n

Inconsistent

Rank(A) < rank(A:B)

Consistent

Rank(A) = rank(A:B) = n

Infinite number of solutions

No solution

Infinite number of solutions

No solution

Infinite number of solutions

Page 11: Lecture  4

OHnKClnKClOnClnKOHn 25433221

432

51

531

431

2

2

3

nnn

nn

nnn

nnn

We have only four equations but five unknowns. The system is underdetermined.

02

2

3

0

432

51

531

431

nnn

nn

nnn

nnn

5

4

3

2

1

0

2

1

0

1120

0001

0301

1101

n

n

n

n

n

n1 n2 n3 n4 A1 0 -1 -1 01 0 -3 0 11 0 0 0 20 2 -1 -1 0

Inverse N*n50 0 1 0 2 n1 6

-0.5 0 0.5 0.5 1 n2 30 -0.33333 0.333333 0 0.333333 n3 1-1 0.333333 0.666667 0 1.666667 n4 5

n5 3

The missing value is found by dividing the vector through its smallest values to find the smallest solution for natural numbers.

OHKClKClOClKOH 232 3536

Page 12: Lecture  4

111059847635432211 aaaaaaaaaaa BrMgnHNnHSinBrHNnSiMgn

11552

739442

8432

6321

10511

anan

ananan

anan

anan

anan

111

1110

98

67

534

21

2

)1(4

4

2

aa

aa

aa

aa

aaa

aa

Equality of atoms involved

Including information on the valences of elements

We have 16 unknows but without experminetnal information only 11 equations. Such a system is underdefined. A system with n unknowns needs at least n independent and non-contradictory equations for a unique solution.

If ni and ai are unknowns we have a non-linear situation.We either determine ni or ai or mixed variables such that no multiplications occur.

Page 13: Lecture  4

0

0

4

0

0

0

0

0

0

0

0

11

10

9

8

7

6

5

4

3

2

1

10000000001

21000000000

00410000000

04001400000

00000011100

00000000012

50000020000

04030002000

00400000200

00000300001

05000000001

a

a

a

a

a

a

a

a

a

a

a

nn

nnn

nn

nn

nn

11552

739442

8432

6321

10511

anan

ananan

anan

anan

anan

111

1110

98

67

534

21

2

)1(4

4

2

aa

aa

aa

aa

aaa

aa

The matrix is singular because a1, a7, and a10 do not contain new informationMatrix algebra helps to determine what information is needed for an unequivocal information.

111059847635432211 aaaaaaaaaaa BrMgnHNnHSinBrHNnSiMgn

From the knowledge of the salts we get n1 to n5

Page 14: Lecture  4

111059847635432211 aaaaaaaaaaa BrMgnHNnHSinBrHNnSiMgn

29875432 244 MgBrHNSiHBrHNSiMg aaaaaa

3

1

44

44

3

9

8

5

974

83

534

a

a

a

aaa

aa

aaa

3

1

1

0

0

0

100000

010000

000100

401040

010001

000113

9

8

7

5

4

3

a

a

a

a

a

a

a3 a4 a5 a7 a8 a9 Aa3 -3 1 -1 0 0 0 0a4 1 0 0 0 -1 0 0a5 0 4 0 -1 0 -4 0a7 0 0 1 0 0 0 1a8 0 0 0 0 1 0 1a9 0 0 0 0 0 1 3

Inverse 0 1 0 0 1 0 a3 11 3 0 1 3 0 a4 40 0 0 1 0 0 a5 14 12 -1 4 12 -4 a7 40 0 0 0 1 0 a8 10 0 0 0 0 1 a9 3

We have six variables and six equations that are not contradictory and contain different information.The matrix is therefore not singular.

23442 244 MgBrNHSiHBrNHSiMg

Page 15: Lecture  4

Linear models in biology

cNKr

rNN 2

t N1 12 53

154

45

cKr

r

cKr

r

cKr

r

2251530

25510

114

The logistic model of population growth

c

Kr

r

/

122515

1155

111

30

10

4

36036.0/286.1 K

K denotes the maximum possible density under resource limitation, the carrying capacity.r denotes the intrinsic population growth rate. If r > 1 the population growths, at r < 1 the population shrinks.

We need four measurements

Page 16: Lecture  4

N

t

KOvershot

We have an overshot. In the next time step the population should decrease below the carrying capacity.

Population growth

679.236286.1

286.1 2 NNN

t N DN

1 1 3.928571

2 4.928571 8.147777

3 13.07635 13.3842

4 26.46055 11.69354

5 38.15409 -0.25669

6 37.8974 0.110482

7 38.00788 -0.04698

8 37.96091 0.02008

9 37.98099 -0.00856

10 37.97242 0.003656

679.236286.1

286.1)1(

)()()1(

2

NNNtN

tNtNtN

K/2

Fastest population growth

Page 17: Lecture  4

The transition matrix

Assume a gene with four different alleles. Each allele can mutate into anther allele.The mutation probabilities can be measured.

991.0003.0002.0001.0

004.0995.0003.0001.0

004.0001.0994.0001.0

001.0001.0001.0997.0

A→A B→A C→A D→A

Sum 1 1 11

Transition matrixProbability matrix

1.0

3.0

2.0

4.0

Initial allele frequencies

What are the frequencies in the next generation?

A→A

A→B

A→C

A→D

1008.0991.0*1.0003.0*3.0002.0*2.0001.0*4.0)1(

2999.0004.0*1.0995.0*3.0003.0*2.0001.0*4.0)1(

1999.0004.0*1.0001.0*3.0994.0*2.0001.0*4.0)1(

3994.0001.0*1.0001.0*3.0001.0*2.0997.0*4.0)1(

tD

tC

tB

tA

)(

)(

)(

)(

991.0003.0002.0001.0

004.0995.0003.0001.0

004.0001.0994.0001.0

001.0001.0001.0997.0

)1(

)1(

)1(

)1(

tD

tC

tB

tA

tD

tC

tB

tA

Σ = 1

The frequencies at time t+1 do only depent on the frequencies at time t but not on earlier ones.Markov process

)()1( tt PFF

Page 18: Lecture  4

A B C D EigenvaluesA 0.997 0.001 0.001 0.001 0.988697B 0.001 0.994 0.001 0.004 0.992303C 0.001 0.003 0.995 0.004 0.996D 0.001 0.002 0.003 0.991 1

Eigenvectors0 0 0.842927 0.48866

0.555069 0.780106 -0.18732 0.438110.241044 -0.5988 -0.46829 0.65716-0.79611 -0.1813 -0.18732 0.3707

)(

)(

)(

)(

991.0003.0002.0001.0

004.0995.0003.0001.0

004.0001.0994.0001.0

001.0001.0001.0997.0

)(

)(

)(

)(

)1(

)1(

)1(

)1(

tD

tC

tB

tA

tD

tC

tB

tA

tD

tC

tB

tA

Does the mutation process result in stable allele frequencies?

NAN Stable state vectorEigenvector of A

0)(

0

NIA

NAN

NAN

Eigenvalue Unit matrix Eigenvector

The largest eigenvalue defines the stable state vector

Every probability matrix has at least one eigenvalue = 1.

Page 19: Lecture  4

gfNN

The insulin – glycogen systemAt high blood glucose levels insulin stimulates glycogen synthesis and inhibits

glycogen breakdown.

The change in glycogen concentration DN can be modelled by the sum of constant production g and concentration

dependent breakdown fN.

01

0

g

fN

NgfN

At equilibrium we have

010

011

0

0

01

1

00111

2

2

2

2

g

f

N

N

g

f

N

N

Ng

fNN TT

The vector {-f,g} is the stationary state vector (the largest eigenvector) of the dispersion matrix and

gives the equilibrium conditions (stationary point).

The value -1 is the eigenvalue of this system.

1

12

2

N

ND

The symmetric and square matrix D that contains squared values is called the dispersion matrix

The glycogen concentration at equilibrium:

fg

Nequi The equilbrium concentration does not depend on the initial concentrations

Page 20: Lecture  4

X

YHow to transform vector A

into vector B?

A

B

BXA

9

7

3

1

5.25.1

21

Multiplication of a vector with a square matrix defines a new

vector that points to a different direction.

The matrix defines a transformation in space

X

Y

A

B

BXA

Image transformationX contains all the information necesssary

to transform the image

The vectors that don’t change during transformation are the eigenvectors.

AXA

In general we defineUXU

U is the eigenvector and l the eigenvalue of the square matrix X

0][

0][

0

0

UΛX

UIX

IUXU

UXUUXU

Eigenvalues and eigenvectors

Page 21: Lecture  4

A matrix with n columns has n eigenvalues and n eigenvectors.

Page 22: Lecture  4

Some properties of eigenvectors

11

UUAAUUUΛAU

UΛΛU

If L is the diagonal matrix of eigenvalues:

The product of all eigenvalues equals the

determinant of a matrix.

n

i i1det A

The determinant is zero if at least one of the eigenvalues is zero.

In this case the matrix is singular.

The eigenvectors of symmetric matrices are orthogonal

0'

:)(

UUA symmetric

Eigenvectors do not change after a matrix is multiplied by a scalar k.

Eigenvalues are also multiplied by k.

0][][ uIkkAuIA

If A is trianagular or diagonal the eigenvalues of A are the diagonal

entries of A.A Eigenvalues

2 3 -1 3 23 2 -6 3

4 -5 45 5

Page 23: Lecture  4

Page Rank

Google sorts internet pages according to a ranking of websites based on the probablitites to be directled to this page.

Assume a surfer clicks with probability d to a certain website A. Having N sites in the world (30 to 50 bilion) the probability to reach A is d/N.Assume further we have four site A, B, C, D, with links to A. Assume further the four sites have cA, cB, cC, and cD links and kA, kB, kC, and kD links to A. If the probability to be on one of these sites is pA, pB, pC, and pD, the probability to reach A from any of the sites is therefore

D

ADD

C

ACC

B

ABBA c

dkp

c

dkp

c

dkpp

Page 24: Lecture  4

d

d

d

d

N

p

p

p

p

cdkcdkcdk

cdkcdkcdk

cdkcdkcdk

cdkcdkcdk

D

C

B

A

CDCBDBADA

DCDCBBACA

DBDCBCABA

DADCACBAB

1

1///

/1//

//1/

///1

Google uses a fixed value of d=0.15. Needed is the number of links per website.

Probability matrix P Rank vector u

Internet pages are ranked according to probability to be reached

C

CC

B

BB

A

AAD

D

DD

B

BB

A

AAC

D

DD

C

CC

A

AAB

D

DD

C

CC

B

BBA

c

dkp

cdk

pcdk

pNd

p

cdk

pcdk

pcdk

pNd

p

cdk

pc

dkp

cdk

pNd

p

cdk

pc

dkp

cdk

pNd

p

The total probability to reach A is

D

ADD

C

ACC

B

ABBA c

dkp

c

dkp

c

dkpp

D

ADD

C

ACC

B

ABBA c

dkp

c

dkp

c

dkp

Nd

p

Page 25: Lecture  4

15.0

15.0

15.0

15.0

41

1000

075.0115.00

075.015.0115.0

0001

D

C

B

A

p

p

p

p

PA 1 0 0 0 0.0375B -0.15 1 -0.15 -0.075 0.0375C 0 -0.15 1 -0.075 0.0375D 0 0 0 1 0.0375

P-1

1 0 0 0 A 0.03750.153453 1.023018 0.153453 0.088235 B 0.0531810.023018 0.153453 1.023018 0.088235 C 0.04829

0 0 0 1 D 0.0375

A B

C D

Larry Page (1973-

Sergej Brin (1973-

Page 26: Lecture  4

Page Rank as an eigenvector problem

15.0

15.0

15.0

15.0

41

1000

075.0115.00

075.015.0115.0

0001

D

C

B

A

p

p

p

p In reality the constant is very small

0

1000

0100

0010

0001

0000

075.0015.00

075.015.0015.0

0000

0

1000

075.0115.00

075.015.0115.0

0001

D

C

B

A

D

C

B

A

p

p

p

p

p

p

p

p

The final page rank is given by the stationary state vector (the vector of the largest eigenvalue).

A B C D EigenvaluesA 0 0 0 0 -0.15 0B -0.15 0 -0.15 -0.075 0 0C 0 -0.15 0 -0.075 0 0D 0 0 0 0 0.15 0

Eigenvectors0 0.707107 0.408248 0

0.707107 0 0.408248 0.707110.707107 -0.70711 0 -0.7071

0 0 -0.8165 0