Hello,
I am working on my Master Thesis that consists in programming a 3D Multibody Simulator that solves kinematic and foward dynamic analysis, as a result I have matrices that are usually ill conditioned. In one of my lines of code I am trying to solve a linear system that follows the equation of Mq''=g, where M is an Inertia Matrix and g is a vector of forces and q'' is the accelerations that I use to start an iterative process.
From this iterative process I am able to calculate position and velocity of all bodies and the results I have are plaged with numerical instability and as a result I suspect that the culprit is this equation. Therefore my question is the following: Is there anything that I can do to improve the condition of my mass matrix? I have tried the following:
  1. Use Pinv, which uses SVD, but the results are not satisfactory;
  2. Tried to use Decomposition to once again see if the results were satisfatory but unsuccessfully;
  3. Tried to use lsqminnorm with a high tolerance factor, where I achieved my best results.
  4. Eliminated the first 7 rows and columns from the matrix and the 7 rows of the vetor which correspond to a body without movement or mas (ground) to try and improve the conditions unsucessfully ( this simplification would not change my results);
Other than this I have been reading all sort of articles and answers in this community, mainly answers from John D'Errico user, but I haven't found anything that helped me. In annex I put the example of one Inertial matrix and a vetor of forces that I use in one of my models.
EDIT: I also have been trying to use the regtools toolbox, mainly focusing on using Tikhonov regularization but currently I am having trouble in choosing an adequate method to choose the regularization parameter.
Regards,
Tiago

 채택된 답변

Ivo Houtzager
Ivo Houtzager 2022년 8월 25일
편집: Ivo Houtzager 2022년 8월 25일

0 개 추천

Please have look at the following regress function, see PBSID-Toolbox/regress.m at master · jwvanwingerden/PBSID-Toolbox · GitHub. This function uses the reglcurve and reggcv fucntions of the regtools toolbox to find the the regularization parameter using L-Curve or Generalized Cross Validation for the Tikhonov regularization or the Truncated SVD method.

댓글 수: 3

Hello, thank you for your help! In the case of this function the author states that the input are 2 matrices Y and P with the same columns. However I do not have 2 matrices only 1 Matrix and 1 Vector, should those be my inputs? Or you should I use the regtools csvd -> regress -> tikhonov ?
Ivo Houtzager
Ivo Houtzager 2022년 8월 25일
편집: Ivo Houtzager 2022년 8월 25일
It solves the linear problem Y=X*P where X is unknown and Y and P are given, and Y can be vector as well. Seems you want to solve g=M*g2 for unknown g2 and g and M are given, If you transpose to g'=g2'*M', than the inputs are Y = g'; and P = M'; and output is g2 = X';. Thus function becomes something like
g2 = regress(g',M','TIKH','LCURVE')';
where you can select also select different method options, like 'TSVD' and/or 'GCV'.
Hello,
Thank you for your help. I have been experimenting with the toolbox that you mentioned I was able to obtain results that unfortunetly are only similar to the ones I achieved with the lsqminnorm. These results however, are not close to what I achieved with a standard commercial program.
MATLAB:
ADAMS:
Position
Acceleration:
However, I don't think anyone else has any suggestion on how to solve this issue, and as a result I will wait more 24 hours and accept the answer, since it is very useful for regularization problems!
Regards,
Tiago

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Error Detection and Correction에 대해 자세히 알아보기

질문:

2022년 8월 25일

댓글:

2022년 8월 26일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by