Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries --ompython_omhome=/usr IndustrialControlSystems_IndustrialControlSystems.Controllers.Digital.Examples.TestPID_TDOe.conf.json
loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo", uses=false) [Timeout 180]
"Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo): time 0.001381/0.001381, allocations: 112.7 kB / 18.94 MB, free: 2.93 MB / 14.72 MB
"
[Timeout remaining time 180]
loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex 4.0.0+maint.om/package.mo", uses=false) [Timeout 180]
"Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex 4.0.0+maint.om/package.mo): time 0.001271/0.001271, allocations: 188.7 kB / 22.22 MB, free: 5.105 MB / 14.72 MB
"
[Timeout remaining time 180]
loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 4.0.0+maint.om/package.mo", uses=false) [Timeout 180]
"Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 4.0.0+maint.om/package.mo): time 1.554/1.554, allocations: 225.6 MB / 251 MB, free: 13.02 MB / 206.1 MB
"
[Timeout remaining time 178]
loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/IndustrialControlSystems 2.0.0/package.mo", uses=false) [Timeout 180]
"Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/IndustrialControlSystems 2.0.0/package.mo): time 0.08275/0.08275, allocations: 11.34 MB / 317.6 MB, free: 13.76 MB / 254.1 MB
"
[Timeout remaining time 180]
Using package IndustrialControlSystems with version 2.0.0 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/IndustrialControlSystems 2.0.0/package.mo)
Using package Modelica with version 4.0.0 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 4.0.0+maint.om/package.mo)
Using package Complex with version 4.0.0 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex 4.0.0+maint.om/package.mo)
Using package ModelicaServices with version 4.0.0 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo)
Running command: translateModel(IndustrialControlSystems.Controllers.Digital.Examples.TestPID_TDOe,tolerance=1e-06,outputFormat="empty",numberOfIntervals=2500,variableFilter="",fileNamePrefix="IndustrialControlSystems_IndustrialControlSystems.Controllers.Digital.Examples.TestPID_TDOe")
translateModel(IndustrialControlSystems.Controllers.Digital.Examples.TestPID_TDOe,tolerance=1e-06,outputFormat="empty",numberOfIntervals=2500,variableFilter="",fileNamePrefix="IndustrialControlSystems_IndustrialControlSystems.Controllers.Digital.Examples.TestPID_TDOe") [Timeout 660]
"Notification: Performance of FrontEnd - loaded program: time 0.002031/0.002031, allocations: 63.91 kB / 443 MB, free: 6.414 MB / 302.1 MB
Notification: Performance of FrontEnd - Absyn->SCode: time 0.1426/0.1446, allocations: 54.89 MB / 497.9 MB, free: 15.43 MB / 366.1 MB
Notification: Performance of NFInst.instantiate(IndustrialControlSystems.Controllers.Digital.Examples.TestPID_TDOe): time 0.004616/0.1493, allocations: 2.36 MB / 0.4886 GB, free: 13.05 MB / 366.1 MB
Notification: Performance of NFInst.instExpressions: time 0.001268/0.1505, allocations: 495.5 kB / 0.489 GB, free: 12.56 MB / 366.1 MB
Notification: Performance of NFInst.updateImplicitVariability: time 0.0001808/0.1507, allocations: 19.81 kB / 0.4891 GB, free: 12.54 MB / 366.1 MB
Notification: Performance of NFTyping.typeComponents: time 0.0002891/0.151, allocations: 63.27 kB / 0.4891 GB, free: 12.48 MB / 366.1 MB
Notification: Performance of NFTyping.typeBindings: time 0.0001278/0.1511, allocations: 43.55 kB / 0.4892 GB, free: 12.44 MB / 366.1 MB
Notification: Performance of NFTyping.typeClassSections: time 0.0007668/0.1519, allocations: 275.5 kB / 0.4894 GB, free: 12.17 MB / 366.1 MB
Notification: Performance of NFFlatten.flatten: time 0.001053/0.1529, allocations: 0.7457 MB / 0.4901 GB, free: 11.42 MB / 366.1 MB
Notification: Performance of NFFlatten.resolveConnections: time 0.0001992/0.1531, allocations: 65.47 kB / 0.4902 GB, free: 11.35 MB / 366.1 MB
Notification: Performance of NFEvalConstants.evaluate: time 0.0003014/0.1534, allocations: 243.3 kB / 0.4904 GB, free: 11.11 MB / 366.1 MB
Notification: Performance of NFSimplifyModel.simplify: time 0.0003602/0.1538, allocations: 254.8 kB / 0.4907 GB, free: 10.86 MB / 366.1 MB
Notification: Performance of NFPackage.collectConstants: time 0.0001043/0.1539, allocations: 48 kB / 0.4907 GB, free: 10.81 MB / 366.1 MB
Notification: Performance of NFFlatten.collectFunctions: time 8.214e-05/0.154, allocations: 44 kB / 0.4908 GB, free: 10.77 MB / 366.1 MB
Notification: Performance of NFScalarize.scalarize: time 0.0001768/0.1542, allocations: 135.5 kB / 0.4909 GB, free: 10.64 MB / 366.1 MB
Notification: Performance of NFVerifyModel.verify: time 0.0002913/0.1545, allocations: 270.6 kB / 0.4912 GB, free: 10.37 MB / 366.1 MB
Notification: Performance of NFConvertDAE.convert: time 0.0006192/0.1551, allocations: 0.5172 MB / 0.4917 GB, free: 9.852 MB / 366.1 MB
Notification: Performance of FrontEnd - DAE generated: time 4.598e-06/0.1551, allocations: 0 / 0.4917 GB, free: 9.852 MB / 366.1 MB
Notification: Performance of FrontEnd: time 1.793e-06/0.1551, allocations: 0 / 0.4917 GB, free: 9.852 MB / 366.1 MB
Notification: Performance of Transformations before backend: time 9.248e-06/0.1551, allocations: 4 kB / 0.4917 GB, free: 9.848 MB / 366.1 MB
Notification: Model statistics after passing the front-end and creating the data structures used by the back-end:
 * Number of equations: 114
 * Number of variables: 114
