Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#5340 closed defect (fixed)

Model failed to extract parameter data from function

Reported by: trista.arinomo@… Owned by: somebody
Priority: high Milestone: Future
Component: *unknown* Version: v1.13.0
Keywords: Cc:

Description

Hallo everyone,

I have a wire model that use enumeration to enable different type and size of wire to be chossen for simulation. Until recently I used v.1.12.0 and it works. yesterday I installed the v.1.13.2 and got this error when i try to simulate a wire modell

[1] 09:36:20 Translation Error
[KS_modelica.ExternalLibrary: 4649:13-4649:65]: Internal error BackendDAECreate.lowerEqn failed for initial equation
  terminate("Parameters for Wire model not possible.");

Insde the model in the initial equation, the insulation thickness value is checked and will be terminate if thickness is < 0. I assume somehow the value from database is not loaded dto model.

The Same model is checked on three different PCs (two with v.1.13 and one with 1.12), on both PCs with v1.13 the simulatin is terminated due to said error. Unfortunately i can not share the model.

how my description of the problem is good enough.

thanks in advance

Change History (5)

comment:1 by anonymous, 6 years ago

Version: v1.13.0

I commented out the inital equation

 if WireData[1] < 0 then
    terminate("Parameters for Wire model not possible.");
  end if;

and the simulation works and the result shows that WireData[1] = 0.6.

i dont understand what happend :D But i really need to check the WireData[1] at initialization.

comment:2 by Adrian Pop, 6 years ago

I think i found the issue. I have a fix for it with PR:
https://github.com/OpenModelica/OMCompiler/pull/2935

comment:3 by Adrian Pop, 6 years ago

Resolution: fixed
Status: newclosed

Tested with model:

model TestInitialTerminate
  Real x(start = 1);
initial equation
  if x > 0 then
    terminate("Parameters for Wire model not possible.");
  end if;
equation
 der(x) = 1*x;
end TestInitialTerminate;

Got:

adrpo33@ida-0030 MINGW64 /c/home/adrpo33/dev/OMTesting/bugs/5340
$ time ~/dev/OpenModelica/build/bin/omc t.mos
true
""
record SimulationResult
    resultFile = "C:/home/adrpo33/dev/OMTesting/bugs/5340/TestInitialTerminate_res.mat",
    simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'TestInitialTerminate', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
    messages = "LOG_SUCCESS       | info    | The initialization finished successfully without homotopy method.
[C:/home/adrpo33/dev/OMTesting/bugs/5340/m.mo:5:5-5:57:writable]
stdout            | info    | Simulation call terminate() at initialization (time 0.000000)
|                 | |       | Message : Parameters for Wire model not possible.
LOG_SUCCESS       | info    | The simulation finished successfully.
",
    timeFrontend = 0.01193571906751038,
    timeBackend = 0.00398536948396356,
    timeSimCode = 0.001081770115732411,
    timeTemplates = 0.03034846590649504,
    timeCompile = 7.716367804859998,
    timeSimulation = 0.2736946357417601,
    timeTotal = 8.038123617816849
end SimulationResult;
"Warning: The initial conditions are not fully specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").
"

With a previous OpenModelica version I get:

[C:/home/adrpo33/dev/OMTesting/bugs/5340/m.mo:5:5-5:57:writable] Error: Internal error BackendDAECreate.lowerEqn failed for initial equation
  terminate("Parameters for Wire model not possible.");

which reproduces your bug.

comment:4 by Adrian Pop, 6 years ago

If you take the nightly builds from tomorrow, it will contain this fix:
https://build.openmodelica.org/omc/builds/windows/nightly-builds/

Note: See TracTickets for help on using tickets.