- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Problem with derivative calculation
Problem with derivative calculation
Problem with derivative calculation
I have the piece of code:
Code:
Medium_F.AbsolutePressure p_flow[numberOfFlueSections, numberOfTubeSections + 1](start = p_startFlow);
...
for i in 1:numberOfFlueSections loop
for j in 1:numberOfTubeSections loop
...
C2[i, j] = deltaVFlow * drdp_flow[i, j] ;
...
p_flow[i, j + 1] = p_flow[i, j] - Dpfric[i, j];
...
stateFlow[i, j] = Medium_F.setState_ph(p_flow[i, j + 1], h_flow[i, j + 1]);
...
...
it is compiled and calculated normal.
But if I add to the code * der(p_flow[i, j + 1])
Code:
...
C2[i, j] = deltaVFlow * drdp_flow[i, j] * der(p_flow[i, j + 1]);
...
I have "Compilation process failed".
"C:\OpenModelica1.9.3\\MinGW\bin\mingw32-make.exe" -j4 -f MyHRSG.TestOnlyFlowHE.makefile
gcc -falign-functions -msse2 -mfpmath=sse -I"C:/OpenModelica1.9.3//include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -c -o MyHRSG.TestOnlyFlowHE.o MyHRSG.TestOnlyFlowHE.c
gcc -falign-functions -msse2 -mfpmath=sse -I"C:/OpenModelica1.9.3//include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -c -o MyHRSG.TestOnlyFlowHE_functions.o MyHRSG.TestOnlyFlowHE_functions.c
gcc -falign-functions -msse2 -mfpmath=sse -I"C:/OpenModelica1.9.3//include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -c -o MyHRSG.TestOnlyFlowHE_records.o MyHRSG.TestOnlyFlowHE_records.c
gcc -falign-functions -msse2 -mfpmath=sse -I"C:/OpenModelica1.9.3//include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -c -o MyHRSG.TestOnlyFlowHE_01exo.o MyHRSG.TestOnlyFlowHE_01exo.c
gcc -falign-functions -msse2 -mfpmath=sse -I"C:/OpenModelica1.9.3//include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -c -o MyHRSG.TestOnlyFlowHE_02nls.o MyHRSG.TestOnlyFlowHE_02nls.c
gcc -falign-functions -msse2 -mfpmath=sse -I"C:/OpenModelica1.9.3//include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -c -o MyHRSG.TestOnlyFlowHE_03lsy.o MyHRSG.TestOnlyFlowHE_03lsy.c
MyHRSG.TestOnlyFlowHE_03lsy.c: In function 'MyHRSG_TestOnlyFlowHE_initialLinearSystem':
MyHRSG.TestOnlyFlowHE_03lsy.c:167: error: 'MyHRSG_TestOnlyFlowHE_functionJacNLSJac7_column' undeclared (first use in this function)
MyHRSG.TestOnlyFlowHE_03lsy.c:167: error: (Each undeclared identifier is reported only once
MyHRSG.TestOnlyFlowHE_03lsy.c:167: error: for each function it appears in.)
MyHRSG.TestOnlyFlowHE_03lsy.c:168: error: 'MyHRSG_TestOnlyFlowHE_initialAnalyticJacobianNLSJac7' undeclared (first use in this function)
MyHRSG.TestOnlyFlowHE_03lsy.c:180: error: 'MyHRSG_TestOnlyFlowHE_functionJacNLSJac8_column' undeclared (first use in this function)
MyHRSG.TestOnlyFlowHE_03lsy.c:181: error: 'MyHRSG_TestOnlyFlowHE_initialAnalyticJacobianNLSJac8' undeclared (first use in this function)
mingw32-make: *** [MyHRSG.TestOnlyFlowHE_03lsy.o] Error 1
mingw32-make: *** Waiting for unfinished jobs....
Compilation process failed. Exited with code 2.
Why is this happening? Can I calculate the derivative without der()?
Re: Problem with derivative calculation
No, that is not possible. startTime/stopTime/numberOfIntervals only exist inside experiment annotation.
- lochel
- 45 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Problem with derivative calculation