Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#5835 closed defect (fixed)

Issue with NF and functions with arrays of records

Reported by: Francesco Casella Owned by: Per Östlund
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 Francesco Casella 5 years ago.
TestArrayRecords.mos (202 bytes ) - added by Karim Adbdelhak 5 years ago.

Download all attachments as: .zip

Change History (9)

by Francesco Casella, 5 years ago

Attachment: TestArrayRecords.mo added

comment:1 by Francesco Casella, 5 years ago

Cc: alberto.leva@… added

by Karim Adbdelhak, 5 years ago

Attachment: TestArrayRecords.mos added

comment:2 by Karim Adbdelhak, 5 years ago

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;
""

in reply to:  2 ; comment:3 by Per Östlund, 5 years ago

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.

in reply to:  3 comment:4 by Karim Adbdelhak, 5 years ago

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 by Per Östlund, 5 years ago

Should be fixed in PR #729.

comment:6 by Per Östlund, 5 years ago

Resolution: fixed
Status: newclosed

Fixed in b6a7efde.

comment:7 by Francesco Casella, 5 years ago

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.