"Weight Minimization of Three-Bar Truss Subjected to Stress Constraints"
"Step1: Determination of Nodal Displacements and Internal Forces"

Clear[alfa, q, a, b, G, k, TG, S,STIFF,ISTIFF, u,s]

alfa=45Degree
q={F, 0}

a=Sin[alfa]
b=Cos[alfa]

"Geometry Matrix"
G={{-1,-b,0},{0,a,1}}
MatrixForm[%]

"Local Stiffness Matrix"

k=M/L{{A1,0,0},{0,A2,0},{0,0,A1}}
MatrixForm[%]


"Global Stiffness Matrix"
TG=Transpose[G]
S=k.TG
STIFF=G.S

"Inverse Global Stiffness Matrix"
ISTIFF=Inverse[STIFF]
Simplify[%]

"Nodal Displacements"
u=ISTIFF.q
Simplify[%]

"Internal Forces"
s=-S.u
Simplify[%]