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

Improve text for dependency #1706

Merged
merged 9 commits into from
Mar 15, 2022
Merged

Improve text for dependency #1706

merged 9 commits into from
Mar 15, 2022

Conversation

KarlWernersson
Copy link
Collaborator

Clarify that dependency is direct /related to partialDerivative, non normative text explaining dependency on independent variable

Clarify that dependency is direct /related to partialDeriavitve, non normlative text explaining dependency on independent varaible
@KarlWernersson
Copy link
Collaborator Author

Woring on one more commit

@andreas-junghanns
Copy link
Contributor

@KarlWernersson : I tried to improve the sentences, but I might have changed the meaning - please recheck!

@KarlWernersson
Copy link
Collaborator Author

Thanks for the cleanup

@KarlWernersson
Copy link
Collaborator Author

Do we also need some formula explaining in the getting partial derivative section or is this sufficient?

@andreas-junghanns
Copy link
Contributor

Do we also need some formula explaining in the getting partial derivative section or is this sufficient?

Maybe we can add that to the non-normative text? Can you propose what should be there and I can try to make it pretty?

@KarlWernersson
Copy link
Collaborator Author

I wrote a small clarification, I don't have the infrastructure to build the document locally so I might have gotten some of the formatting wrong

@andreas-junghanns
Copy link
Contributor

I have now changed your proposal to render like this:
grafik

Please check again.

@KarlWernersson
Copy link
Collaborator Author

Thanks

f and t was intentionally not bold as they are scalars in this expression.
f could could be bold but then we need to remove the dot product

@KarlWernersson
Copy link
Collaborator Author

But i realize we don't do this at other places at the standard so I'm not sure what the best solution...

@andreas-junghanns
Copy link
Contributor

f and t was intentionally not bold as they are scalars in this expression. f could could be bold but then we need to remove the dot product

Sounds like I am missing the semantics of bold vs. non-bold. Please check also our mathematical notation: there we turn a lot of the math symbols to bold just to have the formatting consistent. Can you explain what bold/non-bold should mean?

@KarlWernersson
Copy link
Collaborator Author

Also i screwed up v and x i will fix

@KarlWernersson
Copy link
Collaborator Author

So normally non bold means scalar variable and bold means multidimensional variable . In general our equations works on multidimensional variables except for t which of course is a scalar but we have used bolded t in other parts of the code.

@KarlWernersson
Copy link
Collaborator Author

I went back and looked at the 2.0.2 document and there we use non bold for t, Tnext etc.
I think it would be good to revert this, i can try to do this if you want?

Copy link
Collaborator

@masoud-najafi masoud-najafi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This statement is not clear: "For continuous variables this corresponds to that there exist values for the knowns where the partial derivative of the unknwon with respect to a known is non-zero."

continuous -> continuous-time
"what is ment" -> ?

BTW, in DirectionalDerivative, the knowns are only "inputs and continuous-time states". Even if the independent variable is listed inside dependencies, I is meaningless to take into account, isn't it?

@KarlWernersson
Copy link
Collaborator Author

BTW, in DirectionalDerivative, the knowns are only "inputs and continuous-time states". Even if the independent variable is listed inside dependencies, I is meaningless to take into account, isn't it?

I think this is not the case knows are whatever we have listed in the dependencies, and that can include the time variable.

vknown is the vector of input 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 .

So if that is listed you can get directional derivative with respect to the time variables. So what I am trying to do is to clarify what happens when you take the directional derivative with respect to time. And that you don't get the total derivative.

Btw, the input links should not be there as this is not variables with variability "input"

@KarlWernersson
Copy link
Collaborator Author

Another solution would be to not list time among the dependencies or forbid it from the directional derivatives but we have not done that so far

@masoud-najafi
Copy link
Collaborator

