You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of linearize uses ForwardDiff, which often works fine. However, models with discontinuities and saturation are sometimes better linearized with finite differences, with a relatively large perturbation size, (or even better, with stochastic linearization). It would be nice to allow the user to select exactly how the model is linearized, and if using finite-differences, the perturbation size for each variable. For input variables this would be straightforward to support, but for state variables less so since the state is not always known at the time of the call to linearize. A two-step approach could be okay, where the user first calls linearize and obtains the state realization, after which the perturbation sizes can be tuned. Alternatively, one could specify perturbation size for any desired variables, and the initialization system could be used to translate those sizes into whatever state realization is selected.
Another thing that would be nice to support would be to have an option to replace blocks when a model is linearized, e.g., replacing a saturation block with an identity block etc.
I notice that the AutoFiniteDiff backend from ADTypes has options for relative step size, this could perhaps be good enough in some situations
The text was updated successfully, but these errors were encountered:
I emphasise the need for this capability. This is something used accross different industrial project in Matlab for example. The double step linearization to get state sensitivities to a large perturbation to an input and then a second one adapting the state perturbation by the first sensitivity can be obtain by a double call to linmodv5 in Matlab ([A,B,C,D] = linmodv5(mdl,x,u,opts,xpert,upert)).
The current implementation of
linearize
uses ForwardDiff, which often works fine. However, models with discontinuities and saturation are sometimes better linearized with finite differences, with a relatively large perturbation size, (or even better, with stochastic linearization). It would be nice to allow the user to select exactly how the model is linearized, and if using finite-differences, the perturbation size for each variable. For input variables this would be straightforward to support, but for state variables less so since the state is not always known at the time of the call tolinearize
. A two-step approach could be okay, where the user first callslinearize
and obtains the state realization, after which the perturbation sizes can be tuned. Alternatively, one could specify perturbation size for any desired variables, and the initialization system could be used to translate those sizes into whatever state realization is selected.Another thing that would be nice to support would be to have an option to replace blocks when a model is linearized, e.g., replacing a saturation block with an identity block etc.
I notice that the
AutoFiniteDiff
backend from ADTypes has options for relative step size, this could perhaps be good enough in some situationsThe text was updated successfully, but these errors were encountered: