Hello!
I am trying to automate some code for my model using Python.
The idea is that I am trying to find the optimal attachment points of certain ligaments/contact surfaces.
I have tried using this tutorial http://localhost:8892/notebooks/02_Generating_macros.ipynb and it works perfect. Only for variables composed of a value. But it doesn't work for variables composed of vectors or matrices.
So for instance, let's say I have a ligament that has positions {x,y,z}. What I am trying to do is vary x,y,z with +- 0.03 let's say, run the simulation and see the level of muscle activation, or the internal rotation of the said bones, etc..
I have tried in Python to just run one simulation, without varying anything, using the following command:
matrix = np.array([[-38.80857,125.3048,22.31599],[-34.80857, 122.3048, 22.31599]])*0.001
which is basically:
[[-0.03880857 0.1253048 0.02231599]
[-0.03480857 0.1223048 0.02231599]]
but when I try to run the macro, it always fails.
I have also tried without using the np.array:
matrix = ([-38.80857,125.3048,22.31599],[-34.80857, 122.3048, 22.31599])
which gives:
([-38.80857, 125.3048, 22.31599], [-34.80857, 122.3048, 22.31599])
And I was thinking it should work, but it doesn't...
I am thinking I am seeing this wrong and it is not just a matrix, since in AnyBody the position of the ligaments are:
{ {-38.80857, 125.3048, 22.31599},
{-34.80857, 122.3048, 22.31599}
}*0.001;
Could you give me any suggestions please?
Thanks in advance!
Best,
Diana