Variable step solver causes my model to explode, but fixed step solver doesn't cause that
Afficher commentaires plus anciens
So I'm trying to simulate a monoped (single leg of a robot) jumping vertically high in Simscape Multibody and optimize the design in a loop. Everytime the optimization algo chooses different parameters of the leg dimensions, the model is updated and resimulated. The specific logged data like, energy consumption and max height reached are then used to calculate the cost. The jumping trajectory is being passed as a timeseries from workspace to a PD controller that generates the torque value for the respective revolute joint.
The issue the desired results of the monoped jumping occurs only when the model is run at a fixed step with tolerance of 1e-4. If the change the tolerance to 1e-3, the leg slips and fails to track the given trajectory. The idea behind decreasing the tolerance is to speedup the process since it is an optimization. For a higher tolerance (1e-5) the desired result is obtained but there is a huge difference between the logged data. For eg. I'm getting 1.8m jump height while using tolerance 1e-4 and 2.2m height while using tolerance 1e-5. How can I know which is close if tolerance keeps on affecting the result? Again, if I change the solver type to variable solver, which intuitively should give better results, fails to even track the passed trajectory completely. The model explodes - starts rotating violently without any sense.
Is there something very simple that I'm missing? I mean if such dependency on solver type exist, how would I know my entire simulations are not a bluff and ill conditioned? What should I do?
Réponses (0)
Catégories
En savoir plus sur Simulation and Analysis dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!