Page 1 of 1

Problem 5 (35 points): As discussed in our last lecture, linear algebraic equations can arise in the solution of differe

Posted: Mon May 09, 2022 9:41 am
by answerhappygod
Problem 5 35 Points As Discussed In Our Last Lecture Linear Algebraic Equations Can Arise In The Solution Of Differe 1
Problem 5 35 Points As Discussed In Our Last Lecture Linear Algebraic Equations Can Arise In The Solution Of Differe 1 (157.53 KiB) Viewed 25 times
Problem 5 (35 points): As discussed in our last lecture, linear algebraic equations can arise in the solution of differential equations. The following differential equation results from a steady- state mass balance for a chemical in a one-dimensional canal, d²c = 0 = D dx2 dc U dx kc = where x = distance along the canal (m), c = concentration, t = time, D = diffusion coefficient, U fluid velocity, and k = a first-order decay rate. (a) Convert this differential equation to an equivalent system of simultaneous algebraic equations using centered difference approximations for the derivatives. (b) Develop a MATLAB function to solve these equations from x = O to L and return the resulting distances and concentrations. The first line of your function should be function (x,c] YourLastName_reactor(D, U, k, cO, CL, L, dx) (c) Develop a MATLAB script that invokes this function and then plots the results. (d) Test your MATLAB script for the following parameters: L = 10 m, Ax = 0.5 m, D = 2 m²/d, U= 1 m/d, k= 0.2/d, c(0) = 80 mg/L, and c(10) = 20 mg/L. =