291-homework5 - CEE 291 Problem Solving Using Computer...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CEE 291 Problem Solving Using Computer Tools Homework 5: Matlab Assigned: 2/15/2010 Due: 2/22/2010 5:00pm in the ECOW2 drop box and in class on Monday. 1.) This problem assumes you are familiar with the background information given in hmwk 2 #1. Given the two governing equations for steady, one dimensional concentration of waste (L) and Oxygen Deficit (D) are given below. In this problem, we would like to write a function that numerically integrates these equations and then use this function in a program that optimizes the location of treatment plants given an initial set of conditions. Governing Equations L k x L U r - = ) ( L k D k x D U d a - - = Analytical Solution U x k r e L L - = 0 - - + = - - - U x k U x k r a d U x k a r a e e k k L k e D D 0 0 Numerical Technique We will use the Euler explicit forward difference method to numerically integrate our governing equations. Forward difference means we use dependant variable values at the previous step to approximate the value at the current stop. In our case, we will use L and D at the previous x location to calculate L and D at the next x location. This procedure is commonly written as:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
1 1 - - + - = - = i i r i r L x U L k L U L k x L 1 1 1 - - - + - - = i i d i a i D U L k D k x D NOTE: *The subscript “i” represents the current x location and “i-1” is the x location previous. * i was chosen here because the most common looping variable in Matlab is i. Numerical solutions are often written with other variables. *Everything is constant except L and D, which have indices *In order to start, we need initial conditions *Use constants U = 1,500 m/day, k a = 0.6 days -1 , k r = 1.2 days -1 , k d = 1.0 days -1 a.) Write a function in matlab that numerically integrates the governing equations. Your top line should look like: function [L,D,x] = BOD_num_sol(deltaX, final_x, L_init, D_init, U, ka, kd, kr) The function should take as input :
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/04/2010 for the course CEE 291 taught by Professor Hoopes during the Spring '10 term at Wisconsin.

Page1 / 5

291-homework5 - CEE 291 Problem Solving Using Computer...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online