Notification: Performance of Generate backend data structure: time 0.001583/0.1567, allocations: 0.824 MB / 0.4925 GB, free: 8.977 MB / 366.1 MB
Notification: Performance of prepare preOptimizeDAE: time 6.132e-05/0.1567, allocations: 8.031 kB / 0.4925 GB, free: 8.969 MB / 366.1 MB
Notification: Performance of preOpt normalInlineFunction (simulation): time 0.0001585/0.1569, allocations: 72.56 kB / 0.4925 GB, free: 8.898 MB / 366.1 MB
Notification: Performance of preOpt evaluateParameters (simulation): time 0.0006877/0.1576, allocations: 341.3 kB / 0.4929 GB, free: 8.539 MB / 366.1 MB
Notification: Performance of preOpt simplifyIfEquations (simulation): time 4.492e-05/0.1576, allocations: 37.31 kB / 0.4929 GB, free: 8.504 MB / 366.1 MB
Notification: Performance of preOpt expandDerOperator (simulation): time 0.0001182/0.1577, allocations: 56.36 kB / 0.493 GB, free: 8.449 MB / 366.1 MB
Notification: Performance of preOpt clockPartitioning (simulation): time 0.001052/0.1588, allocations: 0.5067 MB / 0.4935 GB, free: 7.938 MB / 366.1 MB
Notification: Performance of preOpt findStateOrder (simulation): time 2.741e-05/0.1588, allocations: 8.141 kB / 0.4935 GB, free: 7.93 MB / 366.1 MB
Notification: Performance of preOpt replaceEdgeChange (simulation): time 6.044e-05/0.1589, allocations: 23.94 kB / 0.4935 GB, free: 7.906 MB / 366.1 MB
Notification: Performance of preOpt inlineArrayEqn (simulation): time 1.493e-05/0.1589, allocations: 8 kB / 0.4935 GB, free: 7.898 MB / 366.1 MB
Notification: Performance of preOpt removeEqualRHS (simulation): time 0.0007854/0.1597, allocations: 379.8 kB / 0.4939 GB, free: 7.527 MB / 366.1 MB
Notification: Performance of preOpt removeSimpleEquations (simulation): time 0.002536/0.1622, allocations: 1.305 MB / 0.4951 GB, free: 6.16 MB / 366.1 MB
Notification: Performance of preOpt comSubExp (simulation): time 0.0006221/0.1628, allocations: 217 kB / 0.4953 GB, free: 5.941 MB / 366.1 MB
Notification: Performance of preOpt resolveLoops (simulation): time 0.0003396/0.1632, allocations: 165.7 kB / 0.4955 GB, free: 5.777 MB / 366.1 MB
Notification: Performance of preOpt evalFunc (simulation): time 2.247e-05/0.1632, allocations: 4.156 kB / 0.4955 GB, free: 5.773 MB / 366.1 MB
Error: An independent subset of the model has imbalanced number of equations (46) and variables (45).
variables:
Process.w
Process.U[2]
Process.Y[3]
Process.Y[1]
Process.u
Controller.dcs
Controller.cs
Controller.dd
Controller.d
Controller.di
Controller.dp
Controller.dpv
Controller.pv
Controller.dsp
Controller.sp
Controller.satLOW
Controller.satHI
Controller.CS
disturb.y
ProcessTDOe.w
ProcessTDOe.U[2]
ProcessTDOe.Y[3]
ProcessTDOe.Y[1]
ProcessTDOe.u
ControllerTDOe.nextEventTime
ControllerTDOe.cso
ControllerTDOe.dold
ControllerTDOe.pvo
ControllerTDOe.spo
ControllerTDOe.dcs
ControllerTDOe.dd
ControllerTDOe.d
ControllerTDOe.di
ControllerTDOe.dp
ControllerTDOe.dpv
ControllerTDOe.pv
ControllerTDOe.dsp
ControllerTDOe.sp
ControllerTDOe.cs
ControllerTDOe.satLOW
ControllerTDOe.satHI
ControllerTDOe.CS
$whenCondition3
$whenCondition2
$whenCondition1
equations:
1 : algorithm
  $whenCondition1 := sample(1, 0.0, 0.2);
  when $whenCondition1 then
    ControllerTDOe.cs := pre(ControllerTDOe.cs) + ControllerTDOe.dcs;
    ControllerTDOe.dcs := ControllerTDOe.dp + ControllerTDOe.di + ControllerTDOe.dd + ControllerTDOe.bias - pre(ControllerTDOe.bias);
    ControllerTDOe.dd := ControllerTDOe.d - ControllerTDOe.dold;
    ControllerTDOe.d := (ControllerTDOe.Td * pre(ControllerTDOe.d) + ControllerTDOe.Kp * ControllerTDOe.N * ControllerTDOe.Td * (ControllerTDOe.c * ControllerTDOe.dsp - ControllerTDOe.dpv)) / (if ControllerTDOe.Td > 0.0 then ControllerTDOe.Td + ControllerTDOe.N * 0.2 else 1.0);
    ControllerTDOe.di := ControllerTDOe.Kp * 0.2 / ControllerTDOe.Ti * (ControllerTDOe.sp - ControllerTDOe.pv);
    ControllerTDOe.dp := ControllerTDOe.Kp * (ControllerTDOe.b * ControllerTDOe.dsp - ControllerTDOe.dpv);
    if ControllerTDOe.cs > 2.0 then
      ControllerTDOe.cs := 2.0;
      ControllerTDOe.satHI := true;
      ControllerTDOe.satLOW := false;
    else
      ControllerTDOe.satHI := false;
    end if;
    if ControllerTDOe.cs < 0.0 then
      ControllerTDOe.cs := 0.0;
      ControllerTDOe.satLOW := true;
      ControllerTDOe.satHI := false;
    else
      ControllerTDOe.satLOW := false;
    end if;
    ControllerTDOe.spo := ControllerTDOe.sp;
    ControllerTDOe.pvo := ControllerTDOe.pv;
    ControllerTDOe.cso := ControllerTDOe.cs;
    ControllerTDOe.dold := ControllerTDOe.d;
    if ControllerTDOe.cs <= 0.0 then
      ControllerTDOe.CS := 0.0;
      ControllerTDOe.nextEventTime := time + 0.2;
    elseif ControllerTDOe.cs >= 2.0 then
      ControllerTDOe.CS := 2.0;
      ControllerTDOe.nextEventTime := time + 0.2;
    else
      ControllerTDOe.CS := 2.0;
      ControllerTDOe.nextEventTime := time + ControllerTDOe.cs / 2.0 * 0.2;
    end if;
  end when;
  $whenCondition2 := time >= ControllerTDOe.nextEventTime;
  when $whenCondition2 then
    if ControllerTDOe.cs > 0.0 and ControllerTDOe.cs < 2.0 then
      ControllerTDOe.CS := 0.0;
    end if;
  end when;

