Thread Subject: Summation

Subject: Summation

From: mario

Date: 26 Oct, 2009 20:37:02

Message: 1 of 1

So the element stiffness matrix is the following
K = integral(1/J*[N']^T*R*N'du), where J = [u-.5 -2*u u+.5]*[X(i);X(j);X(k)]
and N' = 1/J*[u-.5 -2*u u+.5]
and [N']^t*[N'] = [(u-.5)^2 -2u(u-.5) (u-.5)(u+.5)
                            -2u(u-.5) 4u^2 -2u(u+.5)
                             (u-.5)(u+.5) -2u(u+.5) (u+.5)^2 ]
we are suppose to integrate using 3 point Gauss-Legendre quadrature
so n=3
k = 1:n
sample points: u(1) = -.774597 u(2) = 0 and u(3) = .774597
weighting factors w(1) = 5/9 w(2) = 8/9 and w(3) = 5/9
the professor did the summation using mathcad (program I hate)... so I was trying to do it using matlab

ne = 4 (number of elements)
n=3 (number of sample points)
u(1), u(2), and u(3) are given
w(1), w(2), and w(3) are given

for i=1:ne
       for j =1:n
        JJ(j) = [u(j) -.5 -2u(j) u(j)+.5]*[X(1,i);X(2,i);X(3,i)]^-1
        NN(:,:,j) = R*w(j)*[(u(j)-.5)^2 -2u(j)(u(j)-.5) (u(j)-.5)(u(j)+.5)
                            -2u(j)(u(j)-.5) 4u(j)^2 -2u(j)(u(j)+.5)
                             (u(j)-.5)(u(j)+.5) -2u(j)(u(j)+.5) (u(j)+.5)^2 ]
end

k(:,:,i) = sum(JJ(j)*NN(:,:,j))
end

needles to say I don't get the [3X3] matrix for each element...can anyone help

thanks,

Mario
         

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com