Two variables that are mutually dependant
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!