# Thread: how to calculate the matrices in finite element analysis

1. ## how to calculate the matrices in finite element analysis

Hi
I generally have problems in calculating the matrices in the finite element method.eg
$\phi(x)=1-\left |x\right| if \left|x\right|\le1$
$\phi(x)=0 if \left |x\right|> 1$
$\phi_{j}(x)=\phi(\frac{x-x_{j}}{h}) where 0\le j \le n+1$
$K_{h}=(\int_0^1\phi_{j}^{\prime}(x)\phi^{\prime}_{ i}(x)dx)_{1\le i,j \le n}$
how to calculate the matrix $K_{h}$?
thanks

2. ## Re: how to calculate the matrices in finite element analysis

you have to check for when |(x-x_j)/h|<=1, obviouslt when x is in [x_j-h,x_j+h] now x also should be between [x_i-h,x_i+h]
Now check for the next cases:
1. both intervals are inside the interval [0,1]
2. one interval its lower endpoint is smaller than 0 and it's higher endpoint is in [0,1], the second interval is totally inside [0,1] (the same symmetric case by changing the intervals).
3. both intervals have their lower endpoints below 0 and their highest endpoints inside [0,1]. (and the opposite case where the highest endpoints are above 1 and the lower endpoints inside [0,1]).
4. like case 2 but changing 0 with 1 and lower endpoint with higher endpoint.

In each case you should determine the integral limits, by deciding on lower limit to be max{0,x_j-h, x_i-h} and upper limit to be min{1,x_j-h,x_i-h}.

Sorry I can't help you more than that, I am kinda busy myself.