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 Center および File ExchangeNumerical 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