Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date:...

31
Computational Study of System Dynamics Review of Rate Laws JCE Summary Computational Methods P Dynamics Methods < Chemical Kinetics Simulator < A+BC: General Trajectory P Mathematics Methods < Integral < Differential P Graphical Interface Differential Equation Solvers

Transcript of Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date:...

Page 1: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

Computational Study ofSystem Dynamics

Review of Rate LawsJCE Summary

Computational Methods

PDynamics Methods< Chemical Kinetics Simulator< A+BC: General Trajectory

PMathematics Methods< Integral< Differential

PGraphical Interface Differential EquationSolvers

Page 2: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

Dynamics MethodsChemical Kinetics Simulator

http://www.almaden.ibm.com/st/msimPCKS does not integrate differential equationsPCKS performs general, rigorously accurate

stochastic algorithm to propagate reactionPSpeed< Comparable in efficiency to integration for simple< Significantly faster for “stiff” systems

PModels complex reactions< Explosions< Changing volumes

PHigh learning curvePResearch quality

Dynamics MethodsA+BC: General Trajectory

http:/qcpe.chem.indiana.edu/cgi-bin/catalog/view.pl

PLEPS diagramPMonte Carlo Collisions

A

B

C

cm

2b

Page 3: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

A B A a Bko o⎯ →⎯⎯ = =, 0

− = = −dAdt

kA A ae kt

( )dBdt

kA B a e kt= = − −1

Mathematics MethodsGeneral

P Integral Methods< Use integrated rate laws< Tables and Graphs

PDifferential Methods< Use computational technique to integrate

differential rate laws< Tables and Graphs

Review of Rate LawsSimple First Order Reactions

Page 4: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

a = 1000k = 1

t A B0 1000 0

0.1 904.837418 95.1625820.2 818.730753 181.2692470.3 740.818221 259.1817790.4 670.320046 329.6799540.5 606.53066 393.469340.6 548.811636 451.1883640.7 496.585304 503.4146960.8 449.328964 550.6710360.9 406.56966 593.43034

1 367.879441 632.1205591.1 332.871084 667.1289161.2 301.194212 698.8057881.3 272.531793 727.4682071.4 246.596964 753.4030361.5 223.13016 776.869841.6 201.896518 798.1034821.7 182.683524 817.3164761.8 165.298888 834.7011121.9 149.568619 850.431381

2 135.335283 864.6647172.1 122.456428 877.5435722.2 110.803158 889.1968422.3 100.258844 899.7411562.4 90.7179533 909.2820472.5 82.0849986 917.9150012.6 74.2735782 925.7264222.7 67.2055127 932.794487

0 2 4 6 8 10 12t

0

200

400

600

800

1000

1200

AB

a = 1000k = 1

dA=-k A dt A = a - dA B = a - At dA A B

0 0 1000 00.1 -100 900 1000.2 -90 810 1900.3 -81 729 2710.4 -72.9 656.1 343.90.5 -65.61 590.49 409.510.6 -59.049 531.441 468.5590.7 -53.1441 478.2969 521.70310.8 -47.82969 430.46721 569.532790.9 -43.046721 387.420489 612.579511

1 -38.742049 348.67844 651.321561.1 -34.867844 313.810596 686.1894041.2 -31.38106 282.429536 717.5704641.3 -28.242954 254.186583 745.8134171.4 -25.418658 228.767925 771.2320751.5 -22.876792 205.891132 794.1088681.6 -20.589113 185.302019 814.6979811.7 -18.530202 166.771817 833.2281831.8 -16.677182 150.094635 849.9053651.9 -15.009464 135.085172 864.914828

2 -13.508517 121.576655 878.4233452.1 -12.157665 109.418989 890.5810112.2 -10.941899 98.4770902 901.522912.3 -9.847709 88.6293812 911.3706192.4 -8.8629381 79.7664431 920.2335572.5 -7.9766443 71.7897988 928.210201

0 2 4 6 8 10 12t

0

200

400

600

800

1000

1200

AB

a 1000:=

k 1:=

A t( ) a e k− t⋅⋅:= B t( ) a 1 e k− t⋅

−( )⋅:=

0 2 4 6 8 100

500

1000

A t( )

B t( )

t

Mathematics Methods--IntegralSpreadsheet

Mathematics Methods--DifferentialSpreadsheet

Mathematics Methods--IntegralMathcad

Page 5: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

