Opened 8 years ago
Closed 7 years ago
#4373 closed defect (fixed)
differentiation module cannot handle non-constant subscripts
Reported by: | Owned by: | Willi Braun | |
---|---|---|---|
Priority: | high | Milestone: | 1.13.0 |
Component: | Backend | Version: | v1.11.0 |
Keywords: | pre() | Cc: | Willi Braun, Jan Silar |
Description
My name is Vadiraj Patil, I am a student from Chalmers University of Technology. I am currently doing my master thesis related modeling vehicles using modelica.
I am currently developing vehicle models using Modelica on Dymola and OpenModelica. The models mostly contain ODE which are general force and moment balance. So far, I have built my models in Dymola and they seem to be working fine. I want my models to be open-source such that these models are available to the public and they can use to conduct vehicle dynamics simulations.
There are two packages attached with the ticket: Version_openmodelica which can be simulated in both the tools while the package Version_dymola can only be simulated in modelica. When I simulate the package Version_dymola on OpenModelica I get the following errors:
[5] 17:06:32 Symbolic Error
[C:/OM111/OpenModelica64bit/OMCompiler/Compiler/BackEnd/Differentiate.mo: 387:3-387:155]: Derivative of expression "vehicle.trans.w_engine / vehicle.trans.i_tm[vehicle.trans.agear] = vehicle.trans.w_p" w.r.t. "time" is non-existent.
[6] 17:06:32 Translation Error
[Version_dymola: 390:7-390:28]: Internal error
Differentiate.differentiateEquationTime failed for vehicle.trans.w_engine / vehicle.trans.i_tm[vehicle.trans.agear] = vehicle.trans.w_p
[7] 17:06:32 Translation Error
Internal error - IndexReduction.pantelidesIndexReduction1 failed! Use -d=bltdump to get more information.
[8] 17:06:32 Translation Error
Internal error - IndexReduction.pantelidesIndexReduction failed!
[9] 17:06:32 Translation Error
Internal error Transformation Module PFPlusExt index Reduction Method Pantelides failed!
From the errors and the code, I presume that OpenModelica is unable to handle the pre() operator and differentiation. I am using the pre() operator in my gear-shifting logic in the transmission. Most of the code is same in both the files the only difference is as follows
The file Version_dymola contains the following extra lines of code under the package Driveline under the model transmission_modular
i_T = i_final * i_tm[agear];
when Vx > upshift[pre(agear)] then
agear = pre(agear)+1;
elsewhen Vx < downshift[pre(agear)] then
agear = pre(agear)-1;
end when;
The idea behind the above lines of code is to shift a gear up when the vehicle velocity Vx increase certain velocity values which are stored in the array upshift[ ] and downshift[ ].If I remove the above lines of code and assume that the vehicle does not make any gear shifts then the rest of the code can be simulated in OpednModelica as well which is seen in the file Version_openmodelica.
https://www.dropbox.com/sh/cs5lj5bgb89e9ep/AAC1ZTuvrgEgQJY_Q1BEo7yQa?dl=0
Attachments (2)
Change History (7)
by , 8 years ago
Attachment: | Version_dymola.mo added |
---|
by , 8 years ago
Attachment: | Version_openmodelica.mo added |
---|
comment:1 by , 8 years ago
Component: | OMEdit → Backend |
---|---|
Owner: | changed from | to
Status: | new → assigned |
follow-up: 3 comment:2 by , 8 years ago
comment:3 by , 8 years ago
Replying to lochel:
I guess this isn't connected to the pre-operator but to differentiation of array elements.
Now I've verified it and the issue is indeed that the differentiation module cannot handle non-constant subscripts.
comment:4 by , 8 years ago
Summary: | Error using pre() and differentiation → differentiation module cannot handle non-constant subscripts |
---|
comment:5 by , 7 years ago
Milestone: | Future → 1.13.0 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
The attached model works for me, so I marked it as fixed in the meanwhile.
I guess this isn't connected to the pre-operator but to differentiation of array elements.