Is it necessary, or recommended, to define partials w.r.t fixed parameters?

守給你的承諾、 提交于 2021-02-11 15:45:01

问题


As per the title - say you have a fixed parameter like air density. Is it worth defining the partial w.r.t this fixed parameter?


回答1:


If you know the value will be fixed forever (i.e. you'll never want to connect it to something else), the you don't need to declare derivatives for that combination of variables.

However I consider this to be a bad practice. In my experience, at some point in the future you will end up connecting something to that input, and then the total derivatives will be wrong. You could, of course, fix the derivatives at that point, but you might not remember and it will take you some time to debug the optimization and figure out the source of the bad derivatives. So as a best practice, I always differentiate all outputs with respect to all inputs.

Alternatively, you could declare density as an option instead of an input (see the docs on options) If you really want it to be a constant, this is the route I suggest.



来源:https://stackoverflow.com/questions/61432357/is-it-necessary-or-recommended-to-define-partials-w-r-t-fixed-parameters

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!