Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Oil Refinery
#1
Dear all,

An oil refinery processes a total of 20 types of crude oil over 2 years. At any one time, the refinery runs a mixture of 3-5 types crude oils. Because each crude oil is different, each crude oil mixture yields a different ratio of 4 refined products. Also, each type of crude is featured in more than one crude run.

Data available are: (1) mixture of the crude oils for each run and (2) the yield of 4 different products (A,B,C,D).

Objective: To find out the yield of each type of crude.

My question is: what class of problem is this? Is there a feature in Python that can give a good guess to this type of problem?

Thank you in advance!
Reply
#2
It looks like a linear system of equations, for example suppose that the crude C_k produces the unknown quantities a_k, b_k, c_k, d_k of each product. If we mix together 3 crudes C_1, C_2, C_3 in proportions x, y, z and we observe the quantities q_a, q_b, q_c, q_d of each product, it gives 4 linear equations for the a_k, ..., namely
Output:
x * a_1 + y * a_2 + z * a_3 = q_a x * b_1 + y * b_2 + z * b_3 = q_b x * c_1 + y * c_2 + z * c_3 = q_c x * d_1 + y * d_2 + z * d_3 = q_d
If you have the result for various mixes of the crudes, it gives a large system of equations involving the a_k, ....

Modules like numpy.linalg contain tools to solve systems of linear equations. When exact solutions cannot be found, you can also try to get 'best fit' solutions using Moore-Penrose pseudo inverses of matrices and the like. Again, numpy and scipy contain tools to tackle these problems.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020