working with random variable

1 回表示 (過去 30 日間)
Muhammad Uswah Pawara
Muhammad Uswah Pawara 2019 年 2 月 2 日
Dear All, I am working with random variable. consider D (distance of points) is a Given Number. when I use only one number for example D=60 my script is working. However. when using more than one in my case 362 points (attached). the script is error. I am new in matlab. Thank you very much for assistance.
WTC= 2.5;
n=1000;
D=60;
r=0.1;
% Development and Consenting (DC)
DC = 100823310 + (173435860-100823310).*rand(n,1);
DCcost=DC*WTC;
%Construction Phase insurance (CPI)
CPI=59850+(73150-59850).*rand(n,1);
CPIcost=CPI*WTC;
%Turbine Cost (TC)
TC= 8401610 + (9753630-8401610).*rand(n,1);
TCcost=TC*WTC;
%Substructure Cost Monopile
SCMcost= 1915200+(4468800-1915200).*rand(n,1);
%Electric Infrastructure (EI)
EI = 4948*D+279580;
%Installation Cost Monopile (ICM)
ICMcost=1587488+(2381232-1587488).*rand(n,1);
% Electric infrastructure Installation
EII=535060+(557760-535060).*rand(n,1);
EIIcost=EII*WTC;
CAPEX = DCcost+CPIcost+TCcost+SCMcost+EI+ICMcost+EIIcost;
%OPEX
OM=13041*D+5e7;
%Operating phase insurance (OPI)
OPI=18360+(27540-18360).*rand(n,1);
OPIcost=OPI*WTC;
OPEX=OM+OPIcost;
t = 15 + (25-15).*rand(n,1);
cf = 0.072+(60.8-0.072 ).*rand(n,1);
crf=(r*(1+r).^t)./((1+r).^t-1);
annual=cf*8760;
LCOE=(CAPEX.*crf+OPEX)./annual;

採用された回答

Walter Roberson
Walter Roberson 2019 年 2 月 2 日
I suspect you need to change to something like,
WTC= 2.5;
load D.mat
D = Lm; %the stored variable name is Lm ??
n = size(D,1);
  3 件のコメント
Muhammad Uswah Pawara
Muhammad Uswah Pawara 2019 年 2 月 2 日
I already converted it.
Muhammad Uswah Pawara
Muhammad Uswah Pawara 2019 年 2 月 2 日
Thank you very much for your help, it works

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by