k 1:=

Given

tA t( )d

dk− A t( )⋅ A 0( ) 1000

A Odesolve t 10,( ):=

Given

tB t( )d

dk A t( )⋅ B 0( ) 0

B Odesolve t 10,( ):=

0 5 100

500

1000

A t( )

B t( )

t

Mathematics Methods--DifferentialMathcad

Mathematics Methods--IntegralMathematica

Mathematics Methods--DifferentialMathematica

Page 6: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

A B C A a B Ck ko o o

1 2 0⎯ →⎯⎯ ⎯ →⎯⎯ = = =,

− = = −dAdt

kA A ae kt

( )dBdt

k A k B Bak

k ke ek t k t= − =

−−− −

1 21

2 1

1 2

dCdt

k B C ak ek k

k ek k

k t k t

= = −−

−−

⎝⎜

⎠⎟

− −

22

2 1

1

1 21

1 2

k1 1:= k2 0.5:=

a 1000:=

A t( ) a e k1− t⋅⋅:=

B t( )a k1⋅

k2 k1−e k1− t⋅ e k2− t⋅

−( )⋅:=

C t( ) a 1k2

k2 k1−e k1− t⋅⋅−

k1k1 k2−

e k2− t⋅⋅−⎛⎜

⎝⎞⎠

⋅:=

Note that k1 must be different than k2 in orderfor these integrated equations to work.

0 2 4 6 8 100

200

400

600

800

10001000

0

A t( )

B t( )

C t( )

100 t

Mathematics Methods--IntegralMatlab

Review of Rate LawsConsecutive First Order Reactions

Mathematics Methods--IntegralMathcad

Page 7: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

k1 1:= k2 1:=

a 1000:= b 0:= c 0:=

T 10:=

Given

tA t( )d

dk1− A t( )⋅ A 0( ) a

tB t( )d

dk1 A t( )⋅ k2 B t( )⋅− B 0( ) b

tC t( )d

dk2 B t( )⋅ C 0( ) c

NA

NB

NC

⎛⎜⎜⎝

⎠Odesolve

A

B

C

⎛⎜⎜⎝

⎠t, T,

⎡⎢⎢⎣

⎤⎥⎥⎦

:=

0 2 4 6 8 100

200

400

600

800

10001 103×

0

NA t( )

NB t( )

NC t( )

100 t

A B C D A a B Ck k k ko o o

1 2 3 4 0⎯ →⎯⎯ ⎯ →⎯⎯ ⎯ →⎯⎯ ⎯ →⎯⎯ = = =K K,

− =dAdt

kA

dBdt

k A k B= −1 2

dCdt

k B k C= −2 3

N c e c e c e c enk t k t k t

nk tn= + + + +− − − −

1 2 31 2 3 K

( )( ) ( )ck k k k a

k k k k k kn

n1

1 2 3 1

2 1 3 1 1

=− − −

−L

L

( )( ) ( )ck k k k a

k k k k k kn

n2

1 2 3 1

1 2 3 2 2

=− − −

−L

L

( )( )( ) ( )ck k k k a

k k k k k k k kn

n3

1 2 3 1

1 3 2 3 4 3 3

=− − − −

−L

L

Mathematics Methods--DifferentialMathcad

Review of Rate LawsSeveral Consecutive First Order Reactions

!

Bateman solution:

!

Page 8: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

Graphical Interface DifferentialEquation Solvers

General

PModel differential rate lawPSoftware solves differential equations< Watch “stiff”

PTables and Graphs

Graphical Interface DifferentialEquation Solvers

Stella

Page 9: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

Graphical Interface DifferentialEquation Solvers

Berkeley Madonna

Graphical Interface DifferentialEquation Solvers

VisSim (Mathcad)

Graphical Interface DifferentialEquation Solvers

Simulink (Matlab)

Page 10: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

A B C A a B b Cko o o+ ⎯ →⎯⎯ = = =, , 0

− = − = =dAdt

dBdt

kABdCdt

kAB

Graphical Interface DifferentialEquation Solvers

Simile

Review of Rate LawsSimple Second Order Reactions

Graphical Interface DifferentialEquation Solvers

Change of Paradigm

Page 11: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

Introduction toSTELLA

Structural Thinking Experiential LearningLaboratory with Animation

Commerical ProductsGraphical Interface Differential Equation Solvers (GIDES)

PStella< Free run-time version

