Piecewise Constant Function in C++
Posted: Fri Feb 12, 2021 9:33 am
Hello,
I am currently adding a new muscle model to OpenSim. I finished the first version of it and now I want to test my implementation.
Therefore I tried to simulate my muscle instead of the Millard muscle in the simple C++ example of https://github.com/opensim-org/opensim-core, which worked fine.
Now I additionaly added a triceps muscle and want to simulate an alternating movement with the setup.
Therefore, I want to implement a piecewise constant function which alternates between minimum and maximum activation for both muscles.
Unfortunately I was not able to define a PiecewiseConstantFunction.
How can such a function be defined in C++? Is there any example I could use to define this function?
Many thanks in advance for answering my question.
Best
Mike
I am currently adding a new muscle model to OpenSim. I finished the first version of it and now I want to test my implementation.
Therefore I tried to simulate my muscle instead of the Millard muscle in the simple C++ example of https://github.com/opensim-org/opensim-core, which worked fine.
Now I additionaly added a triceps muscle and want to simulate an alternating movement with the setup.
Therefore, I want to implement a piecewise constant function which alternates between minimum and maximum activation for both muscles.
Unfortunately I was not able to define a PiecewiseConstantFunction.
How can such a function be defined in C++? Is there any example I could use to define this function?
Many thanks in advance for answering my question.
Best
Mike