Clear[a,b,q,G,IG,s,FLEX,TG,delta,ITG,u]

a=Cos[Pi/6]

b=Sin[Pi/6]

q={0,F}

G={{-1,-a},{0,b}}
MatrixForm[G]

IG=Inverse[G]
MatrixForm[IG]
"Internal Forces"
s=-IG.q

FLEX=DiagonalMatrix[{L/(M*A1),L/a/M/A2}]

TG=Transpose[G]

ITG=Inverse[TG]
delta=FLEX.s
"Nodal Displacements"
u=-ITG.delta