1 CHEM-E7130 Process Modeling Exercise Matrices
2 Matrices in case math basic course learnings have been lost... Matrices are ”table of numbers” with certain mathematical operations. Matrices are linear operators. Matrix multiplication column number row number
Matrix calculations with Excel 3 Excel can carry out simple matrix calculations, such as summations, multiplications (mmult), and matrix inversion (minv) You need to paint the appropriate selection of result cells, and press ”ctrl-shift-enter” at the formula bar to make the result a matrix Try this first by inverting arbitrary 2*2 square matrix, then multiplying the result with a 2*1 column matrix. Try also with a diagonal matrix and a matrix with columns or rows that are not linearly independent
Write the set of equations in a matrix form d(c)/dt = [A](c) 4 in batch reactor kfkf krkr Matrix exercises (2)
1.Solve the system d(c)/dt = [A](c) analytically with pen and paper in a general case 2.Look at matlab function expm, compare to exp. Learn how to enter matrix variables. Look at matrix operations; transpose ’, referring to a matrix row/column with ”:”, etc. 3.Use matlab function expm to calculate concentrations at different time steps with kf=1, kr=0.001, and K=1, ca(t=0)=1, other concentrations are 0. 4.Calculate eigenvalues and see how varying kr affects the ratio of the largest and smallest non-negative eigenvalue. 5.Solve the system with matlab, try different ODE solvers (ode15s, ode45 etc.). Try different solver tolerances 5
Matrix exercises (optional) 6. Solve the same system with Excel using explicit Euler. What is the largest time step possible? 7. Solve the exponential matrix with a series expansion and compare the result to the expm results and comment on the required number of terms 8.Calculate the same matrix function by using eigenvalues and eigenvectors 6