Solving y'' - 4y = 0 Using Finite Element Analysis(using weak function)

59 Views Asked by At

What did I do wrong?please hint. i solve this eq similar to bar eq $EA\frac{d^2U}{dx^2}+f=0$. I want to make stiffness matrix Kq=R

$y''-4y=0, BC1:y(0)=1, BC2:y(1)=2$

  1. Try to the Finite Elements Formulations using Weak form
  2. Solve the eqation by Finite Element Formulations. Divide elements equally with five nodes.

1: Weak Formulation

First, I reformulated the given differential equation by multiplying it with $dx$ and $δy$, resulting in the following integral expression:

$\int_{0}^{1}(y''δy - 4yδy) dx = 0$

I then used integration by parts to transform the integral expression into the following form:

$\left.y'δy\right\rvert_0^1 - \int_{0}^{1}y'δy dx =\int_{0}^{1} 4yδy dx$

but i think δy at x=0 and x=1 is 0. so

$-\int_{0}^{1}y'δy dx =\int_{0}^{1} 4yδy dx$

2. using shape function(local value)

To further analyze this equation, I divided the interval [0, 1] into five nodes and expressed y and δy within each element as follows:

$y(s) = as + b$ $δy(s) = as + b$ $x(s) = as + b$

This allows us to represent y(s) as $(1-s)y_1 + sy_2$ and $x(s) as (1-s)x_1 + sx_2$ and δy(s) as $(1-s)δy_1 + sδy_2$. it can change y(s)=$\begin{bmatrix} 1-s & s \\ \end{bmatrix}\begin{bmatrix} y_1 \\ y_2 \end{bmatrix} $. δy is same to.

and its derivation

$ \frac{dy}{ds}=\begin{bmatrix} -1 & 1 \\ \end{bmatrix}\begin{bmatrix} y_1 \\ y_2 \end{bmatrix}$, $ \frac{dδy}{ds}=\begin{bmatrix} δy_1 & δy_2 \\ \end{bmatrix}\begin{bmatrix} -1 \\1 \end{bmatrix}$, $\frac{dx}{ds}=x_2-x_1=h$

3. Substitution

$\sum_{i=1}^{4} -\int_{i}^{}y'_i δy_i dx =\sum_{i=1}^{4} \int_{i}^{} 4y_iδy dx$

when i=1, $-\int_{0}^{1}\begin{bmatrix} -1 & 1 \\ \end{bmatrix}\begin{bmatrix} y_1 \\ y_2 \end{bmatrix} \frac{1}{h} \begin{bmatrix} δy_1 & δy_2 \\ \end{bmatrix}\begin{bmatrix} -1 \\1 \end{bmatrix}\frac{1}{h} hds =\int_{0}^{1} 4\begin{bmatrix} 1-s & s \\ \end{bmatrix}\begin{bmatrix} y_1 \\ y_2 \end{bmatrix}\begin{bmatrix} δy_1 & δy_2 \\ \end{bmatrix}\begin{bmatrix} -1 \\1 \end{bmatrix} hds$

it changes to

$\begin{bmatrix} δy_1 & δy_2 \\ \end{bmatrix}\begin{bmatrix} b1 & b2 \\ b3 & b4 \\ \end{bmatrix}\begin{bmatrix} y_1 \\y_2 \end{bmatrix}=\begin{bmatrix} δy_1 & δy_2 \\ \end{bmatrix}\begin{bmatrix} b1 & b2 \\ b3 & b4 \\ \end{bmatrix}\begin{bmatrix} y1 \\y2 \end{bmatrix}$

i don't know why $\begin{bmatrix} y1 \\y2 \end{bmatrix}$ is exist both side.