G_acc overrides SetPos_dtdt. What's the point?

瀏覽次數:23 次
跳到第一則未讀訊息

Tymo

未讀,
2022年11月16日 下午4:29:242022/11/16
收件者:ProjectChrono
There is a problem with SetPos_dtdt.
coords_dtdt.pos seems to be overwritten with G_acc, so what is the point of SetPos_dtdt?

ChSystemNSC sys;
auto body = make_shared<ChBody>();
sys.AddBody(body);
body->SetPos_dtdt(Vector(0, 1, 0));
cout << body->GetPos_dtdt().y() << endl;//1
sys.DoFrameDynamics(1);
cout << body->GetPos_dtdt().y() << endl;//-9.81 value overwritten
sys.Set_G_acc(Vector(0, 0, 0));
body->SetPos_dtdt(Vector(0, 1, 0));
cout << body->GetPos_dtdt().y() << endl;//1
sys.DoFrameDynamics(2);
cout << body->GetPos_dtdt().y() << endl;//0 value overwritten again


Radu Serban

未讀,
2022年11月16日 下午5:10:342022/11/16
收件者:ProjectChrono

Tymo,

 

You are doing a dynamics analysis, more precisely “forward dynamics”. In this case, the motion of the system is dictated by its initial state (positions and velocities) and the set of applied forces.  Forward dynamics analysis calculates the accelerations (think Newton’s second law a = F/m) and then integrates to find the new velocity and position.

 

In the examples you show, gravity is the only applied force so, as expected, the body’s acceleration will end up being the gravitational acceleration.

 

The function SetPos_dtdt can be used for other types of analysis, for example inverse dynamics.

 

--Radu

--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/e4fd6b97-06ae-4381-a12f-c45eef5a772an%40googlegroups.com.

Tymo

未讀,
2022年11月17日 下午3:28:062022/11/17
收件者:ProjectChrono

Thank you for clarification
回覆所有人
回覆作者
轉寄
0 則新訊息