PBerkeley Madonna< Free run-time version< Solves “stiff” differential equations

PVisSim (Mathcad)PSimulink (Matlab)PSimilePModel Maker

Stella InterfaceStella “Layers” – Modeling

PConstructModel usingBuilding Blocks,Tools, Objects

POutputs

Layer Navigation

Map/Model ToggleChange to P2 (or else!)

Run Controller

Page 12: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

Stella InterfaceStella “Layers” – Mapping

PTextPOutput Tables

and GraphsP Input using

Slides andDials

PPicturesPQuick Time

Movies

Stella InterfaceStella “Layers” – Equation

P Initial Values ofStocks

PConnectorInformation

PDifferentialEquationsRepresentingthe TimeDependence ofStocks

Stella InterfaceMenu / Icons

Page 13: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

Stella InterfaceBuilding Blocks – Stocks

Value Undergoing a Change

Stella InterfaceBuilding Blocks – Flow

Change of Stock with Respect to Time

Stella InterfaceBuilding Blocks – Converter

ConstantsTransformation Equations

Page 14: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

Stella InterfaceBuilding Blocks – Connectors

Links Building Blocks

Stella InterfaceTools – Hand

General Purpose Editing ToolCursor Pointer

Stella InterfaceTools – Dynamite

Delete (No “Undo”)

Page 15: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

Stella InterfaceObjects – Graph Pad

Graphing Results

Stella InterfaceObjects – Table Pad

Spreadsheet-like Table of Results

Page 16: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

Solving of Differential EquationsTaylor Series

Solving of Differential EquationsEuler Method

First 2 terms

Page 17: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

Solving of Differential EquationsRunge-Kutta 2

First 3 Terms

Solving of Differential EquationsRunge-Kutta 4

First 5 Terms

Simple Model – Falling CalculatorSystem

y = heightyN = velocity = (acceleration)(time)yO = acceleration = g = 9.8 m s-2

Page 18: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

Simple Model – Falling CalculatorStella Model

Page 19: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...
Page 20: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

Simple Model – Falling CalculatorStella Model – Equation Layer

Page 21: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

dCdt

kC

C Ckt

o

= −

= +

2

1 1

Simple Model – Falling CalculatorStella Model – Accuracy

PAir FrictionPBounce

Chemical KineticsSure looked like a natural fit to me!!

Kinetics ModelDimerization of Cyclopentadiene2nd Order Diels-Alder Reaction

2

Page 22: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

Kinetics Model

Page 23: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...
Page 24: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...
Page 25: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

Michaelis-MentonLen Soltzberg (Simmons College)

E + S º (ES)

(ES) 6 P + E

Page 26: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

Oscillating ReactionsCriteria

PTwo or more coupled reactionsPAutocatalytic

Page 27: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

Oscillating ReactionsBriggs-Rauscher

PH2O2

PKIO3 and H2SO4

PHOOCCH2COOH, MnSO4, starch

~15 s for each cycle

Oscillating ReactionsBelousov-Zhabotinskii

P 18 reversible stepsP 21 different chemical species

BrO3- + HBrO2 + H3O+ 6 2 BrO2 + 2 H2O

2 BrO2 + 2 Ce3+ + 2 H3O+ 6 2 HBrO2 + 2 Ce4+ + 2 H2O

Page 28: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

A + Y 6 X + PX + Y 6 2PA + X 6 2X + 2Z2X 6 A + PB + Z 6 (f/2) Y

whereA = BrO3

-

X = HBrO2Z = Ce4+

P = HOBrB = organicY = Br -

Oregonator by Len Soltzberg (Simmons College)

Page 29: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...
Page 30: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

Other ApplicationsRod Schluter (Formerly of CofC)

Acid/Base Equilibrium

H+ + OH- 6 H2O

Page 31: Computational Study of System Dynamics€¦ · SlideShow2 Author: Clyde Metz Created Date: 7/16/2004 2:12:55 PM ...

D Tu

xe

dxD x( / )θ =−∫

313

3

( )

( )[ ]

U U RTD

C R Du

e

S R D e

A U RT e D

v u

u

u

− =

= −−

⎛⎝⎜

⎞⎠⎟

= − −⎡⎣⎢

⎤⎦⎥

− = − −

0

0

3

3 4 31

343

1

3 1

ln

ln

Other ApplicationsDebye Theory for Monatomic Crystals