Can anybody use loop?

Can anybody software call inversedynamics in its own loop, and use the data calculated in the previous loop each time?

Hi Pengcheng,

Could you please elaborate a little more what you would like to do? AnyBody does not have the option to run loops but it may be possible to formulate something depending on the problem you have.

Best regards,
Dave

Thanks for your reply.
What I want to achieve is running the inverse dynamics once, using the obtained muscle activations to modify certain values in my musculoskeletal model, and then running the inverse dynamics again in a repetitive loop. My instructor mentioned that one of her colleagues achieved this using AnyInputFile. I'm curious to know if AnyInputFile can accomplish this, and if not, could you please explain the reasons?

Yes, AnyInputFile will be needed along with AnyOutputFile. When you run the simulation, you will have to use AnyOutputFile to export the output (muscle activation). When you load the model, you should use the AnyInputFile to read the values. They should have the same file name. As you may imagine, you will have an issue when you run the first iteration becasue you must have the file so that the model can be loaded. In AnyInputFile, you can use T0 and Data0 values to give some initial data.

However, this will not solve the problem of running AnyBody in loop. For this, you may need to use AnyPyTools to run AnyBody externally through Python and defining the loop in Python.

I hope this helps.

Best regards,
Dave

This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.