pysdic.Transformation.check_left_invertible#
- Transformation.check_left_invertible(x_i, *, check_dx=False, check_dp=False, rtol=1e-05, atol=1e-08, raise_error=False, apply_kwargs=None, invert_kwargs=None)[source]#
Check numerically that the invert method is a left inverse of the apply method at the given input points \(\vec{x_i}\).
\[T^{-1}(T(\vec{x_i})) = \vec{x_i}\]If
check_dxis True, the consistency of the Jacobians with respect to the points is also checked using the chain rule:\[\frac{\partial T^{-1}}{\partial \vec{x_o}}(T(\vec{x_i})) \cdot \frac{\partial T}{\partial \vec{x_i}}(\vec{x_i}) = \mathbf{I}_{n_i}\]If
check_dpis True, the consistency of the Jacobians with respect to the parameters is also checked by differentiating the identity with respect to \(\vec{p}\):\[\frac{\partial T^{-1}}{\partial \vec{x_o}}(T(\vec{x_i})) \cdot \frac{\partial T}{\partial \vec{p}}(\vec{x_i}) + \frac{\partial T^{-1}}{\partial \vec{p}}(T(\vec{x_i})) = \mathbf{0}\]Note
This check is only valid at the given points. It is recommended to perform it on points covering the domain of interest.
- Parameters:
x_i (ArrayLike) – Input points \(\vec{x_i}\) with shape \((\dots, n_i)\) at which to perform the check.
check_dx (bool, optional (default:
False)) – If True, also check the consistency of the Jacobians with respect to the points.check_dp (bool, optional (default:
False)) – If True, also check the consistency of the Jacobians with respect to the parameters.rtol (float, optional (default:
1e-5)) – The relative tolerance of the comparison (seenumpy.allclose).atol (float, optional (default:
1e-8)) – The absolute tolerance of the comparison (seenumpy.allclose).raise_error (bool, optional (default:
False)) – If True, raise anAssertionErrorwith the maximum error if the check fails.apply_kwargs (Optional[Dict[str, Any]], optional (default:
None)) – Additional arguments passed to the underlying_applymethod.invert_kwargs (Optional[Dict[str, Any]], optional (default:
None)) – Additional arguments passed to the underlying_invertmethod.
- Returns:
True if the invert method behaves as a left inverse at the given points, False otherwise.
- Return type: