In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "how to achieve Python mathematical modeling PuLP library linear programming", the content of the article is simple and clear, easy to learn and understand, now please follow the editor's ideas slowly in depth, together to study and learn "how to achieve Python mathematical modeling PuLP library linear programming" bar!
Catalogue
1. Problem description
2. Using PuLP library to solve linear programming.
2.1 question 1
(1) Mathematical modeling
(2) Python programming
(3) running result
2.2 question 2
(1) Mathematical modeling
(2) Python programming
(3) running result
2.3 question 3
(1) Mathematical modeling
(2) Python programming
(3) running result
2.4 question 4
(1) Mathematical modeling
(2) Python programming
(3) running result
2.5 question 5: integer programming problem
(1) Mathematical modeling
(2) Python programming
(3) running result
1. Problem description
When a factory produces two kinds of beverages An and B, for every 100 cases of A beverages, 6 kg of raw materials and 10 workers are needed, with a profit of 100000 yuan; for every 100 cases of B drinks, 5 kg of raw materials and 20 workers are needed, with a profit of 90, 000 yuan.
Now the factory has a total of 60 kg of raw materials and 150 workers, and due to other conditions, the output of A beverage is limited to no more than 800 cases.
(1) how to arrange the production plan, that is, how much each of the two beverages are produced to maximize profits?
(2) if an investment of 8000 yuan can increase the raw material by 1 kg, should this investment be made? How much investment is reasonable?
(3) if the profit of every 100 cases of A beverage can be increased by 10,000 yuan, should the production plan be changed?
(4) if the profit can be increased by $10,000 per 100 cases of beverage A, and if the investment of $8000 can increase the raw material by 1 kg, should this investment be made? How much investment is reasonable?
(5) if bulk cartons are not allowed (production according to 100 cartons), how to arrange the production plan, that is, how much each of the two beverages are produced to maximize profits?
2. Using PuLP library to solve linear programming problem 1 (1) mathematical modeling.
Problem modeling:
Decision variables:
X1: a beverage output (unit: 100 cases)
X2: B beverage output (unit: 100 cases)
Objective function:
Max fx = 10*x1 + 9*x2
Constraints:
6*x1 + 5*x2
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.