Runge Kutta Merson t1>t0 assert
Posted: Thu Oct 01, 2009 6:59 am
Hi Sherman, first I want to thank you for the great help you have provided me with my other problems. It is really appreciated. I have a really recurrent assert in RungeKuttaMersonIntegratorRep::attemptAStep. It is this line: assert(t1 > t0); (t1 seems to be equal to t0). In this case, I have a a couple of pendulum and after a couple of seconds the system start to become really slow and this assert will popup. I also wanted to know if you prefer me to post these problem I encounter on the forum, or if you prefer something else. Either case, let me know.
So here is a simple code:
MultibodySystem system;
SimbodyMatterSubsystem matter(system); //Subsystem that contains all the bodies of the system
GeneralForceSubsystem forces(system); //Subsystem that contains all the forces of the system
if(usegravity)
Force::UniformGravity gravity(forces, matter, Vec3(0, -9.81, 0)); //We add a gravity force acting on all the body of the system
Body::Rigid BetaBox(MassProperties(35000.0, Vec3(0), Inertia(80000)));
BetaBox.addDecoration(Transform(), DecorativeBrick().setOpacity(0.5));
SimTK::Rotation Rot(SimTK::Quaternion(1,0,0,0));
SimTK::Rotation Rot45(SimTK::Quaternion(0.923,0,0.382,0));
MobilizedBody::Ball box1(matter.Ground(), Transform(Vec3(0,5,0)), BetaBox, Transform(Rot,Vec3(3, 8, 0)));
MobilizedBody::Ball box2(matter.Ground(), Transform(Vec3(0,5,0)), BetaBox, Transform(Rot45, Vec3(3, -8, 0)));
MobilizedBody::Ball box3(box1, Transform(Vec3(0,0,0)), BetaBox, Transform(Vec3(3, 3, 0))); //Transform(Rot2, Vec3(-7, -7, -7)).invert())
MobilizedBody::Ball box4(box3, Transform(Vec3(0,0,0)), BetaBox, Transform(Vec3(4, 4, 0)));
MobilizedBody::Ball box5(box4, Transform(Vec3(0,0,0)), BetaBox, Transform(Vec3(3, 3, 0)));
SimTK::Constraint::ConstantAngle(box1, UnitVec3(1,0,0), box2, UnitVec3(0,1,0), -Pi);
system.updDefaultSubsystem().addEventReporter( new VTKEventReporter(system, 0.01));
// Initialize the system and state.
system.realizeTopology();
State state = system.getDefaultState();
// Simulate it.
RungeKuttaMersonIntegrator integ(system);
TimeStepper ts(system, integ);
ts.initialize(state);
ts.stepTo(25);
So here is a simple code:
MultibodySystem system;
SimbodyMatterSubsystem matter(system); //Subsystem that contains all the bodies of the system
GeneralForceSubsystem forces(system); //Subsystem that contains all the forces of the system
if(usegravity)
Force::UniformGravity gravity(forces, matter, Vec3(0, -9.81, 0)); //We add a gravity force acting on all the body of the system
Body::Rigid BetaBox(MassProperties(35000.0, Vec3(0), Inertia(80000)));
BetaBox.addDecoration(Transform(), DecorativeBrick().setOpacity(0.5));
SimTK::Rotation Rot(SimTK::Quaternion(1,0,0,0));
SimTK::Rotation Rot45(SimTK::Quaternion(0.923,0,0.382,0));
MobilizedBody::Ball box1(matter.Ground(), Transform(Vec3(0,5,0)), BetaBox, Transform(Rot,Vec3(3, 8, 0)));
MobilizedBody::Ball box2(matter.Ground(), Transform(Vec3(0,5,0)), BetaBox, Transform(Rot45, Vec3(3, -8, 0)));
MobilizedBody::Ball box3(box1, Transform(Vec3(0,0,0)), BetaBox, Transform(Vec3(3, 3, 0))); //Transform(Rot2, Vec3(-7, -7, -7)).invert())
MobilizedBody::Ball box4(box3, Transform(Vec3(0,0,0)), BetaBox, Transform(Vec3(4, 4, 0)));
MobilizedBody::Ball box5(box4, Transform(Vec3(0,0,0)), BetaBox, Transform(Vec3(3, 3, 0)));
SimTK::Constraint::ConstantAngle(box1, UnitVec3(1,0,0), box2, UnitVec3(0,1,0), -Pi);
system.updDefaultSubsystem().addEventReporter( new VTKEventReporter(system, 0.01));
// Initialize the system and state.
system.realizeTopology();
State state = system.getDefaultState();
// Simulate it.
RungeKuttaMersonIntegrator integ(system);
TimeStepper ts(system, integ);
ts.initialize(state);
ts.stepTo(25);