Hello all.
I am trying to solve a rather simple optimization problem. I want to maximize a cost function such as:
fobj=Load(t)*Price(t)-x(t)*Price(t)
Where t is the timestep, Load is the energy consumption, Price is the tariff at the given time and x the solution of ga (the purchased energy).
But in a 24-hour horizon, the sum of Loads must be equal to the sum of the purchased energy: ΣLoads=Σx or, to be more precise:
ΣLoads-x(1)-x(2)-...-x(t-1)=x(t)
Do anyone can help?
Thank you!

답변 (1개)

Matt J
Matt J 2022년 11월 17일
편집: Matt J 2022년 11월 17일

0 개 추천

I'm not sure why you are using ga() rather than linprog, but for the constraint you describe, the Aeq,beq constraint matrices would be,
Aeq=ones(1,numel(Price)); beq=sum(Loads);

카테고리

도움말 센터File Exchange에서 Linear Programming and Mixed-Integer Linear Programming에 대해 자세히 알아보기

제품

릴리스

R2022a

질문:

2022년 11월 17일

편집:

2022년 11월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by