2 : algorithm
  $whenCondition3 := sample(1, 0.0, 0.2);
  when $whenCondition3 then
    Controller.cs := pre(Controller.cs) + Controller.dcs;
    Controller.dcs := Controller.dp + Controller.di + Controller.dd + Controller.bias - pre(Controller.bias);
    Controller.dd := Controller.d - pre(Controller.d);
    Controller.d := (Controller.Td * pre(Controller.d) + Controller.Kp * Controller.N * Controller.Td * (Controller.c * Controller.dsp - Controller.dpv)) / (if Controller.Td > 0.0 then Controller.Td + Controller.N * 0.2 else 1.0);
    Controller.di := Controller.Kp * 0.2 / Controller.Ti * (Controller.sp - Controller.pv);
    Controller.dp := Controller.Kp * (Controller.b * Controller.dsp - Controller.dpv);
    if Controller.cs > 2.0 then
      Controller.cs := 2.0;
      Controller.satHI := true;
      Controller.satLOW := false;
    else
      Controller.satHI := false;
    end if;
    if Controller.cs < 0.0 then
      Controller.cs := 0.0;
      Controller.satLOW := true;
      Controller.satHI := false;
    else
      Controller.satLOW := false;
    end if;
    Controller.CS := Controller.cs;
  end when;

