You are on page 1of 3

1/28/11 9:05 PM MATLAB Command Window 1 of 3

28-Jan-2011 21:02:28

FEM1D
MATLAB version

Solve the two-point boundary value problem:

-d/dx (p(x) du/dx) + q(x)*u = f(x)

on an interval [xl,xr], with the values of


u or u' specified at xl and xr.

The interval is broken into 100 subintervals.


The number of basis functions per element is 2

The equation is to be solved for


X greater than XL = 0.000000
and less than XR = 1.000000

The boundary conditions are:

At X = XL, U = 0.000000
At X = XR, U' = 1.000000

Number of quadrature points per element is 1

Node Location

First 10 nodes:

1: 0.000000
2: 0.010000
3: 0.020000
4: 0.030000
5: 0.040000
6: 0.050000
7: 0.060000
8: 0.070000
9: 0.080000
10: 0.090000

Subint Length

First 10 interval widths:

1: 0.010000
2: 0.010000
3: 0.010000
4: 0.010000
5: 0.010000
1/28/11 9:05 PM MATLAB Command Window 2 of 3

6: 0.010000
7: 0.010000
8: 0.010000
9: 0.010000
10: 0.010000

Subint Quadrature point

First 10 quadrature points:

1: 0.005000
2: 0.015000
3: 0.025000
4: 0.035000
5: 0.045000
6: 0.055000
7: 0.065000
8: 0.075000
9: 0.085000
10: 0.095000

First 10 pairs of nodes defining intervals:


Subint Left Node Right Node

1 0 1
2 1 2
3 2 3
4 3 4
5 4 5
6 5 6
7 6 7
8 7 8
9 8 9
10 9 10

First 10 unknown indices


Node Unknown

0 -1
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9

First 10 rows of tridiagonal linear system:

Equation ALEFT ADIAG ARITE RHS


1/28/11 9:05 PM MATLAB Command Window 3 of 3

1 200.000000 -100.000000 0.000000


2 -100.000000 200.000000 -100.000000 0.000000
3 -100.000000 200.000000 -100.000000 0.000000
4 -100.000000 200.000000 -100.000000 0.000000
5 -100.000000 200.000000 -100.000000 0.000000
6 -100.000000 200.000000 -100.000000 0.000000
7 -100.000000 200.000000 -100.000000 0.000000
8 -100.000000 200.000000 -100.000000 0.000000
9 -100.000000 200.000000 -100.000000 0.000000
10 -100.000000 200.000000 -100.000000 0.000000

First 10 entries of computed solution:

Node X(I) U(I)

0 0.000000 0.000000
1 0.010000 0.010000
2 0.020000 0.020000
3 0.030000 0.030000
4 0.040000 0.040000
5 0.050000 0.050000
6 0.060000 0.060000
7 0.070000 0.070000
8 0.080000 0.080000
9 0.090000 0.090000

FEM1D:
Normal end of execution.

28-Jan-2011 21:02:28
>>

You might also like