关键词 > Python代写

Analytics for a Better World

发布时间:2021-10-06

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit


Analytics for a Better World

Assignment 1

Case: FeedCalculator


Assignment

You are asked to optimize the feed for the chicken of a specific farmer in Africa. How much of each ingredient should the farmer use such that the total cost of 1 kg feed is minimized, and all nutritional requirements are satisfied? Moreover, for each ingredient there is a lower bound and an upper bound on the amount in the diet. Finally, the solution should satisfy so-called ‘combined ingredient rules’, i.e., upper bounds on the sum of specific combinations of ingredients (see under “Data” for more explanation).

This assignment consists of the following steps:

1. Develop a linear optimization model to represent this problem.

2. Implement the model in Python and solve it.

3. Write a report on the optimization model and the optimal solution found.


Data

The data for this case can be found in the excel file: Data Set Feedcalculator.xls on Canvas.

The tab ‘Ingredient Database‘ contains information for 53 ingredients. For example the ingredient ‘barley’ (row 2) costs 0.26 dollar per kg (column D). Columns E to BX contain nutritional information. For example: the ingredient ‘barley’ contains 0.4 units of nutrient ‘ca’ (Calcium), which is in column N. The column C indicates whether this ingredient is available for the farmer. Only ingredients with a ‘true’ can be used by the farmer. E.g. ‘barley’ can be used, but ‘copra’ not.

The tab ‘Ingredient Rules’ contains information on rules for the ingredients. Columns B and C contain lower and upper bound of the amount that can be used for 1 kg. For example 1 kg feed can contain at most 0.1 kg ‘barley’. Columns F to N contain information on Combined Ingredient Rules. For example (Column F): 1 kg feed should contain at most 0.17 kg of ‘cotton’, ‘sunflower’, ‘gncake’ and ‘copra’ in total.

The tab ‘Nutrient Rules’ contains information on nutritional restrictions. For example (row 7): 1 kg feed should contain at least 1.4 and at most 2.1 of nutrient ‘na’. If a nutrient is not in this list, it means that there are no restrictions on this nutrient.


Companion notebook

For your convenience this notebook already extracts are relevant data into convenient data structures.

Feel free to copy this notebook and use it as a start for your resolution.

When you are finished, also deliver the notebook, as instructed below as deliverable 2.


Format report

The report should be at most 2 pages (lettersize 11 pt), in English. You can use Word, and for equations you can use either Word’s equation editor, or add a clear picture of the handwritten equations/model. Of course you can also use other word processing software (e.g. LaTeX). The report should have two sections:

i.    Linear optimization model

      It is important to carefully describe all variables and parameters used.

ii.    Results.

      This section should contain the optimal solution, and the corresponding objective value.