working with random variable

조회 수: 2 (최근 30일)
Muhammad Uswah Pawara
Muhammad Uswah Pawara 2019년 2월 2일
댓글: 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 CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by