An LP model is expressed in terms of its technology matrix (A), RHS vector(b), and cost...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
An LP model is expressed in terms of its technology matrix (A), RHS vector(b), and cost vector (c) in an Excel file named 'Params.xlsx' with 3 sheets (attached). We would like to minimize the objective function. Write a Python code (or any other programming language) in Jupyter notebook that does the following steps: 1. Read each sheet of the Excel file and create A, b, and c. 2. Define a function called 'Min-Vector'. This function declares the model, adds all the decision variables and constraints to it, sets the objective, and writes the model into a file called 'Primal.lp'. Name your variables r in this function. 3. Solve the model. 4. Define another function called 'print_solution' which takes a model as input, and prints all the decision variables that have a positive optimal value next to their names. It also prints the optimal value of the objective function. 5. Define another function called 'Max-Vector' with all the functionalities of the 'Min-Vector' function. This 'Max Vector function should solve the dual of the original problem defined by A, b, and c. Name your variables in this function and write the model into a file called 'Dual.lp'. 6. Solve the dual model. 7. Use the 'print solution' function that you previously defined to print the solutions of the dual model. Verify that the optimal value of the objective function is equal for the primal and dual models. Use Markdown cells to put some explanation before every code cell that you use in Jupyter notebook. Submit your Jupyter notebook file along with your primal.lp and dual.lp files. An LP model is expressed in terms of its technology matrix (A), RHS vector(b), and cost vector (c) in an Excel file named 'Params.xlsx' with 3 sheets (attached). We would like to minimize the objective function. Write a Python code (or any other programming language) in Jupyter notebook that does the following steps: 1. Read each sheet of the Excel file and create A, b, and c. 2. Define a function called 'Min-Vector'. This function declares the model, adds all the decision variables and constraints to it, sets the objective, and writes the model into a file called 'Primal.lp'. Name your variables r in this function. 3. Solve the model. 4. Define another function called 'print_solution' which takes a model as input, and prints all the decision variables that have a positive optimal value next to their names. It also prints the optimal value of the objective function. 5. Define another function called 'Max-Vector' with all the functionalities of the 'Min-Vector' function. This 'Max Vector function should solve the dual of the original problem defined by A, b, and c. Name your variables in this function and write the model into a file called 'Dual.lp'. 6. Solve the dual model. 7. Use the 'print solution' function that you previously defined to print the solutions of the dual model. Verify that the optimal value of the objective function is equal for the primal and dual models. Use Markdown cells to put some explanation before every code cell that you use in Jupyter notebook. Submit your Jupyter notebook file along with your primal.lp and dual.lp files.
Expert Answer:
Answer rating: 100% (QA)
Step 1 Reading Data from Excel In this step well read the data from the Excel file and create matrices A b and c import pandas as pd Read data from Ex... View the full answer
Related Book For
Management Accounting Information for Decision-Making and Strategy Execution
ISBN: 978-0137024971
6th Edition
Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young
Posted Date:
Students also viewed these programming questions
-
You purchased an office building for $10,000,000 5 years ago. It was depreciated on a straight-line basis over 39 years. Assume 20% was assigned to land value, assume no real property. Your...
-
Proper storage of hay bales is essential for the survival of cattle during Canadian winters. A farmer uses a cable to exert an upward pull of 850 N on an 81.6 kg bale of hay. a. Draw a free-body...
-
Research Project Group To What Extent Are Australian Accepting and Consuming Local Camels By-products? a.Design a Questionnaire in above topic. Purpose, description and topics covered Purpose.
-
How much money would a man have to deposit each year for 6 years starting 4 years from now if he wanted to have $12,000 eighteen years from now? Assume the interest rate is 12% per year?
-
Use the information for Hanson Company from BE10-2 and BE10-3. Compute avoidable interest for Hanson Company.
-
In a game a player rolls a fair six-sided die. If the score is even, the player receives an amount of dollars equal to the score. If the score is odd, the player receives an amount of dollars equal...
-
After rereading the Opening Profile, identify all effective actions Ellie Symes and Wyatt Wells initiated in the early days of building The Bee Corp.
-
Sylvan Inc. entered into a non-cancelable lease arrangement with Breton Leasing Corporation for a certain machine. Bretons primary business is leasing; it is not a manufacturer or dealer. Sylvan will...
-
* Select the jobs of the operating system many answers Manage CPU and Memory Provide computer with power Provide user interface Cool down the computer
-
Martin Moreno is 42 years old, single, and works as a designer for a major architectural firm. He is well paid and over time has built up a sizable portfolio of investments. He considers himself an...
-
A. Discuss two (2) advantages of global harmonizing of accounting standards. Has there been any recent success with regards to the harmonizing of accounting standards? Provide details. (10 marks) B....
-
Of the light bulbs delivered on May 25, 400 are produced in the morning shift, 300 in the evening shift, and 300 in the night shift. Say we pick a light bulb at random. (a) What is the probability...
-
What is the probability of getting the same outcome in 2 rolls of a die? What is the probability that the sum of 2 outcomes is 7?
-
Draw 2 cards from a deck of cards without replacement. What is the probability of getting a diamond on the first draw and a club on the second? What is the probability of drawing 2 cards and getting...
-
A city company has 300 employees. Among these employees, two out of every three take public transportation to work, one out of every two owns a car, and one out of every three owns a car but takes...
-
A local factory has two shifts: day shift and night shift. The day shift produces 2/3 of the total product. Of the day shift product, 1 % are defective. Of the night shift product, 2 % are defective....
-
A forensic detective is tasked with establishing a postmortem interval for a corpse found in a house with the windows open and the doors ajar. Tests indicate the presence of Sarcophaga bullata,...
-
Classify each of the following as direct costs or indirect costs of operating the Pediatrics ward for children at the Cleveland Clinic: a. Wi-Fi covering the entire hospital campus b. Net cost of...
-
Relevant and sunk costs McKinnon Company's plant manager is considering buying a new grinding machine to replace an old grinding machine or overhauling the old one to ensure compliance with the...
-
When should an organization use stock options?
-
During the school year, the Homebush School band arranges concert dates in many communities. Because only part of the school??s travel expenses are covered by the concert admission fees, the band...
-
Differentiate between an open transaction and a closed transaction.
-
Differentiate between tax compliance and tax planning.
-
What form(s) is (are) used to file an individuals income tax return?
Study smarter with the SolutionInn App