How can I delete "almost"-zeros in expressions?

21 views
Skip to first unread message

Squier255

unread,
Feb 15, 2019, 9:01:35 AM2/15/19
to CasADi
Hi,

I use Matlab with Casadi 3.4.5 in combination with the IPOPT Interface. I noticed that I have a Jacobian matrix that contains values like "1e-12" which makes the jacobian less sparse and therefore the computation time less efficient.
My question is: Can I and if so how do I delete these entries? Or does IPOPT "ignore" them anyway somehow.

Thank you guys in advance.

Simon

Squier255

unread,
Feb 25, 2019, 11:12:43 AM2/25/19
to CasADi
Does nobody know?

Joel Andersson

unread,
Feb 25, 2019, 1:44:54 PM2/25/19
to CasADi
Nonzeros in the Jacobians are fixed at construction and does not depend on particular numerical values. If you want to avoid the small entries, you need to reformulate your problem accordingly. How IPOPT handles small entries is a question for the IPOPT mailing list. My guess is that it depends on the linear solver used.

Joel
Reply all
Reply to author
Forward
0 new messages