Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Error in Implementation of the delay function

Error in Implementation of the delay function

Greetings!
I hope you're having a nice day! So please hear me out. I am relatively an advanced beginner in OpenModelica and I am currently working on a project for my thesis. I need to use the delay function in my code for a Real variable. However, while the function works perfectly on one of the variables I need delayed, there are multiple variables that I need delayed. When I implement this for multiple variables with the same time delay constant, I get an error. If you could help me interpret and resolve this error, it would be greatly helpful.

Code:


error: 'equationIndexes' undeclared (first use in this function)
#define DIVISION_SIM(a,b,msg,equation) (__OMC_DIV_SIM(threadData, a, b, msg, equationIndexes, data->simulationInfo->noThrowDivZero, data->localData[0]->timeValue, initial()))

note: in expansion of macro 'DIVISION_SIM'
   storeDelayedExpression(data, threadData, 1, DIVISION_SIM(data->simulationInfo->realParameter[42] /* k4 PARAM */,data->localData[0]->realVars[67] /* v variable */,"v",equationIndexes), data->localData[0]->timeValue, data->simulationInfo->realParameter[78] /* tDelay PARAM */, data->simulationInfo->realParameter[78] /* tDelay PARAM */);

note: each undeclared identifier is reported only once for each function it appears in
#define DIVISION_SIM(a,b,msg,equation) (__OMC_DIV_SIM(threadData, a, b, msg, equationIndexes, data->simulationInfo->noThrowDivZero, data->localData[0]->timeValue, initial()))

note: in expansion of macro 'DIVISION_SIM'
   storeDelayedExpression(data, threadData, 1, DIVISION_SIM(data->simulationInfo->realParameter[42] /* k4 PARAM */,data->localData[0]->realVars[67] /* v variable */,"v",equationIndexes), data->localData[0]->timeValue, data->simulationInfo->realParameter[78] /* tDelay PARAM */, data->simulationInfo->realParameter[78] /* tDelay PARAM */);

Compilation process failed. Exited with code 2.

I'd be thankful for any help! Thanks in advance!

Re: Error in Implementation of the delay function

That looks like a pretty clear bug, please open a ticket on our bug tracker. If you can, please include a model that can be used to replicate the issue too.

Re: Error in Implementation of the delay function

Thank you so much for the immediate response! I have already opened a ticket there already and have posted the issue here as well. This is the link : https://trac.openmodelica.org/OpenModelica/ticket/6416

Edited by: gcharandas - Mar-10-21 13:31:07
There are 0 guests and 0 other users also viewing this topic
You are here: