In the third picture , I dont understand the circled part , add up the values in the diagonal .. How to do that ?
I dont understand how to get k13 , k14 , k21 , k22 , k33, k41 and k42 . As we see in the second picture , the k21 and k22 = -20 and 20 respectively , why in the third picture , the k1 and k22 become -20 and 40 ?
: ttps://i.stack.imgur.com/nOiDU.jpg : ttps://i.stack.imgur.com/dg92C.jpg : ttps://i.stack.imgur.com/yijY8.jpg : ttps://i.stack.imgur.com/dUHUL.jpg : ttps://i.stack.imgur.com/c8HCV.jpg
For a one-dimensional FEM, interactions on the basis functions only affect certain subdivisions lf your domain. Any time you have a node that is in two different intervals, say $(a, b)$ and $(b, c)$, you need to count its contribution twice in your stiffness matrix $K$. In the example I've outlined, $b$ is a nodw lying in two subintervals, so you must consider its contribution twice.
The stiffness matrix is built by this overlaying pattern, and diagonal entries (except $k_{11}$ and $k_{nn}$) are counted twice based on the intervals the corresponding nodes lie.