Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of 2nd order derivative annotation is wrong #452

Open
amoss opened this issue Mar 15, 2022 · 0 comments
Open

Example of 2nd order derivative annotation is wrong #452

amoss opened this issue Mar 15, 2022 · 0 comments

Comments

@amoss
Copy link

amoss commented Mar 15, 2022

The example in the Second Derivatives subsection places the annotation on the wrong function.

function f
  …
  annotation(derivative=df, derivative(order=2)=ddf);
end f;

This is covered in §12.7 of the Modelica spec: https://modelica.org/documents/ModelicaSpec32Revision2.pdf,
Where they give the example

function foo0
  annotation(derivative=foo1);
end foo0;
function foo1
  annotation(derivative(order=2)=foo2);
end foo1;
function foo2
end foo2;

Translated back onto your example, the derivative(order=2)=ddf annotation should be in the function df, rather than in f.

The body of the text in the spec does not make this entirely clear, but there are some lengthy discussions about it
in relevant github issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant