- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Flattening error w/o details.
Flattening error w/o details.
Flattening error w/o details.
Hello!
A model of mine doesn't want to simulate - I get the message "Error occured while flattening model" without any further details. Using OMC's failtrace function gives a whole bunch of errors, but the output is kind of hard to read for someone who is not familiar with the internals of OMC.
My question is: How can I find the "root of all errors" in such a series of warnings/failures/errors?
Code:
/*- CevalScript.cevalGenerateFunctionDAEs failed( clear )*/
/*- CevalScript.cevalGenerateFunction failed(clear)*/
/*- CevalScript.cevalGenerateFunctionDAEs failed( loadFile )*/
/*- CevalScript.cevalGenerateFunction failed(loadFile)*/
/*- CevalScript.cevalGenerateFunctionDAEs failed( loadFile )*/
/*- CevalScript.cevalGenerateFunction failed(loadFile)*/
Error inserting class: OENORM_B8110_6 within: (within OIB_RL6;
) program:
Error inserting class: Tabellen within: (within OENORM_B8110_6;
) program:
Error inserting class: Gleichungen within: (within OENORM_B8110_6;
) program:
/*- CevalScript.cevalGenerateFunctionDAEs failed( loadFile )*/
/*- CevalScript.cevalGenerateFunction failed(loadFile)*/
Error inserting class: OENORM_H5056 within: (within OIB_RL6;
) program:
Error inserting class: Tabellen within: (within OENORM_H5056;
) program:
Error inserting class: Gleichungen within: (within OENORM_H5056;
) program:
/*- CevalScript.cevalGenerateFunctionDAEs failed( loadFile )*/
/*- CevalScript.cevalGenerateFunction failed(loadFile)*/
Error inserting class: DefaultProjekt within: (within OIB_RL6;
) program:
/*- CevalScript.cevalGenerateFunctionDAEs failed( loadModel )*/
/*- CevalScript.cevalGenerateFunction failed(loadModel)*/
/*- CevalScript.cevalGenerateFunctionDAEs failed( simulate )*/
/*- CevalScript.cevalGenerateFunction failed(simulate)*/
- Inst.instClassdef failed
class :OIB_RL6.Prototypen.Connector
- Inst.instClassdef failed
class :OIB_RL6.Prototypen.outputConnector
- Inst.instClass: outputConnector failed
- Inst.instVar2 failed: L_VhRLT.result(redeclare...)
Scope: OIB_RL6.Prototypen
- Inst.instVar failed while instatiating variable: L_VhRLT.result redeclare... in scope: OIB_RL6.Prototypen
- Inst.updateComponentInEnv failed, ident = result
mods: {result(redeclare(COMPONENT(result in/out: mod: tp: OIB_RL6.Schnittstellen.outputConnectorLeitwert var :VAR)))}
scope: OIB_RL6.OENORM_B8110_6.Gleichungen.'(34) L_VRLT'
- Inst.instClass: Real failed
- Inst.instVar2 failed: L_VhRLT.result.value(redeclare...)
Scope: <global scope>
- Inst.instVar failed while instatiating variable: L_VhRLT.result.value redeclare... in scope: <global scope>
- Inst.updateComponentInEnv failed, ident = value
mods: {value(redeclare(COMPONENT(value in/out: mod: tp: Modelica.SIunits.ThermalConductance var :VAR)))}
scope: OIB_RL6.Schnittstellen.outputConnectorLeitwert
- Inst.instClass: Real failed
- Inst.instVar2 failed: L_VhRLT.v_mech.value(redeclare...)
Scope: <global scope>
- Inst.instVar failed while instatiating variable: L_VhRLT.v_mech.value redeclare... in scope: <global scope>
- Inst.updateComponentInEnv failed, ident = value
mods: {value(redeclare(COMPONENT(value in/out: mod: tp: VolumeFlowRate_hourly var :VAR)))}
scope: OIB_RL6.Schnittstellen.inputConnectorVolumenstrom
- Inst.instClassdef failed
class :OIB_RL6.Prototypen.Connector
- Inst.instClassdef failed
class :OIB_RL6.Prototypen.outputConnector
- Inst.instClass: outputConnector failed
- Inst.instVar2 failed: L_VcRLT.result(redeclare...)
Scope: OIB_RL6.Prototypen
- Inst.instVar failed while instatiating variable: L_VcRLT.result redeclare... in scope: OIB_RL6.Prototypen
- Inst.updateComponentInEnv failed, ident = result
mods: {result(redeclare(COMPONENT(result in/out: mod: tp: OIB_RL6.Schnittstellen.outputConnectorLeitwert var :VAR)))}
scope: OIB_RL6.OENORM_B8110_6.Gleichungen.'(34) L_VRLT'
- Inst.instClass: Real failed
- Inst.instVar2 failed: L_VcRLT.result.value(redeclare...)
Scope: <global scope>
- Inst.instVar failed while instatiating variable: L_VcRLT.result.value redeclare... in scope: <global scope>
- Inst.updateComponentInEnv failed, ident = value
mods: {value(redeclare(COMPONENT(value in/out: mod: tp: Modelica.SIunits.ThermalConductance var :VAR)))}
scope: OIB_RL6.Schnittstellen.outputConnectorLeitwert
- Inst.instClass: Real failed
- Inst.instVar2 failed: L_VcRLT.v_mech.value(redeclare...)
Scope: <global scope>
- Inst.instVar failed while instatiating variable: L_VcRLT.v_mech.value redeclare... in scope: <global scope>
- Inst.updateComponentInEnv failed, ident = value
mods: {value(redeclare(COMPONENT(value in/out: mod: tp: VolumeFlowRate_hourly var :VAR)))}
scope: OIB_RL6.Schnittstellen.inputConnectorVolumenstrom
- Inst.instClassdef failed
class :OIB_RL6.Prototypen.Connector
- Inst.instClassdef failed
class :OIB_RL6.Prototypen.outputConnector
- Inst.instClass: outputConnector failed
- Inst.instVar2 failed: V_V.result(redeclare...)
Scope: OIB_RL6.Prototypen
- Inst.instVar failed while instatiating variable: V_V.result redeclare... in scope: OIB_RL6.Prototypen
- Inst.updateComponentInEnv failed, ident = result
mods: {result(redeclare(COMPONENT(result in/out: mod: tp: OIB_RL6.Schnittstellen.outputConnectorVolumen var :VAR)))}
scope: OIB_RL6.OENORM_B8110_6.Gleichungen.'(23) V_V'
- Inst.instClass: Real failed
- Inst.instVar2 failed: V_V.result.value(redeclare...)
Scope: <global scope>
- Inst.instVar failed while instatiating variable: V_V.result.value redeclare... in scope: <global scope>
- Inst.updateComponentInEnv failed, ident = value
mods: {value(redeclare(COMPONENT(value in/out: mod: tp: Modelica.SIunits.Volume var :VAR)))}
scope: OIB_RL6.Schnittstellen.outputConnectorVolumen
- Inst.instClassdef failed
class :OIB_RL6.Prototypen.Connector
- Inst.instClassdef failed
class :OIB_RL6.Prototypen.outputConnector
- Inst.instClass: outputConnector failed
- Inst.instVar2 failed: v_mech.result(redeclare...)
Scope: OIB_RL6.Prototypen
- Inst.instVar failed while instatiating variable: v_mech.result redeclare... in scope: OIB_RL6.Prototypen
- Inst.updateComponentInEnv failed, ident = result
mods: {result(redeclare(COMPONENT(result in/out: mod: tp: OIB_RL6.Schnittstellen.outputConnectorVolumenstrom var :VAR)))}
scope: OIB_RL6.OENORM_B8110_6.Gleichungen.'(35) v_mech'
- Inst.instClass: Real failed
- Inst.instVar2 failed: v_mech.result.value(redeclare...)
Scope: <global scope>
- Inst.instVar failed while instatiating variable: v_mech.result.value redeclare... in scope: <global scope>
- Inst.updateComponentInEnv failed, ident = value
mods: {value(redeclare(COMPONENT(value in/out: mod: tp: VolumeFlowRate_hourly var :VAR)))}
scope: OIB_RL6.Schnittstellen.outputConnectorVolumenstrom
- Inst.instClass: Real failed
- Inst.instVar2 failed: v_mech.V_V.value(redeclare...)
Scope: <global scope>
- Inst.instVar failed while instatiating variable: v_mech.V_V.value redeclare... in scope: <global scope>
- Inst.updateComponentInEnv failed, ident = value
mods: {value(redeclare(COMPONENT(value in/out: mod: tp: Modelica.SIunits.Volume var :VAR)))}
scope: OIB_RL6.Schnittstellen.inputConnectorVolumen
- Inst.instClass: Real failed
- Inst.instVar2 failed: v_mech.n_LRLT.value(redeclare...)
Scope: <global scope>
- Inst.instVar failed while instatiating variable: v_mech.n_LRLT.value redeclare... in scope: <global scope>
- Inst.updateComponentInEnv failed, ident = value
mods: {value(redeclare(COMPONENT(value in/out: mod: tp: perHour var :VAR)))}
scope: OIB_RL6.Schnittstellen.inputConnectorStundenrate
- Inst.instClassdef failed
class :OIB_RL6.Prototypen.Connector
- Inst.instClassdef failed
class :OIB_RL6.Prototypen.inputConnector
- Inst.instClass: inputConnector failed
- Inst.instVar2 failed: n_LRLT.in_x(redeclare...)
Scope: OIB_RL6.Prototypen
- Inst.instVar failed while instatiating variable: n_LRLT.in_x redeclare... in scope: OIB_RL6.Prototypen
- Inst.updateComponentInEnv failed, ident = in_x
mods: {in_x(redeclare(COMPONENT(in_x in/out: mod: tp: OIB_RL6.Schnittstellen.inputConnectorInteger var :VAR)))}
scope: OIB_RL6.OENORM_B8110_5.Tabellen.Tabelle_2
- Inst.instClassdef failed
class :OIB_RL6.Prototypen.Connector
- Inst.instClassdef failed
class :OIB_RL6.Prototypen.inputConnector
- Inst.instClass: inputConnector failed
- Inst.instVar2 failed: n_LRLT.in_y(redeclare...)
Scope: OIB_RL6.Prototypen
- Inst.instVar failed while instatiating variable: n_LRLT.in_y redeclare... in scope: OIB_RL6.Prototypen
- Inst.updateComponentInEnv failed, ident = in_y
mods: {in_y(redeclare(COMPONENT(in_y in/out: mod: tp: OIB_RL6.Schnittstellen.inputConnectorInteger var :VAR)))}
scope: OIB_RL6.OENORM_B8110_5.Tabellen.Tabelle_2
- Inst.instClass: Real failed
- Inst.instVar2 failed: n_LRLT.in_x.value(redeclare...)
Scope: <global scope>
- Inst.instVar failed while instatiating variable: n_LRLT.in_x.value redeclare... in scope: <global scope>
- Inst.updateComponentInEnv failed, ident = value
mods: {value(redeclare(COMPONENT(value in/out: mod: tp: Integer var :VAR)))}
scope: OIB_RL6.Schnittstellen.inputConnectorInteger
- Inst.instClass: Real failed
- Inst.instVar2 failed: n_LRLT.in_y.value(redeclare...)
Scope: <global scope>
- Inst.instVar failed while instatiating variable: n_LRLT.in_y.value redeclare... in scope: <global scope>
- Inst.updateComponentInEnv failed, ident = value
mods: {value(redeclare(COMPONENT(value in/out: mod: tp: Integer var :VAR)))}
scope: OIB_RL6.Schnittstellen.inputConnectorInteger
- Static.makeASUBArrayAdressing2 failed for INDEX(in_y.value)
- Static.makeASUBArrayAdressing2 failed for INDEX(in_y.value)
- Inst.instClassdef failed
class :OIB_RL6.Prototypen.Connector
- Inst.instClassdef failed
class :OIB_RL6.Prototypen.outputConnector
- Inst.instClass: outputConnector failed
- Inst.instVar2 failed: eta_Vgesh.result(redeclare...)
Scope: OIB_RL6.Prototypen
- Inst.instVar failed while instatiating variable: eta_Vgesh.result redeclare... in scope: OIB_RL6.Prototypen
- Inst.updateComponentInEnv failed, ident = result
mods: {result(redeclare(COMPONENT(result in/out: mod: tp: OIB_RL6.Schnittstellen.outputConnectorEinheitslos var :VAR)))}
scope: OIB_RL6.OENORM_B8110_6.Gleichungen.'(36) eta_Vges'
- Inst.instClassdef failed
class :OIB_RL6.Prototypen.Connector
- Inst.instClassdef failed
class :OIB_RL6.Prototypen.outputConnector
- Inst.instClass: outputConnector failed
- Inst.instVar2 failed: eta_Vgesc.result(redeclare...)
Scope: OIB_RL6.Prototypen
- Inst.instVar failed while instatiating variable: eta_Vgesc.result redeclare... in scope: OIB_RL6.Prototypen
- Inst.updateComponentInEnv failed, ident = result
mods: {result(redeclare(COMPONENT(result in/out: mod: tp: OIB_RL6.Schnittstellen.outputConnectorEinheitslos var :VAR)))}
scope: OIB_RL6.OENORM_B8110_6.Gleichungen.'(36) eta_Vges'
- Inst.updateComponentInEnv failed, ident = header_x
mods: {header_x(redeclare( finalCOMPONENT(header_x in/out: mod: = 1:2 tp: Real var :CONST)))}
scope: OIB_RL6.OENORM_B8110_6.Tabellen.Tab_14
- Inst.updateComponentInEnv failed, ident = header_y
mods: {header_y(redeclare( finalCOMPONENT(header_y in/out: mod: = 1:6 tp: Real var :CONST)))}
scope: OIB_RL6.OENORM_B8110_6.Tabellen.Tab_14
- Inst.updateComponentInEnv failed, ident = tableData
mods: {tableData(redeclare( finalCOMPONENT(tableData in/out: mod: = {{0.5, -0},{0.65, -0},{0.4, -0},{0.7, -0},{0.7, -0},{0.7,0.7}} tp: Real var :CONST)))}
scope: OIB_RL6.OENORM_B8110_6.Tabellen.Tab_14
- Inst.instClassdef failed
class :OIB_RL6.Prototypen.Connector
- Inst.instClassdef failed
class :OIB_RL6.Prototypen.outputConnector
- Inst.instClass: outputConnector failed
- Inst.instVar2 failed: Phi_WRGh.out(redeclare...)
Scope: OIB_RL6.Prototypen
- Inst.instVar failed while instatiating variable: Phi_WRGh.out redeclare... in scope: OIB_RL6.Prototypen
- Inst.updateComponentInEnv failed, ident = out
mods: {out(redeclare(COMPONENT(out in/out: mod: tp: OIB_RL6.Prototypen.outputConnectorEinheitslos var :VAR)))}
scope: OIB_RL6.OENORM_B8110_6.Tabellen.Tab_14
- Inst.instElement failed: COMPONENT(out in/out: mod: tp: OIB_RL6.Prototypen.outputConnector var :VAR)
Scope: OIB_RL6.OENORM_B8110_6.Tabellen.Tab_14
- Inst.instClassdef failed
class :OIB_RL6.OENORM_B8110_6.Tabellen.Tab_14
- Inst.instClass: Tab_14 failed
- Inst.instVar2 failed: <Prefix.NOPRE()>.Phi_WRGh()
Scope: OIB_RL6.OENORM_B8110_6.Tabellen
- Inst.instVar failed while instatiating variable: Phi_WRGh in scope: OIB_RL6.OENORM_B8110_6.Tabellen
- Inst.instElement failed: COMPONENT(Phi_WRGh in/out: mod: tp: OIB_RL6.OENORM_B8110_6.Tabellen.Tab_14 var :VAR)
Scope: OIB_RL6.OENORM_B8110_6.LV_NWG_RLT
- Inst.instClassdef failed
class :OIB_RL6.OENORM_B8110_6.LV_NWG_RLT
- Inst.instClass: LV_NWG_RLT failed
Any hints are appreciated.
Regards
Hannes
PS: Sorry for copy-pasting endless OMC outputs into the text, but uploading files onto the server via the attachments-function doesn't work for me any longer.
- edes
- 38 Posts
Re: Flattening error w/o details.
I've basically got the same problem.
I've written a piece of code that seems to check out ok, but once I try to run it through simulate (NameHere) I get an answer that sadly isn't as exhaustive as I'd might had wished for:
record SimulationResult
resultFile = "Simulation failed.
Error: Error occured while flattening model NameHere
"
end SimulationResult;
I'm guessing that there isn't much to hope for, else than a better error output in the future?
Re: Flattening error w/o details.
Right, I wouldn't hope for too much either - especially not, if you work on a timeline. The true problem is, that 1.5 final in fact is somthing which normally would be labeled as an early beta release. Maybe it will work better in half a year, maybe in a year, maybe never... who knows.
If you work with Modelica professionally, you could consider commercial environments - They are not cheap, but it pays off. Just my opinion...
- edes
- 38 Posts
Re: Flattening error w/o details.
Hi,
Well, it takes a while for open-source to reach the state of a commercial software.
I do agree with you that things could be much better, but it takes time to get there.
Unfortunately, looking at your log and not knowing anything about the structure of your model, I can only guess what the problems might be:
- possible wrong within statements (meaning that NNN does not exists and you use it: within NNN;)
- a lot of redeclares which we don't handle very well
- quoted identifiers might be an issue (I have to check if we escape them somehow before we reach C code)
I know that posting your models is not possible if they are private, but any kind of public model that has some error would help.
Alternatives are (if you can) to send models privately to me (or any of our developers) via e-mail [Adrian.Pop@liu.se] and then I
can check what the problems are.
We changed a bit our development strategy lately.
We're now not adding any new functionality, but we focus to fix problems to be able to flatten
as much as possible from Modelica Standard Library 3.1 (which mostly works except Media & Fluid).
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
Re: Flattening error w/o details.
Dear all,
I got the same problem when i use the digital lib in Electrical simulation.
the model is as follows:
model jktest
annotation(Diagram(coordinateSystem(extent = {{ -100, -100},{100,100}})));
annotation(uses(Modelica(version = "3.1")), Diagram(graphics));
Modelica.Electrical.Digital.Examples.Utilities.JKFF jKFF annotation(Placement(transformation(origin = { -36.0,44.0}, extent = {{ -46.0,34.0},{ -26.0,54.0}}), iconTransformation(origin = { -36.0,44.0}, extent = {{ -46.0,34.0},{ -26.0,54.0}})));
Modelica.Electrical.Digital.Sources.Set set(x = Modelica.Electrical.Digital.Interfaces.Logic.'1') annotation(Placement(transformation(origin = { -96.0,50.0}, extent = {{ -106.0,40.0},{ -86.0,60.0}}), iconTransformation(origin = { -96.0,50.0}, extent = {{ -106.0,40.0},{ -86.0,60.0}})));
Modelica.Electrical.Digital.Sources.Clock clock(period = 0.4) annotation(Placement(transformation(origin = { -96.0,20.0}, extent = {{ -106.0,10.0},{ -86.0,30.0}}), iconTransformation(origin = { -96.0,20.0}, extent = {{ -106.0,10.0},{ -86.0,30.0}})));
equation
connect(jKFF.j,set.y) annotation(Line(points = {{ -46.0,51.0},{ -70.0,51.0},{ -70.0,50.0},{ -86.0,50.0}}, color = {127,0,127}));
connect(jKFF.k,set.y) annotation(Line(points = {{ -46.0,37.0},{ -70.0,37.0},{ -70.0,50.0},{ -86.0,50.0}}, color = {127,0,127}));
connect(clock.y,jKFF.clk) annotation(Line(points = {{ -86.0,20.0},{ -68.0,20.0},{ -68.0,44.0},{ -46.0,44.0}}, color = {127,0,127}));
end jktest;
>> checkModel(jktest)
>> "Error: Error occured while flattening model jktest
"
>> instantiateModel(jktest)
>> "# Restriction violation: #getStateName failed# is not a CONNECTOR
# Restriction violation: #getStateName failed# is not a CONNECTOR
- Inst.instClassdef failed
class :Modelica.Electrical.Digital.Interfaces.DigitalSignal
- Inst.instClassdef failed
class :Modelica.Electrical.Digital.Interfaces.DigitalInput
- Inst.instClass: DigitalInput failed
- Inst.instVar2 failed: jKFF.j()
Scope: Modelica.Electrical.Digital.Interfaces
- Inst.instVar failed while instatiating variable: jKFF.j in scope: Modelica.Electrical.Digital.Interfaces
- Inst.instElement failed: COMPONENT(j in/out: mod: tp: D.Interfaces.DigitalInput var :VAR)
Scope: Modelica.Electrical.Digital.Examples.Utilities.JKFF
- Inst.instClassdef failed
class :Modelica.Electrical.Digital.Examples.Utilities.JKFF
- Inst.instClass: JKFF failed
- Inst.instVar2 failed: <Prefix.NOPRE()>.jKFF()
Scope: Modelica.Electrical.Digital.Examples.Utilities
- Inst.instVar failed while instatiating variable: jKFF in scope: Modelica.Electrical.Digital.Examples.Utilities
- Inst.instElement failed: COMPONENT(jKFF in/out: mod: tp: Modelica.Electrical.Digital.Examples.Utilities.JKFF var :VAR)
Scope: jktest
- Inst.instClassdef failed
class :jktest
- Inst.instClass: jktest failed
Inst.instClassInProgram failed
/*- CevalScript.cevalGenerateFunctionDAEs failed( instantiateModel )*/
/*- CevalScript.cevalGenerateFunction failed(instantiateModel)*/
# Restriction violation: #getStateName failed# is not a CONNECTOR
# Restriction violation: #getStateName failed# is not a CONNECTOR
- Inst.instClassdef failed
class :Modelica.Electrical.Digital.Interfaces.DigitalSignal
- Inst.instClassdef failed
class :Modelica.Electrical.Digital.Interfaces.DigitalInput
- Inst.instClass: DigitalInput failed
- Inst.instVar2 failed: jKFF.j()
Scope: Modelica.Electrical.Digital.Interfaces
- Inst.instVar failed while instatiating variable: jKFF.j in scope: Modelica.Electrical.Digital.Interfaces
- Inst.instElement failed: COMPONENT(j in/out: mod: tp: D.Interfaces.DigitalInput var :VAR)
Scope: Modelica.Electrical.Digital.Examples.Utilities.JKFF
- Inst.instClassdef failed
class :Modelica.Electrical.Digital.Examples.Utilities.JKFF
- Inst.instClass: JKFF failed
- Inst.instVar2 failed: <Prefix.NOPRE()>.jKFF()
Scope: Modelica.Electrical.Digital.Examples.Utilities
- Inst.instVar failed while instatiating variable: jKFF in scope: Modelica.Electrical.Digital.Examples.Utilities
- Inst.instElement failed: COMPONENT(jKFF in/out: mod: tp: Modelica.Electrical.Digital.Examples.Utilities.JKFF var :VAR)
Scope: jktest
- Inst.instClassdef failed
class :jktest
- Inst.instClass: jktest failed
Inst.instClassInProgram failed
"
Re: Flattening error w/o details.
Error: Too few equations, underdetermined system. The model has 4 equation(s) and 12 variable(s)
It flattens without errors using:
$ OPENMODELICAHOME=/usr OPENMODELICALIBRARY=/home/marsj/dev/sjoelund-functiontree/libraries/msl31/ omc a.mo Modelica
What version of OpenModelica are you using? Per recently made some fixes regarding the Digital examples.
- sjoelund.se
- 1700 Posts
Re: Flattening error w/o details.
Hi,
Try the new nightly-build:
http://build.openmodelica.org/omc/builds/windows/
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
Re: Flattening error w/o details.
sjoelund.se wrote:
Error: Too few equations, underdetermined system. The model has 4 equation(s) and 12 variable(s)
It flattens without errors using:
$ OPENMODELICAHOME=/usr OPENMODELICALIBRARY=/home/marsj/dev/sjoelund-functiontree/libraries/msl31/ omc a.mo Modelica
What version of OpenModelica are you using? Per recently made some fixes regarding the Digital examples.
Thank you, sjoelund and Adrian !
I got the error now as sjoelund shows after installing the OpenModelica-revision-6464.msi.
But I could simulate the same model in Demola 7.0 which gave the right result, what can i do in OpenModelica?
Re: Flattening error w/o details.
It seems we have a bug in the back-end with equations - variables matching, most likely with array[array] indexing.
I added a bug report about it here, so our back-end experts can fix it:
https://openmodelica.org:8443/cb/issue/1329
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
Re: Flattening error w/o details.
Thank you for your hard work last month, last error has been away.
Here comes another problem with this model by using OpenModelica-revision-6881.msi today.
here are the logs, It seems no "ERROR" defined before.
Thank you.
<jtest.log>
g++ -I"C:\OpenModelica1.5.1/include/omc" -msse2 -mfpmath=sse -I. -o jktest.exe jktest.cpp -L"D:/omc/testjk/Modelica" -lsim -L"C:\OpenModelica1.5.1/lib/omc" -lc_runtime -lf2c -linteractive -lsendData -lQtNetwork-mingw -lQtCore-mingw -lQtGui-mingw -luuid -lole32 -lws2_32
jktest.cpp: In function `int functionDAE_output()':
jktest.cpp:1143: error: `ERROR' was not declared in this scope
jktest.cpp:1143: error: expected `;' before "tmp30"
jktest.cpp:1147: warning: converting to `modelica_integer' from `double'
jktest.cpp:1149: error: `$PD$PTables$PNotTable' was not declared in this scope
jktest.cpp:1150: warning: converting to `modelica_integer' from `double'
jktest.cpp:1152: error: `$PD$PTables$PAndTable' was not declared in this scope
jktest.cpp:1152: error: cannot convert `double*' to `integer_array_t*' for argument `1' to `modelica_integer integer_get(integer_array_t*, size_t)'
jktest.cpp:1152: error: cannot convert `double*' to `integer_array_t*' for argument `1' to `modelica_integer integer_get(integer_array_t*, size_t)'
jktest.cpp:1152: error: cannot convert `double*' to `integer_array_t*' for argument `1' to `modelica_integer integer_get(integer_array_t*, size_t)'
jktest.cpp:1152: error: cannot convert `double*' to `integer_array_t*' for argument `1' to `modelica_integer integer_get(integer_array_t*, size_t)'
jktest.cpp:1153: warning: converting to `modelica_integer' from `double'
jktest.cpp:1155: error: cannot convert `double*' to `integer_array_t*' for argument `1' to `modelica_integer integer_get(integer_array_t*, size_t)'
...
<jktest.cpp>
from line 1141
modelica_boolean tmp28;
modelica_boolean tmp29;
expTypeFromExpFlag:ERROR tmp30;
mem_state = get_memory_state();
$Pclock$Pt_width = (($Pclock$Pperiod * $Pclock$Pwidth) / 100.0);
tmp0 = pre($PjKFF$PNot1$Pauxiliary);
$PjKFF$PNot1$Py = tmp0;
$PjKFF$PNot1$Pauxiliary = (*integer_array_element_addr(&(*integer_array_element_addr(&$PD$PTables$PNotTable, 1, $PjKFF$PNot1$Px)), 1, $PjKFF$PNot1$Px));
tmp1 = pre($PjKFF$PAnd4$Pauxiliary$lB2$rB);
$PjKFF$PRS1$Pr = tmp1;
$PjKFF$PAnd4$Pauxiliary$lB2$rB = (*integer_array_element_addr(&(*integer_array_element_addr(&$PD$PTables$PAndTable, 2, integer_get(&$PjKFF$PAnd4$Pauxiliary, 0), integer_get(&$PjKFF$PAnd4$Px, 1))), 2, integer_get(&$PjKFF$PAnd4$Pauxiliary, 0), integer_get(&$PjKFF$PAnd4$Px, 1)));
tmp2 = pre($PjKFF$PAnd3$Pauxiliary$lB2$rB);
$PjKFF$PRS1$Ps = tmp2;
$PjKFF$PAnd3$Pauxiliary$lB2$rB = (*integer_array_element_addr(&(*integer_array_element_addr(&$PD$PTables$PAndTable, 2, integer_get(&$PjKFF$PAnd3$Pauxiliary, 0), integer_get(&$PjKFF$PAnd3$Px, 1))), 2, integer_get(&$PjKFF$PAnd3$Pauxiliary, 0), integer_get(&$PjKFF$PAnd3$Px, 1)));
tmp3 = pre($PjKFF$PAnd2$Pauxiliary$lB3$rB);
$PjKFF$PRS2$Pr = tmp3;
$PjKFF$PAnd2$Pauxiliary$lB3$rB = (*integer_array_element_addr(&(*integer_array_element_addr(&$PD$PTables$PAndTable, 2, integer_get(&$PjKFF$PAnd2$Pauxiliary, 1), integer_get(&$PjKFF$PAnd2$Px, 2))), 2, integer_get(&$PjKFF$PAnd2$Pauxiliary, 1), integer_get(&$PjKFF$PAnd2$Px, 2)));
$PjKFF$PAnd2$Pauxiliary$lB2$rB = (*integer_array_element_addr(&(*integer_array_element_addr(&$PD$PTables$PAndTable, 2, integer_get(&$PjKFF$PAnd2$Pauxiliary, 0), integer_get(&$PjKFF$PAnd2$Px, 1))), 2, integer_get(&$PjKFF$PAnd2$Pauxiliary, 0), integer_get(&$PjKFF$PAnd2$Px, 1)));
tmp4 = pre($PjKFF$PAnd1$Pauxiliary$lB3$rB);
$PjKFF$PRS2$Ps = tmp4;
$PjKFF$PAnd1$Pauxiliary$lB3$rB = (*integer_array_element_addr(&(*integer_array_element_addr(&$PD$PTables$PAndTable, 2, integer_get(&$PjKFF$PAnd1$Pauxiliary, 1), integer_get(&$PjKFF$PAnd1$Px, 2))), 2, integer_get(&$PjKFF$PAnd1$Pauxiliary, 1), integer_get(&$PjKFF$PAnd1$Px, 2)));
$PjKFF$PAnd1$Pauxiliary$lB2$rB = (*integer_array_element_addr(&(*integer_array_element_addr(&$PD$PTables$PAndTable, 2, integer_get(&$PjKFF$PAnd1$Pauxiliary, 0), integer_get(&$PjKFF$PAnd1$Px, 1))), 2, integer_get(&$PjKFF$PAnd1$Pauxiliary, 0), integer_get(&$PjKFF$PAnd1$Px, 1)));
tmp5 = pre((*integer_array_element_addr(&(*integer_array_element_addr(&$PD$PTables$PNotTable, 1, integer_get(&$PjKFF$PRS2$PNor2$Pauxiliary, 1))), 1, integer_get(&$PjKFF$PRS2$PNor2$Pauxiliary, 1))));
$PjKFF$PRS2$Pq = tmp5;
Re: Flattening error w/o details.
It seems this is a code generation problem for enumerations (clock.y has type Logic = enumeration(
'U' "U Uninitialized",
'X' "X Forcing Unknown",
'0' "0 Forcing 0",
'1' "1 Forcing 1",
'Z' "Z High Impedance",
'W' "W Weak Unknown",
'L' "L Weak 0",
'H' "H Weak 1",
'-' "- Don't care")).
- sjoelund.se
- 1700 Posts
Re: Flattening error w/o details.
There seems to be some other issues as well... import D = Modelica.Electrical.Digital; seems to leave some constants as D.xxx.yyy.zzz in the generated code.
- sjoelund.se
- 1700 Posts
Re: Flattening error w/o details.
hi sir i am new at hare sir i am try to make the model of Rankine cycle but these are error's.
[:0:0-0:0] Error: Error occurred while flattening model plaanti
[C:\OpenModelica1.9.1Beta2\lib\omlibrary\Modelica 3.2.1\Media\package.mo:4380:17-4505:25] Error: Illegal to instantiate partial class BaseProperties.
[:0:0-0:0] Notification: Instantiation of plaanti failed.
kindly help me
.
Re: Flattening error w/o details.
Hello to all,
I'm having a "flattening" problem with no hints from the Modelica compiler when I try to simulate my model. It's actually a model I got out of a presentation, and I was just trying it out. I found a couple of problems and fixed them (related to the math), but I still get this "flattening" error. I've tried all sorts of simplifications, one by one, to see if anything would get me around this problem, but no luck, and Modelica just seems to be sitting there like the Cheshire cat. Here's the model:
block StateSpace
parameter Real A[:, :];
parameter Real B[size(A,1), :];
parameter Real C[:, size(A,2)];
parameter Real D[size(C,1), size(B,2)] = zeros(size(C,1), size(B,2));
input Real u[size(B,2)];
output Real y[size(C,1)];
protected
Real x[size(A,2)];
equation
assert( size(A,1) == size (A,2), "Matrix A must be square.");
der(x) = A*x + B*u;
y = C*x + D*u;
end StateSpace;
block TestSS
StateSpace S(A=[1,2; 3,4], B=[0;1], C=[1,1]);
equation
S.u = sin(time);
end TestSS;
Here's the result of simulate(StateSpace, stopTime=5):
>> simulate(StateSpace, stopTime=5)
record SimulationResult
resultFile = "",
simulationOptions = "startTime = 0.0, stopTime = 5.0, numberOfIntervals = 500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'StateSpace', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
messages = "Failed to build model: StateSpace",
timeFrontend = 0.0,
timeBackend = 0.0,
timeSimCode = 0.0,
timeTemplates = 0.0,
timeCompile = 0.0,
timeSimulation = 0.0,
timeTotal = 0.0
end SimulationResult;
Error: Error occurred while flattening model StateSpace
I'm using OMShell 1.1 conected to OpenModelica v1.9.6.
Any help would be appreciated.
Thanks, AlphaOmega
Re: Flattening error w/o details.
I guess it is due to the model having : as dimensions.
- sjoelund.se
- 1700 Posts
Re: Flattening error w/o details.
Hi...as per my knowledge the true problem is, that 1.5 final in fact is somthing which normally would be labeled as an early beta release. Maybe it will work better in half a year, maybe in a year, maybe never.If you work with Modelica professionally, you could consider commercial environments - They are not cheap, but it pays off.
turnkey pcb assembly
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Flattening error w/o details.