Numbers of Y from osimState and state variables from osimModel
Posted: Thu Apr 27, 2017 1:37 pm
Dear specialists of OpenSim,
I am Hide Kimpara at WPI.
I have a trouble in forward analysis using Matlab scripts.
I modified a MATLAB code of Dynamic Walker example and apply the code to other sample models, such as bouncingblock.
https://github.com/opensim-org/opensim- ... SimPlant.m
Now I got an error in the "IntegrateOpenSimPlant.m" because the number of "OutputData.nColumns" which may be equal to size(osimState.getY()) was greater than size of "osimModel.getStateVariableNames()".
Then I realized 18 of size(osimState.getY()) in case of BouncingBlock.osim model, while number of state variables from osimModel "osimModel.getNumStateVariables()" was only 16. So Y variables from osimState have state variables from osimModel plus other two variables.
I found using of FreeJoint and BushingForce creates additional Y variables for osimState. So, Y may contain variables as "xRotation, yRotation, zRotation, xTranslation, yTranslation, zTranslation, somethingfromFreeJoint, somethingfromBushingForce, xRotation_u, ....
However, I did not know what variables have been added on.
I have three questions:
(1) What functions add further Y variables in osimState? And what do those mean for?
(2) In case of models with additional Y variables, how can I change MATLAB code of Dynamic Walker example?
(3) I wish to export sto formated output files for states and control variables from Dynamic Walker example. Are there any examples in OpenSim related web pages?
Best regards,
Hide
I am Hide Kimpara at WPI.
I have a trouble in forward analysis using Matlab scripts.
I modified a MATLAB code of Dynamic Walker example and apply the code to other sample models, such as bouncingblock.
https://github.com/opensim-org/opensim- ... SimPlant.m
Now I got an error in the "IntegrateOpenSimPlant.m" because the number of "OutputData.nColumns" which may be equal to size(osimState.getY()) was greater than size of "osimModel.getStateVariableNames()".
Then I realized 18 of size(osimState.getY()) in case of BouncingBlock.osim model, while number of state variables from osimModel "osimModel.getNumStateVariables()" was only 16. So Y variables from osimState have state variables from osimModel plus other two variables.
I found using of FreeJoint and BushingForce creates additional Y variables for osimState. So, Y may contain variables as "xRotation, yRotation, zRotation, xTranslation, yTranslation, zTranslation, somethingfromFreeJoint, somethingfromBushingForce, xRotation_u, ....
However, I did not know what variables have been added on.
I have three questions:
(1) What functions add further Y variables in osimState? And what do those mean for?
(2) In case of models with additional Y variables, how can I change MATLAB code of Dynamic Walker example?
(3) I wish to export sto formated output files for states and control variables from Dynamic Walker example. Are there any examples in OpenSim related web pages?
Best regards,
Hide