Clear the memory in order to have the subsequent code running in a clean environment.

kill(
    all
);

Calculate reaction forces at supports A and B

rotAeq : - F*a + YB*(a+b)=0;

ideally,
":"( rotAeq , - F*a + YB*(a+b)=0 );

vteq : +YA+YB-F=0;

rotAeq;

sols : linsolve( [rotAeq , vteq] , [YA,YB] );

[YA,YB] : ev([YA,YB] , sols);

now I can write the bending moments

MfAC:YA*sAC;

MfBC:YB*sBC;

bending moment at the loaded cross section

ev(MfAC,sAC=a);

ev(MfBC,sBC=b);