I have a C++ model that has m muscles and n user-actuators. Each muscle has one control variable and each actuator has 3 control variables - for a total model control vector of length m+3n. The length and content of my model controls does contain the controls for all muscles and actuators in the model - m+3n. However, when I integrate the model and called _model.printControlStorage() to print the controls vector to a file, I see that only the first control variable is printed for each of the actuators - the output file has m+n+1 columns. Can someone advise on how to make sure for each actuator all the control variables are printed?
Thanks.
Musa
printing controls after integration:
- Christopher Dembia
- Posts: 506
- Joined: Fri Oct 12, 2012 4:09 pm
Re: printing controls after integration:
Non-scalar actuators are not as well supported throughout the API. You can try calling model.getControls() during the integration to access all control variables.
Re: printing controls after integration:
Thanks Chris. This is helpful to know. I guess I can run my integration in smaller time steps (say 0.01) and call getControls() at the end of each time step and record the control values. The only thing is I will then lose the ability to use printControlStorage( ) and getStateStorage().print which are called at the end of the whole integration run. Is there a way to extract the state vector at the end of every small but selected integration time step? - say at 0.01s intervals and repeated until final time = 1.0?
Thanks.
Musa
Thanks.
Musa
- Christopher Dembia
- Posts: 506
- Joined: Fri Oct 12, 2012 4:09 pm
Re: printing controls after integration:
If you are using 4.0, you can use a StatesTrajectoryReporter with a report_time_interval of 0.01.