Why do I get a linear algebra error when trying to create a variable gear ratio block using Simscape language?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to construct a simple variable gear ratio block using the Simscape language by adapting the code from the gear box in the Simscape foundation library. However, using a physical signal as the gear ratio results in the following error:
Nonlinear solver: Linear Algebra error. Failed to solve using iteration matrix.
Initial conditions solve failed to converge.
Replacing the gear ratio with a parameter (rather than an input) gets rid of the problem.
Réponse acceptée
MathWorks Support Team
le 5 Déc 2011
When the ratio is a constant value, this allows the solver to make assumptions and simplify the equations. However, when the ratio comes from a signal, the equations of the system become index-2 DAE (Differential Algebraic Equations) that the Simscape solver cannot solve (due to its inherent limitations).
To work around this limitation, include stiffness and damping in the equations while modeling this system. The ‘Variable Ratio Transmission’ block in SimDriveline implements exactly this. If you would like to implement this behavior in an ssc file, the equations would look like the following:
let
phiDot = rotation_sign*ratio*F.w - B.w;
in
phi.der == phiDot;
tB == -kv*phiDot - kp*phi;
tF == -rotation_sign*ratio*tB;
end
0 commentaires
Plus de réponses (0)
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!