Azzera filtri
Azzera filtri

working with random variable

2 visualizzazioni (ultimi 30 giorni)
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;

Risposta accettata

Walter Roberson
Walter Roberson il 2 Feb 2019
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 Commenti
Muhammad Uswah Pawara
Muhammad Uswah Pawara il 2 Feb 2019
I already converted it.
Muhammad Uswah Pawara
Muhammad Uswah Pawara il 2 Feb 2019
Thank you very much for your help, it works

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by