Two variables that are mutually dependant

조회 수: 3 (최근 30일)
Zahid Iqbal Rana
Zahid Iqbal Rana 2014년 12월 23일
편집: dpb 2014년 12월 23일
Dear Sir, I shall be very grateful to you if you help me in this regard.
clear all ;
clc;
Demand=300;
%%...........UNITS MIN AND MAX LIMITS ...........%%
a(1,1)=100; b(1,1)=600; %bounds on variable 1
a(1,2)=100; b(1,2)=400; %bounds on variable 2
a(1,3)=50; b(1,3)=200; %bounds on variable 3
B=[0.000136 0.0000175 0.000184;0.0000175 0.000154 0.000283;0.000184 0.000283 0.000161]; %Power Loss B Coefficient Matrix %
%%================INITIAL POPULATION ============%%
x=a+(b-a).*rand(1,3);
T=x(:,1)+x(:,2)+x(:,3); %total
z=[x(:,1)./T(:,1) x(:,2)./T(:,1) x(:,3)./T(:,1)]; % Equlity constraint
p= z.*Demand;
Total= p(:,1)+p(:,2)+p(:,3);
%%.................COST FUNCTION.............%%
f1=561+ 7.92.*p(:,1)+0.00156.*(p(:,1).^2);
f2=310+ 7.85.*p(:,2)+0.00194.*(p(:,2).^2);
f3=78+ 7.97.*p(:,3)+0.00482.*(p(:,3).^2);
TC=f1+f2+f3
%%.................Power Loss.............%%
PL=bsxfun(@times,bsxfun(@times, B,p),p');
PL=sum(PL(:))
I want to calculate TC by adding PL in demand so that
p= z.*(Demand+PL).
Please tell me how I can do this. I need p to calculate PL and PL to calculate p .

답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by