If independent variable "time" is listed in the dependencies of a variable V, directionalDerivative may be provided the partial derivative of V WRT time. The [only] use-case for DirectionalDerivative that I know is computing the Jacobian. In computing the Jacobian, we do not take into account "time", even if is listed. So no contradiction for Jacobian. Do you any other use-case?

@KarlWernersson
Copy link
Collaborator Author

I don't really see any but maybe I am missing something, I am just trying to fix what we have as we curently are allowing getDirecotinal derivative with respect to time but I am fine removing the possibility to take directional derivative of time it but that a larger change.

@KarlWernersson
Copy link
Collaborator Author

Anyhow an exporter an easily avoid providing directional derivatives with respect to time by not listing the time variable among the dependencies.

@KarlWernersson
Copy link
Collaborator Author

From the fmi 2.0.2 standard

. If a variable with causality =
″independent″ is explicitely defined under ScalarVariables, a directional derivative with
respect to this variable can be computed. If such a variable is not defined, the directional
derivative with respect to the independent variable cannot be calculated.

In fmi3 we decided that independent must be specified. So this text has been removed.
So it is nothing new.

@KarlWernersson
Copy link
Collaborator Author

But i dont knwo if anyone has implemented support for it, I haven't

@masoud-najafi
Copy link
Collaborator

I do not see any harm in listing "time" in the dependencies. If an exporter lists "time" in the dependencies, it SHOULD also provide the directionalDerivative WRT "time" too. But it is up to the importer to use it or not. When I think, I remember I have seen the case where I have needed the derivative of a variable WRT time to estimate its sensitivity. In this case it was a zero-crossing surface that was also an output. I think clarification would be good, but not forbidding it, which is, as you said, a big change.

@masoud-najafi
Copy link
Collaborator

From the fmi 2.0.2 standard

. If a variable with causality =
″independent″ is explicitely defined under ScalarVariables, a directional derivative with
respect to this variable can be computed. If such a variable is not defined, the directional
derivative with respect to the independent variable cannot be calculated.

In fmi3 we decided that independent must be specified. So this text has been removed. So it is nothing new.

This is still valid for fmi3, even if independent variable is always present.

@KarlWernersson
Copy link
Collaborator Author

Meeting to discuss the isses scheduled for 2022-03-09 15:00 CET

@Maplesoft-fmigroup
Copy link
Contributor

I believe that some stiff methods (e.g. Rosenbrock) require partial derivatives with respect to explicit occurrences of the time variable. This suggests that we do not want to disallow this for the directionalDerivative.

\mathbf{f}(\mathbf{x}, \mathbf{\dot{x}}, t)
++++

_it's partial derivative with respect to_ latexmath:[t] _will be_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's -> its

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@KarlWernersson
Copy link
Collaborator Author

Meeting Conclusion.
Remove direct reference to time. Possible keep some comment like; it also holds for independent variable...

Dependency means that unknown has an algebraic dependency on the known.
[For real valued unknowns and knowns this means that the partial derivative on the unknown with respect to the known is not identical zero. ]

No mentioning of total derivative it adds confusion and that we speak of partial derivative is clear,

@andreas-junghanns
Copy link
Contributor

So who will update the PR?

@KarlWernersson
Copy link
Collaborator Author

I will do it tomorrow I probably wont have time today

@andreas-junghanns andreas-junghanns merged commit b3897de into master Mar 15, 2022
@andreas-junghanns andreas-junghanns deleted the #1697 branch March 15, 2022 15:23
@KarlWernersson
Copy link
Collaborator Author

Aj aj aj
Sorry i didnt do the update so some of these changes should be removed

@andreas-junghanns
Copy link
Contributor

Aj aj aj Sorry i didnt do the update so some of these changes should be removed

Sorry, I don´t understand: This PR was merged because there were approvals and you did not have this in DRAFT anymore :(
We will need a new PR to fix this...

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 this pull request may close these issues.

Clarify dependencies and providesDirectionalDerivatives w.r.t. time
6 participants