khaledghobashy / uraeus_nmbd_python

Numerical simulation environment of constrained multi-body systems in python.
Other
0 stars 0 forks source link

solving systems of nonlinear equations #1

Open yunlongxu-artemis opened 3 years ago

yunlongxu-artemis commented 3 years ago

H Khaled,

Nice work!

A quick question: in the while loop here, seems like you're solving a nonlinear system of equations by writing a simple newton solver yourself.

How often does it NOT converge? (especially on initialization). And have you considered using nonlinear programming solvers to solve it?

cheers, Yunlong

khaledghobashy commented 3 years ago

Hi Younlong, Thank you for your feedback and question :)

I don't know if I can answer the first questions objectively, as I haven't made a test case to measure the convergence as a function of the initial state, so I didn't quantify it properly. But I can give you a subjective answer from observations.

For kinematically-driven systems, it faces difficulties in convergence, and may not converge at all, in the following cases:

For dynamically-driven systems, all these are still valid, but in addition to numerical stiffness, which naturally lead to non smooth transitions and requires very small step-sizes to behave in a good way.

So, How often, in practice, does this happen with me? Not much, if I was careful about these points. But I cannot claim that this is an objective, quantifiable measure of the goodness of the algorithm :)

As for Non-Linear Programming. No, not until now :). I may give it a shot, this looks interesting, I will have to read more about it and see what I can do then. Thank you for mentioning this out!

I have used Newton-Raphson method as it is the method usually discussed in the MBS literature, and used in CHRONO, and I guess ADAMS as well (not sure). And I always approach things in the simplest way I can think of to initially make it run, then I would look for more optimum solutions once I got the base functionality.

Again, thank you, Younlong, for your feedback and questions. This is extremely helpful :)

Best, Khaled