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

Partial derivatives w.r.t. parameters / non-inputs #2024

Open
chrbertsch opened this issue Feb 21, 2025 · 3 comments · May be fixed by #2027
Open

Partial derivatives w.r.t. parameters / non-inputs #2024

chrbertsch opened this issue Feb 21, 2025 · 3 comments · May be fixed by #2027
Assignees

Comments

@chrbertsch
Copy link
Collaborator

In https://fmi-standard.org/docs/main/#partial-derivatives we state

Image

This seems to limit v_known to input variables.

However we in https://fmi-standard.org/docs/main/#dependencies we state

Image

Allowing parameters etc.

Should we remove the input from https://fmi-standard.org/docs/main/#partial-derivatives, and change to

v_known is the vector of variables of function f which can be changed by the importer in the current state. Details about which variables are in vknown are given in the description of element dependencies in .

Or do I miss something?

@jaeandersson
Copy link

jaeandersson commented Feb 24, 2025

Might also be good to clarify for which variables one is allowed to call fmi3GetNumberOfVariableDependencies as well as which variable types will be included in the return from fmi3GetVariableDependencies. Is it all variables?

@chrbertsch
Copy link
Collaborator Author

FMI Design Meeting:
the "input variables" are misleading. What is meant is the "arguments" of function f

@FaBiasch
Copy link

I still do not understand how to handle parameters. In the VanDerPol Reference FMU 3.0 XML

der(x0) = x1
der(x1) = mu * ((1 - x0 * x0) * x1) - x0

the parameter mu has a valueReference="5" but is not listed in any dependencies, which according to the standard means
"For a real valued unknown and a real valued known, if the known is not listed among the dependencies then the partial derivative of the unknown with respect to that known is identically zero."
The reference implementation accordingly returns zero for all partial derivatives wrt. to variables being not a state, e.g. parameter mu. But this is wrong for the VanDerPol oscillator, if e.g. requesting the partial derivative of der(x1) wrt. mu.
Or is the reason that the mu cannot be changed by the importer in the current state? Still I would prefer a error message when requesting the partial derivative of der(x1) wrt. mu.

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

Successfully merging a pull request may close this issue.

3 participants