with(LinearAlgebra); restart

v1 := x^3*a[3]+x^2*a[2]+x*a[1]+a[0]:

r := diff(v1, x):

v[i] := subs(x = 0, v1):

theta[i] := subs(x = 0, r):

v[j] := subs(x = L, v1):

theta[j] := subs(x = L, r):

MD11 := subs(a[0] = 1, a[1] = 0, a[2] = 0, a[3] = 0, v[i]):

MS11 := subs(a[0] = 0, a[1] = 0, a[2] = 0, a[3] = 0, theta[i]):

MT11 := subs(a[0] = 1, a[1] = 0, a[2] = 0, a[3] = 0, v[j]):

MR11 := subs(a[0] = 1, a[1] = 0, a[2] = 0, a[3] = 0, theta[j]):

TM := Matrix(4, 4, [[MD11, MD12, MD13, MD14], [MS11, MS12, MS13, MS14], [MT11, MT12, MT13, MT14], [MR11, MR12, MR13, MR14]]):

with(MTM):

TM1 := inv(TM):

b := Typesetting:-delayDotProduct(TM1, c):

c := `<,>`(v[1], theta[1], v[2], theta[2]):

a[0] := b(1):

a[1] := b(2):

a[2] := b(3):

a[3] := b(4):

vshape := x^3*a[3]+x^2*a[2]+x*a[1]+a[0]:

XX1 := collect(vshape, v[1]):

XX2 := collect(XX1, theta[1]):

XX3 := collect(XX2, v[2]):

XX4 := collect(XX3, theta[2]):

v[1] := 1:

NN1 := XX4:

v[1] := 0:

NN2 := XX4:

v[1] := 0:

NN3 := XX4:

v[1] := 0:

NN4 := XX4:

Mat := `<,>`([NN1, NN2, NN3, NN4]):

Mat1 := diff(Mat, x):

Mat2 := diff(Mat1, x):

segma := Mat2:

KK := EI*expand(Typesetting:-delayDotProduct(segma, transpose(segma))):

KG := int(KK, x = 0 .. L)

KG := Matrix(4, 4, {(1, 1) = 12*EI/L^3, (1, 2) = 6*EI/L^2, (1, 3) = -12*EI/L^3, (1, 4) = 6*EI/L^2, (2, 1) = 6*EI/L^2, (2, 2) = 4*EI/L, (2, 3) = -6*EI/L^2, (2, 4) = 2*EI/L, (3, 1) = -12*EI/L^3, (3, 2) = -6*EI/L^2, (3, 3) = 12*EI/L^3, (3, 4) = -6*EI/L^2, (4, 1) = 6*EI/L^2, (4, 2) = 2*EI/L, (4, 3) = -6*EI/L^2, (4, 4) = 4*EI/L})

(1)

``

NULL


 

Download stiffnesmatrice.mw

 Stiffness matrix implementation of a finite element beam based on Euler-Bernoulli theory stiffnesmatrice.mw


Please Wait...