Opened 12 years ago

Closed 12 years ago

#1794 closed defect (fixed)

Internal error BackendEquation.equationToExp failed with 1.9 beta, 1.8.1 works.

Reported by: Teemu Lempinen Owned by: Jens Frenkel
Priority: high Milestone: 1.9.0
Component: Backend Version:
Keywords: Cc:

Description

The latest 1.9 release does not simulate a model that has been working well with 1.8.1. The error is given below.

record SimulationResult
 resultFile = "",
 simulationOptions = "startTime = 0.0, stopTime = 10.0, numberOfIntervals = 500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'Test', storeInTemp = false, noClean = false, options = '', outputFormat = 'csv', variableFilter = '.*', measureTime = false, cflags = '', simflags = ''",
 messages = "Simulation failed for model: Test[Test.mo:15:5-15:96:writable] Error: Internal error BackendEquation.equationToExp failed: c[1,1] = if e[1,1] > 0.5 and d[1] < 0.5 then 1.0 else 0.0
 Error: Internal error createOdeSystem2 failed for Jacobian Constant
 Error: Internal error createOdeSystem failed for {5, 3, 6, 8, 10, 2, 4, 7, 9, 1:7, 3, 8, 10, 6, 2, 4, 9, 5, 1} Size: 10 Jacobian Constant
 Error: Internal error createEquationsForSystem1 failed
 Error: Internal error ./Compiler/BackEnd/SimCode.mo: function createSimCode failed [Transformation from optimised DAE to simulation code structure failed]
 ",

The error occurs when trying to simulate the following model:

model Test

    constant Integer size = 2;
    constant Integer elements[size] = {1,2};
    parameter Real e[size, size] = fill(0.0, size, size);
    Real a[size];
    Real b[size];
    Real c[size, size];
    Real d[size];

equation

    a = {if b[i] < 0.5 then -1 else 0 for i in elements};
    b = {if sum(c[i,:]) < 0.5 then 1 else 0 for i in elements};
    c = { { if e[i,j]  > 0.5 and d[j] < 0.5 then 1 else 0 for j in elements} for i in elements};
    d = {(if a[i] >= 0.9999 then 1 else 0) for i in elements};	
	
end Test;

The example model has been stripped down to a small model that gives the error. As such, this model does not make any sense. The original model is larger and automatically generated.

Change History (4)

comment:1 by Martin Sjölund, 12 years ago

Owner: changed from somebody to Jens Frenkel
Status: newassigned

comment:2 by Jens Frenkel, 12 years ago

  • problem is analyzation of the jacobian and the system.
  • It should be nonliniear because some variables of the strong connected system occure int the if conditions but it is liniear/constant.

comment:3 by Martin Sjölund, 12 years ago

Jens, this seems to be working now. Was there a testcase added for this or should we add this model?

comment:4 by Jens Frenkel, 12 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.