Determinant of the Jacobian as a constraint couldn't avoid atan2(x,y) get into negative.
7 ビュー (過去 30 日間)
古いコメントを表示
I've been trying to avoid singularity using determinant as a constraint. However, some anglar values obtained using atan2 () keep giving me the follwoing error message.
"Error using atan2 Inputs must be real."
while the determinant of the Jacobian is non-zero. This is because one of the input of atan2 is complex . Could this be related to matlab ? What function should I replace it with to scape from this trap? I believe, there is no singularity as long as the Jacobian has non-zero determinant.
Thanks
2 件のコメント
Matt J
2022 年 4 月 12 日
編集済み: Matt J
2022 年 4 月 12 日
You have given us no information about the calculations you are doing, but I can say in general that no, a non-zero determinant is not usually a good way to ensure invertibility. For example, this matrix A has a non-zero determinant, but for numerical purposes, it is non-invertible.
A=[1,1;0 1e-20]; b=rand(2,1);
A\b
Also, every singular matrix has a non-singular matrix infinitely close to it,. So, if this is part of an iterative optimization problem, a non-singularity constraint cannot prevent the iterations from getting arbitrarily close to a singular solution.
採用された回答
Alan Weiss
2022 年 4 月 13 日
While I do not know what you are really doing, you should know that nonlinear constraints are not satisfied at intermediate iterations. See Iterations Can Violate Constraints. That means your attempt to satisfy nonsingularity by including a nonlinear constraint is doomed to failure.
Instead, you should modify your objective function to be robust to infeasible points. Have the objective return NaN at these points, instead of getting into a situation where MATLAB throws an error.
Alan Weiss
MATLAB mathematical toolbox documentation
5 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!