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
  • Index
  • » Users
  • » gcharandas
  • » Profile

Posts

Posts

Apr-10-21 11:23:15
Unable to perform delay and take the difference of two signals

Hello,

I am trying to gain the difference between two consecutive samples in two signals which are out-of-phase with one another. However, the exact time points where the difference needs to be taken is unknown via equations or on paper. But if I try to look at these two signals graphically, I see these signals as a series of impulse signals which are out-of-phase with each other with zeros in between two consecutive impulse points. I need the difference of these consecutive impulse points. I have tried using delay function but it has been of no avail since I am unable to see the result I need. What would be the suggested approach for such a problem? If it were a programming language like MATLAB, I would've normally removed the zeros from both the signals, and simply subtracted the lower value signal from the higher value signal. How should I do the same in OpenModelica?

Mar-10-21 13:27:59
Multiple variable delay implementation failure
Category: Programming

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

Mar-10-21 13:15:06
Multiple variable delay implementation failure
Category: Programming

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!

  • Index
  • » Users
  • » gcharandas
  • » Profile
You are here: