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=?, TA=?

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.

C:\Users\manto\Desktop\20190225_lezione_AAE\fig0.png

>>TODO<<

Reaction forces at E may be retrieved based on equilibrium equations

>>TODO<<

sign convention for the bending moment: 
- bending moment is assumed positive if it causes traction at the beam fibers at the frame intrados;
- bending moment is assumed negative if it causes compression at the beam fibers at the frame intrados 
(and traction at the extrados);

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. 

>>TODO<<

the RHS (of :=) expression is NOT evaluated at definition time, remaining as SUSPENDED.
Such SUSPENDED evaluation is performed later, at call time.

>>TODO<<

Here, the two definitions return the same effect.

>>TODO<<

C:\Users\manto\Desktop\20190225_lezione_AAE\fig1.png

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|

>>TODO<<

in order to simplify the expression, I redefine the bending moment based 
on its "expanded" expression.

>>TODO<<

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

>>TODO<<

an alternative definition based on functions of 
the xi argument (vs. expressions) might be employed.
Simple expressions are here employed, for the sake of diversity.

alternative definition based on functions, for the last contribution

define construction is here employed

>>TODO<<

in the above definition, "l" has been evaluated as "a-h"

>>TODO<<

it works..

:= construction is here employed

>>TODO<<

in the above definition, "l" has **NOT** been evaluated as "a-h", 
since the evaluation has been SUSPENDED.

>>TODO<<

it also works (with "a-h" substituted in place of "l"), 
since the SUSPENDED evaluation is performed as an additional evaluation at call time.

elastic internal energy on the various beam segments

in the following integral, ds = len_AB dxi = h * dxi

>>TODO<<

ds = len_BC * dxi = l*dxi

>>TODO<<

ds = len_CD * dxi = b*dxi

>>TODO<<

ds = len_DE * dxi = a*dxi

>>TODO<<

total elastic internal energy

>>TODO<<

Application of the Castigliano's theorem for obtaining the displacements and the rotation at A, 
in particular:
. displacement x at A : uA
. displacement y at A : vA
. rotation (outward z) at A : rA
displacements and rotations are positive if oriented as the associated force/moment, 
see Figure above.

>>TODO<<

Kinematic congruence with respect to the clamp constraint in A is to be enforced, 
by the mean of a system of (linear) equations. 

A system of equations in maxima is expressed in the form of list of equations.

>>TODO<<

The third element of the list is an expression missing the equality symbol. 
In this case, such expression is implicitly assumed to be nullified 
(implicit "=0" if "=" is missing).  

>>TODO<<

I redefine U as a function of P and F alone, by evaluating U under the "sols" hypotheses 
which bond the XA,YA,CA reactions to their values that nullify 
the deflections at the constraint in A. 

>>TODO<<

now, all the P and F contributions to the internal energy U are made explicit;
before the passage above, some of the contributions were hidden within 
the reaction forces and moments XA,YA,CA.

then, the displacement at the B point is evaluated through the Castigliano Theorem

>>TODO<<

an expression that varies proportionally with P and F is returned; 
the "fictitios" nature of F may now be enforced

>>TODO<<

Reactions at A and E can then be defined as a function of F alone

>>TODO<<

Evaluation option
..., infeval
Enables "infinite evaluation" mode ev() repeatedly evaluates an expression
until it stops changing. 

in the command above, a multiple assignement construction based on lists has been employed, 
i.e. [ varA , varB, varC , ... ] : [ exprA , exprB , exprC , ...];

The displacement at the P force application point (point C) may be retrieved 
e.g. by positioning the B sampling point in C, i.e. imposing h=a. 

>>TODO<<