Homework 1

BEE 4750/5750

Due: Sep 15, 2022 by 9:00pm ET


Overview

Learning Objectives

Homework 1 is focused on assessing your ability to:

  • derive and implement a descriptive simulations model; and

  • to evaluate tradeoffs across multiple objectives.

Problems

Problem 1: Evaluating A Wastewater Treatment Plan

Cheap Plastic Products, Inc. is operating a plant that produces $100 \text{m}^3\text{/day}$ of wastewater that is discharged into Pristine Brook. The wastewater contains $1 \text{kg/m}^3$ of YUK, a toxic substance. The US Environmental Protection Agency has imposed an effluent standard on the plant prohibiting discharge of more than $20 \text{kg/day}$ of YUK into Pristine Brook.

Cheap Plastic Products has analyzed two methods for reducing its discharges of YUK. Method 1 is land disposal, which costs $X_1^2/20$ dollars per day, where $X_1$ is the amount of wastewater disposed of on the land ($\text{m}^3\text{/day}$). With this method, 20% of the YUK applied to the land will eventually drain into the stream (i.e., 80% of the YUK is removed by the soil).

Method 2 is a chemical treatment system which costs $1.50 per $\text{m}^3$ of wastewater treated. The chemical treatment has an efficiency of $e= 1 - 0.005X_2$, where $X_2$ is the quantity of wastewater ($\text{m}^3\text{/day}$) treated. For example, if $X_2 = 50 \text{m}^3\text{/day}$, then $e = 1 - 0.005(50) = 0.75$, so that 75% of the YUK is removed.

Your assignment is to evalute treatment programs for the factory using a combination of these methods and direct discharge into Pristine Brook.

Problem 1.1

Draw a diagram of the system to show an overview of the system you are modeling. Include a description and any nomenclature necessary for understanding your summary or diagram in text below the figure. To include a figure, you can modify the basic network graph provided in solutions-template.jmd, or use Markdown to include a figure you generate in another program, with the following syntax:

![Alternate Text](path/to/figure/)

Problem 1.2

Show the process of formulating a mathematical model for your system, computing the concentration of YUK for a given treatment plan. This is best done with equations supported by some descriptions. To generate a math block (as opposed to inline math mixed with text), use syntax similar to a Julia block, but with "math" as the language. Make sure you include, as additional equations in the model, any needed constraints on the values of $X_1$ and $X_2$ based on what they represent in the problem.

Problem 1.3

Implement your model as a Julia function which computes the resulting YUK concentration and cost for a particular treatment plan. You can return multiple values from a function with a tuple, as in:

function multiple_return_values(x, y)
    return x+y, x*y
end

a, b = multiple_return_values(2, 5)
println(a)
println(b)
7
10

Problem 1.4

Evaluate your model over a variety of treatment plans by varying $X_1$ and $X_2$. As there are constraints on the values of $X_1$ and $X_2$ (they can't be arbitrary values), use a sampling strategy which takes these into account. Some options might include:

  • sampling from a joint distribution; for example, a Dirichlet distribution is a distribution over $k$-dimensional vectors where the elements sum tup 1, and is implemented in Distributions.jl with the Dirichlet() function;

  • sampling $X_1$ or $X_2$ independently, looping over that vector, and sampling the other based on the corresponding value.

Plot the resulting tradeoffs between YUK concentrations and cost by using the scatter() function from Plots.jl (make one axis cost, and the other concentrations). What do you notice? You can also add a line to the plot to represent the effluent standard (either hline!() or vline(), depending on which axis is appropriate...notice the use of the version of the function with an ! at the end of the name to reflect that this function mutates an existing plot object).

Problem 1.5

Based on the plot from Problem 1.5, how would you select a treatment plan? How might this plan reflect the perspectives of various interested parties (factory owners, the public, regulatory agencies, etc)? Did how you set up your numerical experiment in Problem 1.5 influence your conclusions? Might they have changed with a different experimental design?

Problem 1.6

What do you think should be investigated further to improve your model? What assumptions did the problem or you make that should be kept in mind when interpreting your results?

References

If you used any external resource in the process of solving this problem, provide a reference below. These could be other people, websites, datasets, or code examples.