您现在的位置:首页 >> 技术文章 >> MATLAB技术 >> 内容

MATLAB代做|FPGA代做|python代做- single Power SGeneratorC

时间:2019-10-15 22:43:41 点击:

  核心提示:MATLAB代做|FPGA代做|python代做- single Power SGeneratorC...
% T3is is a function file: GeneratorCOPT(G,PR,A)
% This calculates the 'Outage Probability' for a single Power SGeneratorCOPTMatrixion
% G stands for number of generating unit
% PR stands for Power Ratings of each unit (in Array form)
% A stands for Availability of each unit (in Array form)
%
% By: Abhishek Chakraborty
% email: abhishek.piku@gmail.com

function Generator_COPT(G,PR,A)
format short g
G=6;
X=ff2n(G);
PR=[12; 12; 12; 12; 12; 155];
A=[0.98; 0.98; 0.98; 0.98; 0.98; 0.96];
InitiationMatrix=[zeros(1,2^G);zeros(1,2^G);ones(1,2^G);zeros(1,2^G)];
GeneratorCOPTMatrixTemp=InitiationMatrix';
for j=1:2^G
for i=1:G
    if (X(j,i)==0)
        GeneratorCOPTMatrixTemp(j,1)=GeneratorCOPTMatrixTemp(j,1)+PR(i,1);
        GeneratorCOPTMatrixTemp(j,3)=GeneratorCOPTMatrixTemp(j,3)*A(i,1);    
    else
        GeneratorCOPTMatrixTemp(j,2)=GeneratorCOPTMatrixTemp(j,2)+PR(i,1);
        GeneratorCOPTMatrixTemp(j,3)=GeneratorCOPTMatrixTemp(j,3)*(1-A(i,1));
    end
end
end
TemporaryMatrix=GeneratorCOPTMatrixTemp;
for m=1:(2^G)
    for n=1:(2^G)
    if(GeneratorCOPTMatrixTemp(m,1)==GeneratorCOPTMatrixTemp(n,1)&& m~=n && n>m)
        GeneratorCOPTMatrixTemp(m,3)=GeneratorCOPTMatrixTemp(m,3)+GeneratorCOPTMatrixTemp(n,3);
    else end
    end
end
for m=1:2^G
    for n=1:2^G
        if(GeneratorCOPTMatrixTemp(m,1)==GeneratorCOPTMatrixTemp(n,1) && m<n && m~=n && GeneratorCOPTMatrixTemp(m,1)~=0)
            GeneratorCOPTMatrixTemp(n,:)=zeros;
        else end
    end
end
for m=1:1:((2^G)-1)
    for n=1:1:((2^G)-1)
    if (GeneratorCOPTMatrixTemp(n,1)<GeneratorCOPTMatrixTemp((n+1),1))
        temp1=GeneratorCOPTMatrixTemp(n,1);
        temp2=GeneratorCOPTMatrixTemp(n,2);
        temp3=GeneratorCOPTMatrixTemp(n,3);
        GeneratorCOPTMatrixTemp(n,1)=GeneratorCOPTMatrixTemp((n+1),1);
        GeneratorCOPTMatrixTemp(n,2)=GeneratorCOPTMatrixTemp((n+1),2);
        GeneratorCOPTMatrixTemp(n,3)=GeneratorCOPTMatrixTemp((n+1),3);
        GeneratorCOPTMatrixTemp((n+1),1)=temp1;
        GeneratorCOPTMatrixTemp((n+1),2)=temp2;
        GeneratorCOPTMatrixTemp((n+1),3)=temp3;
    end
    end
end
GeneratorCOPTMatrix=GeneratorCOPTMatrixTemp;
GeneratorCOPTMatrix(~any(GeneratorCOPTMatrixTemp,2),:)=[];
GeneratorCOPTMatrix;
c=length(GeneratorCOPTMatrix(:,1));
suma=0;
for i=c:-1:1
    suma=suma+GeneratorCOPTMatrix(i,3);
    GeneratorCOPTMatrix(i,4)=suma;
end
l=length(GeneratorCOPTMatrix(:,1));

fprintf('CAPACITY AVAILABLE\t\t CAPACITY UNAVAILABLE\t\t STATE PROBABILITY\t\t CUMULITIVE PROBABILITY\n');
fprintf('==========================================================================================================\n');
for i=1:c
    fprintf('\t\t%d\t\t                 %d\t\t                  %10.8f\t\t             %10.8f\t\t\n',GeneratorCOPTMatrix(i,1),GeneratorCOPTMatrix(i,2),GeneratorCOPTMatrix(i,3),GeneratorCOPTMatrix(i,4))
end
    

联系:highspeedlogic

QQ :1224848052

微信:HuangL1121

邮箱:1224848052@qq.com

网站:http://www.mat7lab.com/

网站:http://www.hslogic.com/

微信扫一扫:

作者:SGeneratorC 来源:SGeneratorC
  • 您是如何找到本站的?
  • 百度搜索
  • Google搜索
  • 查阅资料过程中
  • 论坛发现
  • 百度贴吧发现
  • 朋友介绍
本站最新成功开发工程项目案例
相关文章
  • 没有相关文章
相关评论
发表我的评论
  • 大名:
  • 内容:
  • matlab代做|matlab专业代做|matlab淘宝代做(www.hslogic.com) © 2019 版权所有 All Rights Reserved.
  • Email:highspeed_logic@163.com 站长QQ: 1224848052

    专业代做/代写/承接、MATLAB、SIMULINK、FPGA项目、博士/硕士/本科毕业设计、课题设计、论文,毕业论文,Coursework、Eassy、Assignment