Skip to main content
. 2019 Sep 14;19(18):3973. doi: 10.3390/s19183973
Algorithm 1 Demand Calculation Function (DCF)
  • 1:

    RWt(renewable vector) = {σ1,,σ24}

  • 2:

    N=size(Ai)

  • 3:

    Defining variables tbegi, tendi

  • 4:

    for ihour time to the total number of hours do

  • 5:

    if ihour doesn’t belongs to interval [tbegi,tendi] then

  • 6:

      fDit computation

  • 7:

    end if

  • 8:

    end for

  • 9:

    for iappliance 1 to size of appliances configuration (Ai) do

  • 10:

    RWt=RWtAi(fDit)

  • 11:

    end for

  • 12:

    Ai(vDit)=Ai(vDit)Ai(fDit)

  • 13:

    Ai(Dit(Dit<0))=0

  • 14:

    Ai(fDit)=Ai(fDit)Ai(fDit) Objective Function F(Ai,RWt,tschedi)

  • Require: 

    Ai configuration: vDit,fDit,Li,tbegi,tendi

  • Ensure: 

    tbegi<tendi

  • 15:

    HC initialisation (consume Hourly Energy)

  • 16:

    for iappliance 1 to size of appliance configuration do

  • 17:

     Set tbegi

  • 18:

     Set tendi based on Li and tbegi

  • 19:

    for ihour time to the total number of hours do

  • 20:

      if ihour belongs to interval [tbegi,tendi] then

  • 21:

       HC(ihour)HC(ihour)+Ai(vDit)

  • 22:

      else

  • 23:

       HC(ihour)HC(ihour)+Ai(fDit)

  • 24:

      end if

  • 25:

    end for

  • 26:

    end for

  • 27:

    RWts=RWtHCt

  • 28:

    RWts(RWts<0)=0

  • 29:

    Demanded_RWtmin(RWt,HCt)

  • 30:

    R1=sum(RWts); R2=max(HCt)

  • 31:

    Result=sum(R1+R2)

  • 32:

    return Result,Demanded_RWt,HCt(tschedi)