Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#5835 closed defect (fixed)

Issue with NF and functions with arrays of records

Reported by: casella Owned by: perost
Priority: blocker Milestone: 1.16.0
Component: New Instantiation Version:
Keywords: Cc: alberto.leva@…

Description

Please consider the attached MWE. Try to simulate the model Elements with the NF. The following error is reported:

[1] 16:42:16 Translation Error
[C:/dev/OM64bit/OMCompiler/Compiler/NFFrontEnd/NFEvalFunction.mo: 389:9-390:53]:
Internal error NFEvalFunction.applyReplacementCref
could not find replacement for mats[i].x

Attachments (2)

TestArrayRecords.mo (540 bytes) - added by casella 4 years ago.
TestArrayRecords.mos (202 bytes) - added by Karim.Abdelhak 4 years ago.

Download all attachments as: .zip

Change History (9)

Changed 4 years ago by casella

comment:1 Changed 4 years ago by casella

  • Cc alberto.leva@… added

Changed 4 years ago by Karim.Abdelhak

comment:2 follow-up: Changed 4 years ago by Karim.Abdelhak

I cannot reproduce the problem simulating attached .mos script. It runs fine under the current nightly, am i missing something?

true
""
true
""
true
""
record SimulationResult
    resultFile = "/home/kab/Repo/FH/promotion/modelicaLibs/NF/TestArrayRecords.Element_res.mat",
    simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'TestArrayRecords.Element', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
    messages = "LOG_SUCCESS       | info    | The initialization finished successfully without homotopy method.
LOG_SUCCESS       | info    | The simulation finished successfully.
",
    timeFrontend = 0.06924037000000001,
    timeBackend = 0.005097715,
    timeSimCode = 0.001241987,
    timeTemplates = 0.002963645,
    timeCompile = 0.473782734,
    timeSimulation = 0.012207977,
    timeTotal = 0.564635768
end SimulationResult;
""

comment:3 in reply to: ↑ 2 ; follow-up: Changed 4 years ago by perost

Replying to Karim.Abdelhak:

I cannot reproduce the problem simulating attached .mos script. It runs fine under the current nightly, am i missing something?

I'm assuming he's using -d=evaluateAllParameters as usual. I will fix it.

comment:4 in reply to: ↑ 3 Changed 4 years ago by Karim.Abdelhak

Replying to perost:

Replying to Karim.Abdelhak:

I cannot reproduce the problem simulating attached .mos script. It runs fine under the current nightly, am i missing something?

I'm assuming he's using -d=evaluateAllParameters as usual. I will fix it.

Yes that seems to be the case. Thanks!

comment:5 Changed 4 years ago by perost

Should be fixed in PR #729.

comment:6 Changed 4 years ago by perost

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

Fixed in b6a7efde.

comment:7 Changed 4 years ago by casella

For the record, I was using OMEdit v1.16.0-dev-170-g3af6123f8, and indeed I had the "Evaluate all parameters" checkbox checked.

Unless I really want to re-simulate a model with different parameters, it really makes no sense not to do it: the compilation process is faster, and the simulation process is faster and more numerically robust. Debugging could be a bit harder, because literal constants do not reveal their origin, but unless the model fails I don't really care.

Thanks @perost!

Note: See TracTickets for help on using tickets.