- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Error when requiring derivative of...
Error when requiring derivative of function mod()
Error when requiring derivative of function mod()
Hi,
I have an equation set where the derivative of a variable is computed which contains a modulo function.
test program:
model modtest
Real f,x,y;
equation
x = sin(time);
y = mod(x,3.14);
f = der(y);
annotation(Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2})), Diagram(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2})));
end modtest;
I am getting the error message:
Error: Internal error
Differentiate.differentiateEquationTime failed for y = mod(x, 3.14)
I use Openmodelica 1.9.1 beta2.
Is this a known error and can I circumvent it anyhow?
Regards,
Horst
Re: Error when requiring derivative of function mod()
Well, the modulo function is a discrete function that even triggers events when the output changes. Since it is not a continuous function, you can not take the derivative of such a signal. Use der(x) instead - it is continuous and nice.
- sjoelund.se
- 1700 Posts
Re: Error when requiring derivative of function mod()
The complete error message is:
[:0:0-0:0] Error: Internal error Transformation Module PFPlusExt index Reduction Method Pantelides failed!
[:0:0-0:0] Error: Internal error - IndexReduction.pantelidesIndexReduction failed!
[:0:0-0:0] Error: Internal error - IndexReduction.pantelidesIndexReduction1 failed! Use +d=bltdump to get more information.
[D:\Projects\Modelica\modtest.mo:5:3-5:19] Error: Internal error
Differentiate.differentiateEquationTime failed for y = mod(x, 3.14)
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Error when requiring derivative of...