Running command: "" <> buildModelFMU(Buildings.Controls.Predictors.Validation.LinearInputDayOfAdjustment,fileNamePrefix="Buildings_5_0_1_Buildings_Controls_Predictors_Validation_LinearInputDayOfAdjustment",fmuType="me",version="2.0",platforms={"dynamic"}) Notification: Performance of loadModel(Buildings): time 4.422/4.422, allocations: 404.2 MB / 411.3 MB, free: 388 kB / 314.7 MB Notification: Performance of FrontEnd - loaded program: time 2.397e-05/2.395e-05, allocations: 4 kB / 0.4945 GB, free: 1.309 MB / 410.7 MB Notification: Performance of FrontEnd - Absyn->SCode: time 0.6825/0.6826, allocations: 92.68 MB / 0.585 GB, free: 2.305 MB / 474.7 MB Notification: Performance of FrontEnd - scodeFlatten: time 0.3074/0.9901, allocations: 127 MB / 0.7091 GB, free: 3.129 MB / 0.5886 GB Notification: Performance of FrontEnd - mkProgramGraph: time 0.0004417/0.9906, allocations: 75.95 kB / 0.7091 GB, free: 3.055 MB / 0.5886 GB Notification: Performance of FrontEnd - DAE generated: time 0.2917/1.282, allocations: 66.66 MB / 0.7742 GB, free: 188 kB / 0.6511 GB Notification: Performance of FrontEnd: time 2.595e-06/1.282, allocations: 0 / 0.7742 GB, free: 188 kB / 0.6511 GB Notification: Performance of Transformations before backend: time 0.0001863/1.283, allocations: 112 kB / 0.7743 GB, free: 76 kB / 0.6511 GB Notification: Model statistics after passing the front-end and creating the data structures used by the back-end: * Number of equations: 1839 * Number of variables: 1839 Notification: Performance of Generate backend data structure: time 0.6497/1.932, allocations: 5.763 MB / 0.78 GB, free: 161.3 MB / 0.6511 GB Notification: Performance of prepare preOptimizeDAE: time 6.997e-05/1.932, allocations: 10.5 kB / 0.78 GB, free: 161.3 MB / 0.6511 GB Notification: Performance of preOpt normalInlineFunction (simulation): time 0.003229/1.936, allocations: 0.6218 MB / 0.7806 GB, free: 161 MB / 0.6511 GB Notification: Performance of preOpt evaluateParameters (simulation): time 0.009957/1.946, allocations: 1.866 MB / 0.7824 GB, free: 160.5 MB / 0.6511 GB Notification: Performance of preOpt simplifyIfEquations (simulation): time 5.488e-05/1.946, allocations: 12.83 kB / 0.7824 GB, free: 160.5 MB / 0.6511 GB Notification: Performance of preOpt expandDerOperator (simulation): time 0.001162/1.947, allocations: 387.2 kB / 0.7828 GB, free: 160.5 MB / 0.6511 GB Notification: Performance of preOpt removeEqualFunctionCalls (simulation): time 0.003658/1.951, allocations: 1.72 MB / 0.7845 GB, free: 160.5 MB / 0.6511 GB Error: An independent subset of the model has imbalanced number of equations (1806) and variables (78). variables: integrator.y integrator.u TSam.y TSam.u TSam.firstTrigger TSam.sampleTrigger err.y err.u2 err.u1 to_degC.y to_degC.u PCon.y PCon.u2 PCon.u1 POffSet.y TOut.y notEventDay.y notEventDay.u dayType.skipIDayIncrement dayType.sampleTrigger dayType.iDay dayType.y[2] dayType.y[1] tri.pulsStart tri.y baseLoad.TOut baseLoad.TOut_in_internal baseLoad.idxSam baseLoad.intTOutLast baseLoad.intTOut baseLoad.EHisAve baseLoad.EActAve baseLoad._storeHistory baseLoad._typeOfDay[12] baseLoad._typeOfDay[11] baseLoad._typeOfDay[10] baseLoad._typeOfDay[9] baseLoad._typeOfDay[8] baseLoad._typeOfDay[7] baseLoad._typeOfDay[6] baseLoad._typeOfDay[5] baseLoad._typeOfDay[4] baseLoad._typeOfDay[3] baseLoad._typeOfDay[2] baseLoad._typeOfDay[1] baseLoad.iSam[12] baseLoad.iSam[11] baseLoad.iSam[10] baseLoad.iSam[9] baseLoad.iSam[8] baseLoad.iSam[7] baseLoad.iSam[6] baseLoad.iSam[5] baseLoad.iSam[4] baseLoad.iSam[3] baseLoad.iSam[2] baseLoad.iSam[1] baseLoad.tLast baseLoad.ELast baseLoad.sampleTrigger baseLoad.PAve baseLoad.adj baseLoad.storeHistory baseLoad.typeOfDay[2] baseLoad.typeOfDay[1] baseLoad.PPre[12] baseLoad.PPre[11] baseLoad.PPre[10] baseLoad.PPre[9] baseLoad.PPre[8] baseLoad.PPre[7] baseLoad.PPre[6] baseLoad.PPre[5] baseLoad.PPre[4] baseLoad.PPre[3] baseLoad.PPre[2] baseLoad.PPre[1] baseLoad.ECon equations: 1 : baseLoad.sampleTrigger = sample(1, baseLoad.samStart, 3600.0) 2 : der(baseLoad.intTOut) = baseLoad.TOut_in_internal 3 : algorithm when baseLoad.sampleTrigger then baseLoad._storeHistory := if not pre(baseLoad._storeHistory) and not Buildings.Controls.Predictors.ElectricalLoad$baseLoad.isMidNight(time) then false else baseLoad.storeHistory; baseLoad._typeOfDay := Buildings.Controls.Predictors.ElectricalLoad$baseLoad.getTypeOfDays(time, {baseLoad.typeOfDay[1], baseLoad.typeOfDay[2]}, 3600.0, 12); baseLoad.idxSam := Buildings.Controls.Predictors.ElectricalLoad$baseLoad.getIndex(-1 + baseLoad.iSam[1], 24); if baseLoad._storeHistory or pre(baseLoad._storeHistory) then if time - baseLoad.tLast > 1e-05 then baseLoad.iHis[pre(baseLoad._typeOfDay[1]),baseLoad.idxSam] := Buildings.Controls.Predictors.ElectricalLoad$baseLoad.incrementIndex(baseLoad.iHis[pre(baseLoad._typeOfDay[1]),baseLoad.idxSam], 10); if baseLoad.iHis[pre(baseLoad._typeOfDay[1]),baseLoad.idxSam] == 10 then baseLoad.historyComplete[pre(baseLoad._typeOfDay[1]),baseLoad.idxSam] := true; end if; baseLoad.PAve := (baseLoad.ECon - baseLoad.ELast) / (time - baseLoad.tLast); baseLoad.P[pre(baseLoad._typeOfDay[1]),baseLoad.idxSam,baseLoad.iHis[pre(baseLoad._typeOfDay[1]),baseLoad.idxSam]] := baseLoad.PAve; baseLoad.T[pre(baseLoad._typeOfDay[1]),baseLoad.idxSam,baseLoad.iHis[pre(baseLoad._typeOfDay[1]),baseLoad.idxSam]] := (baseLoad.intTOut - baseLoad.intTOutLast) / (time - baseLoad.tLast); end if; end if; baseLoad.ELast := baseLoad.ECon; baseLoad.intTOutLast := baseLoad.intTOut; baseLoad.tLast := time; if baseLoad.predictionModel == Buildings.Controls.Predictors.Types.PredictionModel.WeatherRegression then for m in 1:12 loop baseLoad.PPre[m] := Buildings.Controls.Predictors.BaseClasses.weatherRegression({baseLoad.P[baseLoad._typeOfDay[m],baseLoad.iSam[m],1], baseLoad.P[baseLoad._typeOfDay[m],baseLoad.iSam[m],2], baseLoad.P[baseLoad._typeOfDay[m],baseLoad.iSam[m],3], baseLoad.P[baseLoad._typeOfDay[m],baseLoad.iSam[m],4], baseLoad.P[baseLoad._typeOfDay[m],baseLoad.iSam[m],5], baseLoad.P[baseLoad._typeOfDay[m],baseLoad.iSam[m],6], baseLoad.P[baseLoad._typeOfDay[m],baseLoad.iSam[m],7], baseLoad.P[baseLoad._typeOfDay[m],baseLoad.iSam[m],8], baseLoad.P[baseLoad._typeOfDay[m],baseLoad.iSam[m],9], baseLoad.P[baseLoad._typeOfDay[m],baseLoad.iSam[m],10]}, if baseLoad.historyComplete[baseLoad._typeOfDay[m],baseLoad.iSam[m]] then 10 else baseLoad.iHis[baseLoad._typeOfDay[m],baseLoad.iSam[m]], if m == 1 then baseLoad.TOut_in_internal else baseLoad.TOutFut_in_internal[-1 + m], {baseLoad.T[baseLoad._typeOfDay[m],baseLoad.iSam[m],1], baseLoad.T[baseLoad._typeOfDay[m],baseLoad.iSam[m],2], baseLoad.T[baseLoad._typeOfDay[m],baseLoad.iSam[m],3], baseLoad.T[baseLoad._typeOfDay[m],baseLoad.iSam[m],4], baseLoad.T[baseLoad._typeOfDay[m],baseLoad.iSam[m],5], baseLoad.T[baseLoad._typeOfDay[m],baseLoad.iSam[m],6], baseLoad.T[baseLoad._typeOfDay[m],baseLoad.iSam[m],7], baseLoad.T[baseLoad._typeOfDay[m],baseLoad.iSam[m],8], baseLoad.T[baseLoad._typeOfDay[m],baseLoad.iSam[m],9], baseLoad.T[baseLoad._typeOfDay[m],baseLoad.iSam[m],10]}); end for; else baseLoad.PPre := {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; assert(false, "Wrong value for prediction model."); end if; if baseLoad._storeHistory or pre(baseLoad._storeHistory) then baseLoad.PPreHis[baseLoad._typeOfDay[1],Buildings.Controls.Predictors.ElectricalLoad$baseLoad.getIndex(1 + baseLoad.idxSam, 24)] := baseLoad.PPre[1]; baseLoad.PPreHisSet[baseLoad._typeOfDay[1],Buildings.Controls.Predictors.ElectricalLoad$baseLoad.getIndex(1 + baseLoad.idxSam, 24)] := baseLoad.iHis[baseLoad._typeOfDay[1],baseLoad.iSam[1]] > 0; end if; baseLoad.EHisAve := 0.0; baseLoad.EActAve := 0.0; for i in -4:-2 loop if Modelica.Math.BooleanVectors.allTrue({baseLoad.PPreHisSet[baseLoad._typeOfDay[1],Buildings.Controls.Predictors.ElectricalLoad$baseLoad.getIndex(baseLoad.iSam[1] + -4, 24)], baseLoad.PPreHisSet[baseLoad._typeOfDay[1],Buildings.Controls.Predictors.ElectricalLoad$baseLoad.getIndex(baseLoad.iSam[1] + -3, 24)], baseLoad.PPreHisSet[baseLoad._typeOfDay[1],Buildings.Controls.Predictors.ElectricalLoad$baseLoad.getIndex(baseLoad.iSam[1] + -2, 24)]}) then baseLoad.EHisAve := baseLoad.EHisAve + 3600.0 * baseLoad.PPreHis[baseLoad._typeOfDay[1],Buildings.Controls.Predictors.ElectricalLoad$baseLoad.getIndex(1 + baseLoad.idxSam + i, 24)]; baseLoad.EActAve := baseLoad.EActAve + 3600.0 * baseLoad.P[baseLoad._typeOfDay[1],Buildings.Controls.Predictors.ElectricalLoad$baseLoad.getIndex(1 + baseLoad.idxSam + i, 24),baseLoad.iHis[baseLoad._typeOfDay[1],Buildings.Controls.Predictors.ElectricalLoad$baseLoad.getIndex(1 + baseLoad.idxSam + i, 24)]]; else baseLoad.EHisAve := 0.0; baseLoad.EActAve := 0.0; end if; end for; if baseLoad.EHisAve > 1e-15 or baseLoad.EHisAve < -1e-15 then baseLoad.adj := min(baseLoad.maxAdjFac, max(baseLoad.minAdjFac, baseLoad.EActAve / baseLoad.EHisAve)); else baseLoad.adj := 1.0; end if; baseLoad.PPre[:] := {baseLoad.PPre[1] * baseLoad.adj, baseLoad.PPre[2] * baseLoad.adj, baseLoad.PPre[3] * baseLoad.adj, baseLoad.PPre[4] * baseLoad.adj, baseLoad.PPre[5] * baseLoad.adj, baseLoad.PPre[6] * baseLoad.adj, baseLoad.PPre[7] * baseLoad.adj, baseLoad.PPre[8] * baseLoad.adj, baseLoad.PPre[9] * baseLoad.adj, baseLoad.PPre[10] * baseLoad.adj, baseLoad.PPre[11] * baseLoad.adj, baseLoad.PPre[12] * baseLoad.adj}; for i in 1:12 loop baseLoad.iSam[i] := Buildings.Controls.Predictors.ElectricalLoad$baseLoad.incrementIndex(baseLoad.iSam[i], 24); end for; end when; 4 : tri.y = time >= tri.pulsStart and time < tri.pulsStart + tri.Twidth 5 : dayType.y[1] = dayType.days[1 + mod(-1 + dayType.iDay, 7)] 6 : dayType.y[2] = dayType.days[1 + mod(dayType.iDay, 7)] 7 : dayType.sampleTrigger = sample(3, dayType.firstSample, dayType.samplePeriod) 8 : notEventDay.y = not notEventDay.u 9 : TOut.y = TOut.offset + (if time < TOut.startTime then 0.0 else if time < TOut.startTime + TOut.duration then (time - TOut.startTime) * TOut.height / TOut.duration else TOut.height) 10 : POffSet.y = POffSet.k 11 : PCon.y = PCon.k1 * PCon.u1 + PCon.k2 * PCon.u2 12 : to_degC.y = -273.15 + to_degC.u 13 : err.y = err.k1 * err.u1 + err.k2 * err.u2 14 : TSam.sampleTrigger = sample(4, TSam.startTime, TSam.samplePeriod) 15 : der(integrator.y) = integrator.k * integrator.u 16 : baseLoad.TOut = baseLoad.TOut_in_internal 17 : PCon.u1 = POffSet.y 18 : TOut.y = TSam.u 19 : TSam.y = baseLoad.TOut 20 : TSam.y = to_degC.u 21 : PCon.y = err.u2 22 : PCon.y = integrator.u 23 : baseLoad.ECon = integrator.y 24 : PCon.u2 = to_degC.y 25 : baseLoad.PPre[1] = err.u1 26 : notEventDay.u = tri.y 27 : baseLoad.storeHistory = notEventDay.y 28 : baseLoad.typeOfDay[1] = dayType.y[1] 29 : baseLoad.typeOfDay[2] = dayType.y[2] 30 : when TSam.sampleTrigger then TSam.firstTrigger := time <= TSam.startTime + 0.5 * TSam.samplePeriod; end when; 31 : when {TSam.sampleTrigger, initial()} then TSam.y := TSam.u; end when; 32 : when dayType.sampleTrigger then dayType.skipIDayIncrement := false; end when; 33 : when dayType.sampleTrigger then dayType.iDay := if pre(dayType.skipIDayIncrement) then pre(dayType.iDay) else 1 + mod(pre(dayType.iDay), 7); end when; 34 : when sample(2, tri.startTime, tri.period) then tri.pulsStart := time; end when; Notification: Performance of preOpt clockPartitioning (simulation) : time 0.00463/1.955, allocations: 2.535 MB / 0.787 GB, free: 160.2 MB / 0.6511 GB Error: pre-optimization module clockPartitioning (simulation) failed.