Modeling Simulation Lecture8
Modeling Simulation Lecture8
Ali M. Sahlodin
Department of Chemical Engineering
AmirKabir University of Technology
1397 S.H
Stability of ODEs
Stability of ODE solvers
Forward (explicit) Euler
Backward (implicit) Euler
1
12/22/2020
2
12/22/2020
3
12/22/2020
Solver failure
4
12/22/2020
Iteration matrix
5
12/22/2020
Symbolic differentiation
Exact derivatives
Difficult/impossible to obtain
Finite differences
Approximate derivatives
Easy to implement
Automatic differentiation
Exact derivatives
Easy to implement and use
https://en.wikipedia.org/wiki/Automatic_
differentiation
6
12/22/2020
Calculate both the function and its derivative at the same time
https://en.wikipedia.org/wiki/Automatic_
differentiation
7
12/22/2020
http://www.autodiff.org/
8
12/22/2020
94 successful steps
0 failed attempts 94 successful steps
5190 function evaluations 0 failed attempts
1 partial derivatives 190 function evaluations
18 LU decompositions 1 partial derivatives
188 solutions of linear systems 18 LU decompositions
CPU time = 369.3594 188 solutions of linear systems
Elapsed time is 100.947378 CPU time = 81.8750
seconds. Elapsed time is 28.116323 seconds.
9
12/22/2020
10