Issue with solving ill-conditioned symbolic DAE system
조회 수: 2 (최근 30일)
이전 댓글 표시
Kindly I want to know if there any changes in some solvers like ODE113 or symbolic engines?
Recently I have updated matlab to 2023b version and tried to run a script that I have excuted it before with nothing changed on older version of matlab, the script contains solving a symbolic DAE system Ax = B, with ill-conditioned A matrix, using ODE113 of an older version it was working with conditiong number was around e-21. my results using older version was compared to some other CAEs (figure below) and they were identical, so I do not know what is the issue in 2023b, any help please?
댓글 수: 3
채택된 답변
추가 답변 (1개)
John D'Errico
2024년 6월 11일
You have a DAE, with a linear constraint system that happens to be ill-conditioned. I would try reducing the constraint system. You lose nothing in the process. That is, first verify the constraints are consistent. Thus you want to have
rank(A) == rank([A,b])
If not, then you have a fundamental problem. But assuming the above test succeeds, then you can reduce the problem, so the algebraic part is no longer ill-conditioned. (Well, hopefully. That sort of depends on where the ill-conditioning arises, and how.)
I'll give a simple example of a problem with an ill-conditioned constraint.
A = randn(3,2)*randn(2,5) % Just a randomly generated constraint set.
Note the rank of A is 2, even though there are 3 constraints.
size(A)
rank(A)
I'll pick an arbitrary right hand side that is consistent.
b = A*[2;3;5;7;11]
The next test I would perform is to verify the problem is indeed consistent. (Even though I claim that to be the case, you may not believe me.)
Arank = rank(A)
rank(A) == rank([A,b])
So the algebraic part is indeed consistent, and the rank of A is 2, as I would expect. Next, look at the singular values of A.
svd(A)
As you can see, one of them is massively smaller than the others. That tells me there will be no issue in reducing the problem.
[Q,R] = qr(A,0)
The trick now is to reduce the problem as:
Ahat = R(1:Arank,:);
bhat = Q'*b;
bhat = bhat(1:Arank);
Ahat will no longer be singular. It may still be moderately ill-conditioned though, and that will depend on how A was created, and the source of the ill-conditioning. But you can now use the reduced constraint pair Ahat and bhat instead of A and b.
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!