create function for optimization

1 Ansicht (letzte 30 Tage)
Rahul Kumar
Rahul Kumar am 13 Mär. 2021
Kommentiert: Rahul Kumar am 16 Mär. 2021
please create function for the given equation
in which NT= no. of hours ie.24
Ng= no. of DG which is 5
Bgi= bid of each DG
Pgi= power generated by each DG to satisfy the load (transpose)
MP= market price which is traded by the utility (transpose)
Pgrid is power sold or purchased by grid (transpose)
I am not able to create in function so please help me out.
thankyou very much

Akzeptierte Antwort

Srinidhi
Srinidhi am 13 Mär. 2021
Bearbeitet: Srinidhi am 13 Mär. 2021
function [Min_fx] = yourquestion(Bgi,Pgi,MP,Pgrid)
NT = 24; %no. of hours ie.24
Ng = 5; %no. of DG which is 5
evec = [];
for t = [1:1:NT]
for i = [1:1:Ng]
B = [];
A = (Bgi(i,1).*(Pgi(i,1).^t)) + ((MP(i,1).^(t))*(Pgrid(i,1).^(t)));
A = A';
evec = [evec A];
B = evec;
end
evec = [evec B];
end
Min_fx = sum(evec,'all');
end
  2 Kommentare
Srinidhi
Srinidhi am 13 Mär. 2021
hope this helps
Rahul Kumar
Rahul Kumar am 16 Mär. 2021
thankyou so much sir.....

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by