Opened 4 years ago

Closed 3 years ago

#6198 closed defect (fixed)

Index reduction issue in Buildings: the backend tries to differentiate a discontinuous expression

Reported by: casella Owned by: Karim.Abdelhak
Priority: critical Milestone: 1.18.0
Component: Backend Version:
Keywords: Cc: AnHeuermann

Description (last modified by casella)

Please check Buildings.Examples.ChillerPlant.DataCenterRenewables. The backend fails with

[/var/lib/jenkins/ws/OpenModelicaLibraryTestingWork/OpenModelica/OMCompiler/Compiler/BackEnd/Differentiate.mo:265:5-265:157:writable]
Error: Derivative of expression "bat.P = if con.multiSwitch1.firstActiveIndex == 0 then con.multiSwitch1.y_default else con.multiSwitch1.expr[con.multiSwitch1.firstActiveIndex]"
w.r.t. "time" is non-existent.

I'm not sure why the backend tries to differentiate that expression. Dymola and JModelica compile the model without any problem.

Change History (5)

comment:1 Changed 4 years ago by casella

  • Summary changed from Index reduction issue in Buildings to Index reduction issue in Buildings: the backend tries to differentiate a discontinuous expression

comment:2 Changed 4 years ago by casella

  • Milestone changed from 1.17.0 to 1.18.0

comment:3 Changed 4 years ago by casella

  • Description modified (diff)

comment:4 Changed 3 years ago by casella

After PR 7292 was merged in, the model now fails much later during C-compilation:

Buildings_7.0.0_Buildings.Examples.ChillerPlant.DataCenterRenewables_02nls.c\nBuildings_7.0.0_Buildings.Examples.ChillerPlant.DataCenterRenewables_02nls.c:312:116: 
error: used type \'boolean_array\' (aka \'struct base_array_s\') where arithmetic
or pointer type is required
data->localData[0]->realVars[530] /* dataCenterContinuousTimeControl.cooCoi.ele[4].preDro1.dp variable */ = 
(tmp0?homotopy(omc_Buildings_Fluid_BaseClasses_FlowModels_basicFlowFunction__m__flow(threadData, data->localData[0]->realVars[688] /* dataCenterContinuousTimeControl.cooCoi.m1_flow variable */, data->simulationInfo->realParameter[362]
/* dataCenterContinuousTimeControl.cooCoi.ele[4].preDro1.k PARAM */, data->simulationInfo->realParameter[378] /* dataCenterContinuousTimeControl.cooCoi.ele[4].preDro1.m_flow_turbulent PARAM */), 0.0):0.0);\n                                                                                                               

comment:5 Changed 3 years ago by casella

  • Resolution set to fixed
  • Status changed from new to closed

After PR #7342, this model is compiled successfully, see report. There is still some runtime issue at initialization, which is totally unrelated to the original topic of this ticket.

Note: See TracTickets for help on using tickets.