3 : ProcessTDOe.Y[1] = der(ProcessTDOe.w)
4 : der(ProcessTDOe.Y[3]) = ProcessTDOe.w
5 : der(ProcessTDOe.U[2]) = ProcessTDOe.u
6 : ProcessTDOe.b[1] * ProcessTDOe.Y[1] + ProcessTDOe.b[2] * ProcessTDOe.w + ProcessTDOe.b[3] * ProcessTDOe.Y[3] = ProcessTDOe.num[1] * ProcessTDOe.u + ProcessTDOe.num[2] * ProcessTDOe.U[2]
7 : ProcessTDOe.u = ControllerTDOe.CS - disturb.y
8 : disturb.y = disturb.offset + (if time < disturb.startTime then 0.0 else disturb.height)
9 : Process.Y[1] = der(Process.w)
10 : der(Process.Y[3]) = Process.w
11 : der(Process.U[2]) = Process.u
12 : Process.b[1] * Process.Y[1] + Process.b[2] * Process.w + Process.b[3] * Process.Y[3] = Process.num[1] * Process.u + Process.num[2] * Process.U[2]
13 : Process.u = Controller.CS - disturb.y
Notification: Performance of preOpt encapsulateWhenConditions (simulation) <failed>: time 0.0009617/0.1642, allocations: 0.6683 MB / 0.4962 GB, free: 5.074 MB / 366.1 MB
Error: pre-optimization module encapsulateWhenConditions (simulation) failed.
"
[Timeout remaining time 660]
[Calling sys.exit(0), Time elapsed: 2.7886706795543432]
Failed to read output from testmodel.py, exit status != 0:
0.17225371301174164 0.188687985 0.030340436000000002
Calling exit ...
<OMPython.OMCSessionZMQ object at 0x7f6f130dd7b0>