# local axial and traverse displacements u(x) and w(x) | # local displacement and rotations ujL, tiL, tjL | # local element vector feL, tangent stiffness matrix keL | with(linalg); | deq1≔A11*(diff(u(x),x,x) + diff(w(x),x)*diff(w(x),x,x))=0; | deq2≔A11*(diff(u(x),x,x)*diff(w(x),x) | + diff(u(x),x)*diff(w(x),x,x) | + 3/2*(diff(w(x),x))2*diff(w(x),x,x)) | + A22*diff(w(x),x4)=0; | dsolve(eq1,u(x)); | deq2≔A11*(diff(u(x),x,x)*diff(w(x),x) | + diff(u(x),x)*diff(w(x),x,x) | + 3/2*(diff((x),x))2*diff(w(x),x,x)) | + A22*diff(w(x),x4)=0; | dsolve(eq2,w(x),series); | w(x) ≔subs(w(0)=C3,D(w)(0)=C4,D(D(w))(0)=C5, | D(D(D(w)))(0)=C6,w(x)); | w(x) ≔C3+coeff(w(x),x)*x + coeff(w(x),x2)*x2 | + coeff(w(x),x3)*x3; | u(x) ≔eval(u(x)); | wx≔diff(w(x),x); | eq1≔eval(u(x),x=0);eq2≔eval(w(x),x=0);eq3≔eval(wx,x=0); | eq4≔eval(u(x),x=l);eq5≔eval(w(x),x=l);eq6≔eval(wx,x=l); | solve(eq1=0,eq2=0,eq3=tiL,eq4=ujL,eq5=0,eq6=tjL, | C1,C2,C3,C4,C5,C6); | C1≔(1/30)*(2*rL12*L−L*rL1*rL2+2*L*rL22+30*uL)/L;C2≔0; | C3≔0;C4≔rL1;C5≔−(2*(2*rL1+rL2))/L;C6≔(6*(rL1+rL2))/L2; | u≔−1/40*C62*x5 − 1/8*C5*C6*x4 − 1/6*(C4*C6+C52)*x3 | − 1/2*C4*C5*x2 − 1/2*C42*x+C1*x+C2; | w≔C3+C4*x+1/2*C5*x2+1/6*C6*x3; | u≔collect(u,[ujL,tiL,tjL]); | w≔collect(w,[ujL,tiL,tjL]); | ux≔diff(u,x); | wx≔diff(w,x); wxx≔diff(wx,x); | U≔1/2*int(A11*(ux+1/2*wx2)2+A22*wxx2,x=0..L); | U≔simplify(U); | feL≔grad(U,[ujL,tiL,tjL]); | keL≔hessian(U,[uL,rL1,rL2]); | with(codegen): | fortran(feL,optimized); | fortran(keL,optimized); |
|