pysdic.SubsetParametrization._encode#
- SubsetParametrization._encode(p_i, *, dp=False)[source]#
Insert the input parameters \(\vec{p_i}\) at the selected indices of the output parameters.
\[\vec{p_o}[\mathcal{S}] = \vec{p_i} \quad \text{and} \quad \vec{p_o}[\overline{\mathcal{S}}] = \vec{v}[\overline{\mathcal{S}}]\]\[\mathbf{J}_p = \mathbf{E} = \mathbf{I}_{n_o}[:, \mathcal{S}]\]- Parameters:
p_i (numpy.ndarray) – A 1D array of shape \((n_i,)\) containing the input parameters to encode.
dp (bool, optional (default:
False)) – Whether to compute the Jacobian with respect to the input parameters.
- Returns:
A tuple containing:
The encoded output parameters as a 1D array of shape \((n_o,)\).
The Jacobian matrix with respect to the input parameters as a 2D array of shape \((n_o, n_i)\), or None if not computed.
- Return type:
Tuple[numpy.ndarray, Optional[numpy.ndarray]]