Battery storage -optimisation problem_charge and discharge
Ältere Kommentare anzeigen
I have seperate decision variables for charge and discharge cosntraints for battery optimisation problem, but i am getting proper value as optimised outputs.
Below is the code :
% initial conditions, battery constraints
batteryMinMax.Pmin = -500e3;
batteryMinMax.Pmax = 500e3;
battEnergy = 3.6e6*upsBattCap;
batteryMinMax.Emax = 0.8*battEnergy;
batteryMinMax.Emin = 0.2*battEnergy;
%Decision variables
PbattchV = optimvar('PbattchV',N,'LowerBound',0,'UpperBound',batteryMinMax.Pmax);
EbattchV = optimvar('EbattchV',N,'LowerBound',0,'UpperBound',batteryMinMax.Emax);
PbattDchV = optimvar('PbattDchV',N,'LowerBound',0,'UpperBound',batteryMinMax.Pmin);
EbattDchV = optimvar('EbattDchV',N,'LowerBound',0,'UpperBound',batteryMinMax.Emin);
Please advice if i made any mistake.
13 Kommentare
Alan Weiss
am 4 Aug. 2021
These two lines are inconsistent:
batteryMinMax.Pmin = -500e3;
PbattDchV = optimvar('PbattDchV',N,'LowerBound',0,'UpperBound',batteryMinMax.Pmin);
You cannot sensibly have a lower bound of 0 and an upper bound of a negative number.
Alan Weiss
MATLAB mathematical toolbox documentation
NN
am 4 Aug. 2021
NN
am 17 Aug. 2021
Alan Weiss
am 17 Aug. 2021
Sorry, I don't know what you mean "But it gives zero output." Does it report an error? If so, please copy and paste the entire error message, everything in red. If not, then what is the problem exactly? Does it return a value of zero when you are expecting a nonzero output, or is there something else going on?
Alan Weiss
MATLAB mathematical toolbox documentation
NN
am 17 Aug. 2021
NN
am 18 Aug. 2021
Walter Roberson
am 18 Aug. 2021
We do not have the value of the input variables to test with.
NN
am 18 Aug. 2021
Walter Roberson
am 18 Aug. 2021
Which exact file? initial_conditions.m ? If so then are you using the same .mat that is loaded there?
NN
am 18 Aug. 2021
Walter Roberson
am 21 Aug. 2021
You are going to need to tell me which files or data to load and what to pass to battSolarOptimizetrial3
I would suggest writing a script that does the necessary steps.
NN
am 22 Aug. 2021
Walter Roberson
am 22 Aug. 2021
The model there is not compatible with the function at https://www.mathworks.com/matlabcentral/answers/891877-battery-storage-optimisation-problem_charge-and-discharge#comment_1693172 -- the function has fewer inputs than the Simulink model is passing in.
Antworten (0)
Kategorien
Mehr zu Manual Performance Optimization finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!