MATLAB Answers

Use of linprog with an implicit function attached

1 view (last 30 days)
Andrew Alkiviades
Andrew Alkiviades on 8 Jul 2012
I am trying to use linprog as shown in the code below where: PV_supply, WT_supply and Diesel_supply are 24x1. As you can see, the "diesel_cost" which is a part of the objective function "f" is a function of the "Diesel_supply" which I am trying to vary per hour of the 24 hour data set.
However, at the same time this diesel cost is related to the "Diesel_supply" that is in the inequality constraint "A".
Diesel_generator_energy = sum(Diesel_supply);
Diesel_cost = Diesel_generator_energy*Diesel_cost_per_kWh;
A = [-PV_supply -WT_supply -Diesel_supply];
b = [-Demand;];
f = [CRF_PV*CC_PV; CRF_WT*CC_WT; CRF_Diesel_generator*CC_Diesel+Diesel_cost];
[x,fval,exitflag] = linprog(f,A,b,[],[],lb,ub)
I am struggling to understand, if first of all, it is possible to do such a programme and what the technique will be i.e if the "Diesel_supply" values are completely unknown (only the size is known) can I formulate for minimising the objective function, meeting the constraints with an unknown vector? If this can be done with more input information, what will this be?
I do know the following equation which I am not sure if it can be used:
Diesel_cost = diesel_cost_litres*( b*diesel_generator_capacity + a*diesel_supply) where a and b and diesel_cost_litres are constants.
for example, the "diesel_supply" is what I am looking for, but if I was to predetermine the "diesel_generator_capacity" to a scalar value then I might be able to minimize "Diesel_cost" in the function "f" somehow?
thank you

  1 Comment

Richard Brown
Richard Brown on 9 Jul 2012
I'm not sure I particularly understand the way you've phrased your question very well, but surely if diesel_generator_capacity is known, and Diesel_cost is known from your second equation, then Diesel_supply is also known (from your equation involving diesel_cost_litres ).
otherwise no, you can't run linprog with undefined variables in the constraints.

Sign in to comment.

Answers (0)

Sign in to answer this question.

Translated by