at eacg contact point, the magnitud force will be
Ff = Fn * Cs
Fn is the normal force and the contact point, an dteh solve calculate it by sussesive iterations
Cs is the static coeficiente of friction
once the body stati to move, then the Kenetic friction is applied. It have the same form by it is very different,
when the body is not moving the static friction is a ramp finmtion fo the force at the contact point. once it start to move is is for the most part constant
you can alook at ethe graph on the inrtenet
http://ffden-2.phys.uaf.edu/211_fall2002.web.dir/ben_townsend/staticandkineticfriction.htmThe hard part is teh calculation othe force at teh contact point that will match the horzoant frincion, because they infleuce each others.
The way that manifext is that sta you have a box support by tow contact (in 2d)
you need for forces to keep equilrium (tow normals, and ttow horizon) This si a 4 x 4 linea matrix.
The solve start by setting all to zero, and clactyion the tow normals forces whie keeping teh firtion to zero,
whsi teh two normal forces and if teh contact point are no moving, then detemin teh max frition my motiplin that partial normal force by the stastic friction value, and solve for the friction forces.
these frition forces nor inflecenc the normal forces, so the are re-ajusted.
it keep downg that until the change on the calculation of a new force is very small,
or untill the calculation of a new friction forces is larger that the normal force can support.
when the calculation of a friction force is larger than the normal forces time the static friction,
that row and column is not longer part of the system matrix, and only the residual friction force is evaluated.
the force at that row and column is clip to eth friction force, therefore system loses one degree of fredom for each friction force that reach its limit.
it keeps dowing that until the system converge to a solution or until the max number of iteration is reached.