integrator convergence and termination
Posted: Tue Mar 12, 2013 2:15 pm
Hi,
I just have a question regarding investigating whether my simulations have converged or not within the opensim API. My simulation results are doing a few strange things and just wanted to check my integrator tolerances and how the integrator is terminating. I am wondering how I can return the termination reason? Currently I am trying to return the termination reason after the opensim manager performs the integration but I always get "InvalidTerminationReason", even at very high integrator accuracies. My code segment is below and I would really appreciate any thoughts.
Cheers
Tom
I just have a question regarding investigating whether my simulations have converged or not within the opensim API. My simulation results are doing a few strange things and just wanted to check my integrator tolerances and how the integrator is terminating. I am wondering how I can return the termination reason? Currently I am trying to return the termination reason after the opensim manager performs the integration but I always get "InvalidTerminationReason", even at very high integrator accuracies. My code segment is below and I would really appreciate any thoughts.
Cheers
Tom
Code: Select all
// Create the integrator for the simulation.
SimTK::RungeKuttaMersonIntegrator integrator(osimModel.getMultibodySystem());
integrator.setAccuracy(0.00001);
// Create the manager
Manager manager(osimModel, integrator);
// Integrate from initial time to final time
manager.setInitialTime(parameters[9]);
manager.setFinalTime(parameters[10]);
std::cout<<"\n\nIntegrating from "<<parameters[9]<<" to "<<parameters[10]<<std::endl;
clock_t t1,t2;
t1 = clock();
manager.integrate(s);
SimTK::Integrator::TerminationReason termReason;
termReason = integrator.getTerminationReason();
SimTK::String termReasonString = integrator.getTerminationReasonString(termReason);
cout<<"\n\nIntegrator termination reason: "<<termReasonString;