Quiz I am trying to convert a statement into equation

2 views (last 30 days)
I have a question. How can create a program that can perform a task for accurate decision making. For example, I need to take a decision based on some constrains is have in a business. this are the facts. I have 75 machines that can produce two products say B=Bucket, and K=Kettle, The cost expense for electricity and materials for the production of 30 cartoons of Bucket is N210 and the profit per cartoon is N2.00 while for the kettle the cost /material expenses is N120 and the profit per cartoon is N1.30. How you are restricted by two factors N15,000 for expenses and 4000 storage capacity for the warehouse, So how can you utilize effectively the 75 machines

Accepted Answer

Stefano Gianoli
Stefano Gianoli on 27 Oct 2016
Following the guideline contained in
you can easily solve the problem as follow:
First you need to define an objective or cost function. This function must describe a minimization problem.
Let's assume you want to maximize the profit or minimize it negate as a function of the number of Bucket x(1) and Kettle x(2).
Your cost function then is:
f'*x := f(1) * x(1) + f(2) * x(2)
hence
>> f = [-2; -1.3];
let's define the inequality constraints for the production costs
7 * x(1) + 4 * x(2) <= 15000
and for the size of the warehouse:
x(1) + x(2) <= 4000
in matrix form
>> A = [7 4; 1 1];
>> b = [15000; 4000];
also x(1) and x(2) can assume value in the range 0 <= x <= 4000, therefore the lower bound and upper bound constrains are
>> lb = [0 0];
>> ub = [4000 4000];
you don't have any equality constrains therefore
>> Aeq = [];
>> beq = [];
Now you are ready to call the LP solver:
>> options = optimoptions('linprog','Algorithm','dual-simplex');
>> [x,fval,exitflag,output] = linprog(f,A,b,Aeq,beq,lb,ub,options);
the optimal solution should be
>> x
x =
0
3750
so the maximum profit within the given cost is given by producing 3750 Kettle only. You still have 250 storage capacity available in the warehouse, so this constraint wasn't hit.
The fact that we have 75 machines to utilize effectively is irrelevant for the above solution. Perhaps additional information such the production type: continuous or batch, time scheduled for producing B or K, etc. would make this additional information necessary/useful.
  1 Comment
Joshua Amuga
Joshua Amuga on 1 Nov 2016
Thank you So Much I really appreciate your time. One more thing can we go through this together if its possible by you. Question 1. A light bulb rated 240 volts and 75 watts. If the voltage decrease by 5 volts and the resistance of the bulb is increased by 8Ω, by how much will the power change. Solution. DATA. Volt;V_1=240v Volt;V_2=240-5=235v Power;P=75watts Resistance;R_1=x?. Resistance;R_2=x+8Ω..............................................................1 Find Power Change?
Power=IV ; I^2 V..............................................................2 P_1=V_1 I ..............................................................3 V_1=IR_1..............................................................4 Initial Voltage is V_1=240v Current I=? Initial Resistance Resistance;R_1=x? V_2=235 Resistance;R_2=x+8Ω V_2=IR_2..............................................................5 I=V_2/R_2 ..............................................................6 Substitute the values of V_2 and R_2 to get the valie of "I" I=235/(x+8Ω)..............................................................7 Recall from equation 3 P_1=V_1 I Substitute the values of P_1 and V_1 to get the value of x in I 75=240× 235/(x+8Ω) (75(x+8Ω))/75=56400/75 (x+8Ω)=752 x=752-8 R_1=x=744Ω R_2=x+8Ω R_2=744+8 R_2=752Ω Lets calculate the current "I" I=V_1/R_1 I=240/744=0.3226A I=V_1/R_1 I=235/752 Recall P_1=V_1 I P_2=V_2 I P_2=235×0.3125 P_2=73.44watts Change in Power difference P_1-P_2 ∆ in Power=75-73.44 ∆P=1.5625watts.
Question 2 〖(d^2 y)/(dx^2 )+4 dy/dx+3y=0 subject to the initial condition y〗_((0))=3;〖y^'〗_((0))=4 where y^'=dy/dx Solution. We will attempt to first solve this differential equation by general method then we will also subject the equation to the given initial conditions let y=e^mx and y^'=me^mx and y^''=m^2 e^mx Where (d^2 y)/(dx^2 )=y^'' and dy/dx=y^' and y=y substitute the values in the above equation m^2 e^mx+4me^mx+3e^mx=0 e^mx (m^2+4m+3)=0 Find the roots of equation m(m+1)+3(m+1)=0 (m+1)(m+3)=0 Therefore m=-1 and m=-3 The general Solution is y=C_1 e^(-x)+C_2 e^(-3x) where C_1 and C_2 are arbitrary constant Now lets subject y^''+4y^'+3y=0 to the initial condition y_((0)) =3;〖y^'〗_((0))=4 we have the following y^2+4y^'+3y=0 where y_((0)) =3;〖y^'〗_((0))=4
y^2+4×4+3×3=0 y^2+16+9=0 y^2+25=0 y^2=-25 y=√(-25) y=-5 Question 3 In a biogas production experiment products increases with temperature as shown in the Table below. Determine the best fits between linear, quadratic and cubic for the observed data x 0 10 20 30 40 50 60 70 80 90 100 y 27.6 31.0 34.0 37 40 42.6 45.5 48.3 51.1 54.0 56.7

Sign in to comment.

More Answers (1)

Shlomo
Shlomo on 26 Oct 2016
It's a unit commitment problem (and there's much literature on it). It's an integer programming problem and Matlab has a solver for this class of problems https://www.mathworks.com/help/optim/ug/intlinprog.html.
Basically you define a cost function that includes the profit from selling your items and the cost of electricity, etc. Then you feed in your constraints (max costs, storage capacity and machine capacity) and the solver will give you an optimal solution (to within some tolerance).
If you are looking to solve large-scale problems I would recommend you look into dedicated Mixed Integer Programming (MIP) solvers.

Categories

Find more on Linear Programming and Mixed-Integer Linear Programming in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!