필터 지우기
필터 지우기

matlab optimisation problem _ constraint

조회 수: 3 (최근 30일)
NN
NN 2021년 4월 20일
답변: Walter Roberson 2021년 4월 20일
Hi, this is a code from matlab optimisation problem given in the below link
% Power input/output to battery
prob.Constraints.energyBalance = optimconstr(N);
prob.Constraints.energyBalance(1) = EbattV(1) == Einit;
prob.Constraints.energyBalance(2:N) = EbattV(2:N) == EbattV(1:N-1) - PbattV(1:N-1)*dt;
please explain what it means!

채택된 답변

Walter Roberson
Walter Roberson 2021년 4월 20일
A problem is being constructed. It has constraints. One constraint is named energyBalance .
The first line, optimconstr(N) says that a constraint with N parts is being constructed.
The assignment to energyBalance(1) says that the first constraint is that the first battery voltage must be a particular initial condition.
The assignment to energyBalance(2:N) says that the next N-1 constraints are that the battery voltages must decrease each time by Pbattv*dt .

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by