kill(   
    all   
);

l : a-h;

I declare two auxiliary functions for linear interpolation along a segment

note: the evalution of the RHS of := is suspended (not performed) at define/assigment time; the suspended evaluation is performed in addition to the usual ones at call time

N1(xi) := 1-xi;

the define function, instead, evaluates as usual its second argument, then it assigns it to the first (which is NEVER evaluated, since object of further assigment, this is an exception of the general rule)

define(
    N2(goofy),
    goofy
);

define(
    mylinearinterpolationonBC(s),
    factor( vBp*N1(s/l)+vCm*N2(s/l) )
);

Components of internal action along the AB segment

M1Ap:0*P+0*YA+0*XA-1*PsiA+0*F $

define(
    M1AB(s),
    M1Ap*N1(s/h)+M1Bm*N2(s/h)
);