First I set up the particle system to work with bending grass and hair dynamics, then I change the hair to an object. The object is a tree I have generated. The wind blows the tree as a whole, but I need the branches and trunk to bend.
I will demonstrate only on the trunk, the branches are the same idea. At first add the cloth simulation and turn on the pinning, then assign the bottom vertices of the trunk to a groop and in the cloth simulation panel under the pinning set to the groop u just made, then use this picture values as a basis to make it suit u own purpose