Issue with solving ill-conditioned symbolic DAE system
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Mohamed Elshami
el 11 de Jun. de 2024
Comentada: Torsten
el 8 de Jul. de 2024
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 comentarios
Respuesta aceptada
Más respuestas (1)
John D'Errico
el 11 de Jun. de 2024
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.
1 comentario
Ver también
Categorías
Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!