
Yupeng – you can do this by implementing your own custom force callback for a ChLinkTSDA.
See demo_MBS_spring.cpp which illustrates the use of such a callback mechanism. While that example is very simple and for demonstration only, you can implement whatever function you want for the force produced by the spring. Within the Evaluate() function, you have access to the ChLinkTSDA element itself which means you can access the current positions of the connected bodies and use that in the force evaluation if you so desire.
--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/0de81a94-f565-4993-bf28-9853a53571c1n%40googlegroups.com.