kill(all);

List of symbols
delta_B  =   d

rollbar intrusion has to be monitored at the point B, as long as the reaction forces at the rollbar supports A and E.
=> d=?, XA=?, YA=?, CA=?

s is a curvilinear abscissa that spans the beam axis from point to point, 
e.g. from A to B, from B to C, etc.

linear shape functions in the [0,1] interval;

N0(0)=1, N0(1)=0
N1(0)=0, N1(1)=1

two different constructions for defining a functions, NOT STRICTLY equivalent in general, equivalent in the present case

the expression at the define second argument is first evaluated, then assigned to N0. 
Hence, evaluation occurs at definition time.
"pippo", a dummy variable, is treated as a placeholder for the first (and only) 
argument passed to the function at call time. 

define(
    N0( pippo ),
    1-pippo
);

Bending moment definitions

MfAB :
  ( bending moment contributions at each segment first  extreme A) * N0(xi)
+ ( bending moment contributions at each segment second extreme B) * N1(xi)

bending moment contributions inserted in the following order
. force P alone
. reaction force YA alone
. reaction force XA alone
. reaction moment CA alone
. fictitious force F alone

           |------- first extreme ------|        |------- second extreme -----|
           |                            |        |                            |
           |  P .   YA .   XA . CA .   F|        |  P .   YA .   XA . CA .   F|