function [ F,dF ] = Pacejka_dF(slip,B,C,D,E)
%Calculates the tire force and its anylitical derivative for a
%given slip value, using the pacejka magic formula
F=D*sin(C*atan(B*slip-E*(B*slip-atan(B*slip))));
numerator=-D*C*(-B+E*(B-B/(B^2*slip^2+1)))*cos(C*atan(-B*slip+E*(B*slip-atan(B*slip))));
denominator=(-B*slip+E*(B*slip-atan(B*slip)))^2+1;
dF=numerator/denominator;
end

