0% found this document useful (0 votes)
84 views19 pages

Midsem: CE620 Mid-Sem On 24 Feb 2021 From 09h00 To 11h00

The document provides a midterm exam with 6 problems related to structural analysis and heat transfer using finite element methods. The problems involve determining displacement fields, error norms, and temperature distributions for beams, strings, and bars under different loading and boundary conditions. Students are asked to solve the problems by hand and submit photo(s) of their work showing steps.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views19 pages

Midsem: CE620 Mid-Sem On 24 Feb 2021 From 09h00 To 11h00

The document provides a midterm exam with 6 problems related to structural analysis and heat transfer using finite element methods. The problems involve determining displacement fields, error norms, and temperature distributions for beams, strings, and bars under different loading and boundary conditions. Students are asked to solve the problems by hand and submit photo(s) of their work showing steps.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

01/03/2021 SAFE

Midsem
CE620 mid-sem on 24 Feb 2021 from 09h00 to 11h00

1.

Consider a simply supported beam of length l that is subjected to end moments as shown. The
bending moment M(x) in the beam is linear as given. The equation of the beam is:

Here, is the vertical displacement of the beam which is zero at both the ends. It is given that
and .

Answer the following questions:


1.

If you solve the problem using Galerkin method, with an approximate function for displacement of
the form, over the entire domain, what would be the
values of the coefficients of this function?
2.

If you solve the problem with finite element analysis using a single four-node element, with
uniformly spaced nodes, what will be the values of displacement at the nodes of the element?
3.

What is the L2 error norm for obtained in (2) when compared with the exact solution?
4.

If you solve the problem using finite element analysis with three equal length two-node elements,
what will be the values of displacement at the center of each element?

Write the solution neatly on plain sheet(s) of paper showing all the steps properly. Take clear
photo(s) of the solution using SAFE App as a part of the exam.
Marks: 7
Type: IMAGE_ANSWER_TYPE
Rubrics:
Comments:
https://kiwi.safe-analytics.in/quiz/8803/print 1/4
01/03/2021 SAFE

2.

Consider a simply supported beam of length l that is subjected to end moments as shown. The
bending moment M(x) in the beam is linear as given. The equation of the beam is:

Here, is the vertical displacement of the beam which is zero at both the ends. It is given that
and .

Answer the following questions:


1.

If you solve the problem using Galerkin method, with an approximate function for displacement of
the form, over the entire domain, what would be the
values of the coefficients of this function?
2.

If you solve the problem with finite element analysis using a single four-node element, with
uniformly spaced nodes, what will be the values of displacement at the nodes of the element?
3.

What is the L2 error norm for obtained in (2) when compared with the exact solution?
4.

If you solve the problem using finite element analysis with three equal length two-node elements,
what will be the values of displacement at the center of each element?

Write the solution neatly on plain sheet(s) of paper showing all the steps properly. Take clear
photo(s) of the solution using SAFE App as a part of the exam.
Marks: 7
Type: IMAGE_ANSWER_TYPE
Rubrics:
Comments:

3.

Equation of a taut string of length l on an elastic foundation is given by:

https://kiwi.safe-analytics.in/quiz/8803/print 2/4
01/03/2021 SAFE

Here, is the vertical displacement of the string, T is the string tension, k is the foundation stiffness
and p is the constant applied force per unit length. The string displacement is zero at both its ends. It is
given that and .

Answer the following questions:


1.

Obtain the weak form for the problem.


2.

If the weak form is solved using finite element analysis, where will the contribution from the term
go?
3.

Based on (1) and (2), use two three node elements of equal size, with uniformly spaced nodes in
each, to obtain the displacement at the center of the string. Use appropriate Gauss Quadrature if
required.
4.

What happens to the stiffness matrix if one point Gauss quadrature is used?

Write the solution neatly on plain sheet(s) of paper showing all the steps properly. Take clear
photo(s) of the solution using SAFE App as a part of the exam.
Marks: 7
Type: IMAGE_ANSWER_TYPE
Rubrics:
Comments:

4.

Equation of a taut string of length l on an elastic foundation is given by:

Here, is the vertical displacement of the string, T is the string tension, k is the foundation stiffness
and p is the constant applied force per unit length. The string displacement is zero at both its ends. It is
given that and .

Answer the following questions:


1.

Obtain the weak form for the problem.


2.

If the weak form is solved using finite element analysis, where will the contribution from the term
go?
3.
https://kiwi.safe-analytics.in/quiz/8803/print 3/4
01/03/2021 SAFE

Based on (1) and (2), use two three node elements of equal size, with uniformly spaced nodes in
each, to obtain the displacement at the center of the string. Use appropriate Gauss Quadrature if
required.
4.

What happens to the stiffness matrix if one point Gauss quadrature is used?

Write the solution neatly on plain sheet(s) of paper showing all the steps properly. Take clear
photo(s) of the solution using SAFE App as a part of the exam.
Marks: 7
Type: IMAGE_ANSWER_TYPE
Rubrics:
Comments:

5.

Consider a heat conduction problem in the domain [0, 20] m. The bar has a unit cross section A,
constant thermal conductivity k = 5 W oC-1 m-1 and a uniform heat source s = 100 W m-1. The
boundary conditions are T(x = 0) = 0 oC and the heat influx into the bar
Solve the problem with two equal linear elements. Plot the finite element solution and
and compare with the exact solution given by What is the
error in the derivative, corresponding to the energy norm, between the exact and the finite element
solution?

Write the solution neatly on plain sheet(s) of paper showing all the steps properly. Take clear
photo(s) of the solution using SAFE App as a part of the exam.
Marks: 6
Type: IMAGE_ANSWER_TYPE
Rubrics:
Comments:

6.

Consider a heat conduction problem in the domain [0, 10] m. The bar has a unit cross section A,
constant thermal conductivity k = 20 W oC-1 m-1 and a uniform heat source s = 200 W m-1. The
boundary conditions are T(x = 0) = 0 oC and the heat influx into the bar
Solve the problem with two equal linear elements. Plot the finite element solution and
and compare with the exact solution given by What is the
error in the derivative, corresponding to the energy norm, between the exact and the finite element
solution?

Write the solution neatly on plain sheet(s) of paper showing all the steps properly. Take clear
photo(s) of the solution using SAFE App as a part of the exam.
Marks: 6
Type: IMAGE_ANSWER_TYPE
Rubrics:
Comments:

https://kiwi.safe-analytics.in/quiz/8803/print 4/4
Problem 1

Part:1 Weak form of the BVP.


By antisymmetry in the loading M(x) the even power terms in uapprox will have zero coefficients.
��������� Clear["Global`*"]
uapp = α1 x + α2 x3 ;
wapp = β1 x + β2 x3 ;

We put the boundary conditions u(-l/2) = u(l/2) = w(-l/2) = w(l/2) = 0.


��������� eq[1] = uapp /. x → l  2;
eq[2] = wapp /. x → l  2;
Uapp = uapp /. Solve[eq[1] ⩵ 0, α2][[1]]
Wapp = wapp /. Solve[eq[2] ⩵ 0, β2][[1]]
x
M[x_] := - 2 mo
l
4 x3 α1
��������� x α1 -
l2
4 x3 β1
��������� x β1 -
l2
2 ��� Solutions.nb

��������� IntegrateEI D[Uapp, x] × D[Wapp, x], x, - l  2, l  2 +


IntegrateWapp M[x], x, - l  2, l  2
% /. β1 → 1;
Uapprox[x_] = Uapp /. Solve[% ⩵ 0, α1][[1]] // Expand(* solution *)
α1 = Coefficient[%, x]
α3 = Coefficient%%, x3 
1 4
��������� - l2 mo β1 + EI l α1 β1
15 5
l mo x mo x3
��������� -
12 EI 3 EI l
l mo
���������
12 EI
mo
��������� -
3 EI l

Note that, other way to do the problem is to solve is exactly. Since the solution will be a third order
polynomial, it will be exact.
��������� Uexact = u /. DSolveEI u ''[x] - M[x] ⩵ 0, u- l  2 ⩵ ul  2 ⩵ 0, u, x[[1]];
Uexact[x] // Expand
l mo x mo x3
��������� -
12 EI 3 EI l

All other questions will be solvable with simple logic.


(2) A single 4-node element will have third order polynomial interpolation over the entire element
and it will mimic the function exactly.

The value of the function at the nodes will be the same as that of the exact function:
��������� Unodes = Uapprox- l  2, Uapprox- l  6, Uapproxl  6, Uapproxl  2
l2 mo l2 mo
��������� 0, - , , 0
81 EI 81 EI

(3) L2 norm for the error will be zero since the FEA solution and the exact solution will be the same.

(4) The displacements at the nodes of three two node elements is the same as for the 3 node ele-
ments. The value at the center of each element
1
��������� Ucenter = {Unodes[[1]] + Unodes[[2]],
2
Unodes[[2]] + Unodes[[3]], Unodes[[3]] + Unodes[[4]]}
l2 mo l2 mo
��������� - , 0, 
162 EI 162 EI

We now obtain the exact numerical values


Solutions.nb ��� 3

��������� (* Case-1: displacement in meters *)


Vals = EI → 5 × 105 , mo → 20 × 103 , l → 30;
{α1, α3} /. Vals (* part 1 *)
Unodes /. Vals (* part 2 *)
Ucenter /. Vals (* part 3 *)
1 1
���������  ,- 
10 2250
4 4
��������� 0, - , , 0
9 9
2 2
��������� - , 0, 
9 9

��������� (* Case-2: displacement in meters *)


Vals = EI → 15 × 105 , mo → 5 × 103 , l → 60;
{α1, α3} /. Vals (* part 1 *)
Unodes /. Vals (* part 2 *)
Ucenter /. Vals (* part 3 *)
1 1
���������  ,- 
60 54 000
4 4
��������� 0, - , , 0
27 27
2 2
��������� - , 0, 
27 27

Problem 2
4 ��� Solutions.nb

(1) Weak form of the solution is:

L d w(x) L L
∫0  dx
 T d du(x)
x
 dx + ∫0 k w(x) u(x) dx = ∫0 p w(x) dx

find u(x) in H1 such that u(0) = u(l) = 0 and w(x) in H1 such that w(0) = w(l) = 0.

(2) The contribution of the -k u(x) term will go to the stiffness matrix.

(3) The two three node elements will create the exact same contributions. We need to create a
stiffness matrix only for one element. The stiffness matrix will exactly be the same for the other
element.
��������� Clear["Global`*"]
x - l  4 x - l  2
N1[x] =
0 - l  4 0 - l  2
x - 0 x - l  2
N2[x] =
l  4 - 0 l  4 - l  2
x - 0 x - l  4
N3[x] =
l  2 - 0 l  2 - l  4

8 - l + x - l + x
2 4
���������
l2

16 x - l + x
2
��������� -
l2

8 x - l + x
4
���������
l2
Solutions.nb ��� 5

��������� n = {N1[x], N2[x], N3[x]};


dndx = {D[N1[x], x], D[N2[x], x], D[N3[x], x]} // Expand
B1 = Outer[Times, dndx, dndx] // Expand
% // MatrixForm
IntegrateB1, x, 0, l  2;
K1 = T %;
MatrixForm[%]

6 16 x 8 32 x 2 16 x
��������� - + , - ,- + 
l l2 l l2 l l2
36 192 x 256 x2 48 320 x 512 x2 12 128 x 256 x2
���������  - + ,- + , - , - +
l2 l3 l4 l2 l3 l4 l2 l3 l4
48 320 x 512 x2 64 512 x 1024 x2 16 192 x 512 x2
- + - , - + ,- + - ,
l2 l3 l4 l2 l3 l4 l2 l3 l4
12 128 x 256 x2 16 192 x 512 x2 4 64 x 256 x2
 - + ,- + - , - + 
l2 l3 l4 l2 l3 l4 l2 l3 l4
���������������������
36 192 x 256 x2 512 x2 256 x2
- + - 482 + 320 x
- 12
- 128 x
+
l2 l3 l4 l l3 l4 l2 l3 l4
512 x2 1024 x2 512 x2
- 482 + 320 x
- 64
- 512 x
+ - 162 + 192 x
-
l l3 l4 l2 l3 l4 l l3 l4
12 128 x 256 x2 512 x2 256 x2
- + - 162 + 192 x
- 4
- 64 x
+
l2 l3 l4 l l3 l4 l2 l3 l4

���������������������
14 T
- 16 T 2T
3l 3l 3l
- 16 T 32 T
- 16 T
3l 3l 3l
2T
- 16 T 14 T
3l 3l 3l

Similarly the contribution to the stiffness element will come the second term as follows:
��������� Bs1 = Outer[Times, n, n] // Expand;
MatrixForm[Bs1]
Ks1 = k IntegrateBs1, x, 0, l  2;
Ks1 // MatrixForm
���������������������
12 x 52 x2 96 x3 64 x4 8x 64 x2 160 x3 128 x4 20 x2 64 x3 64 x4
1- + - + - + - - 2x + - +
l l2 l3 l4 l l2 l3 l4 l l2 l3 l4
8x 64 x2 160 x3 128 x4 64 x2 256 x3 256 x4 2
96 x3 128 x4
- + - - + - 16 2x + -
l l2 l3 l4 l2 l3 l4 l l3 l4
20 x2 64 x3 64 x4 2
96 x3 128 x4 4 x2 32 x3 64 x4
- 2x + - + - 16 2x + - - +
l l2 l3 l4 l l3 l4 l2 l3 l4

���������������������
kl kl
- kl
15 30 60
kl 4kl kl
30 15 30
- kl kl kl
60 30 15

The body for is simply:


6 ��� Solutions.nb

��������� f1 = p Integraten, x, 0, l  2;


MatrixForm[f1]
���������������������
lp
12
lp
3
lp
12

The stiffness matrix for the problem will be given by:


��������� K = ConstantArray[0, {3, 3}];
K[[{1, 2}, {1, 2}]] =
K[[{1, 2}, {1, 2}]] + K1[[{2, 3}, {2, 3}]] + Ks1[[{2, 3}, {2, 3}]];
K[[{2, 3}, {2, 3}]] = K[[{2, 3}, {2, 3}]] +
K1[[{1, 2}, {1, 2}]] + Ks1[[{1, 2}, {1, 2}]];
MatrixForm[
K]
���������������������
4kl
+ 32 T kl
- 16 T 0
15 3l 30 3l
kl
- 16 T 2kl
+ 28 T kl
- 16 T
30 3l 15 3l 30 3l
kl
0 - 16 T 4kl
+ 32 T
30 3l 15 3l

Adding the body force:


��������� f = ConstantArray[0, {3}];
f[[{1, 2}]] = f[[{1, 2}]] + f1[[{2, 3}]];
f[[{2, 3}]] = f[[{2, 3}]] + f1[[{1, 2}]];
MatrixForm[f]
���������������������
lp
3
lp
6
lp
3

Since we have obtained the body forces, we only need to invert the matrix:
��������� Ufea = LinearSolve[K, f]
l2 p 7 k l2 + 720 T
���������  ,
2 3 k2 l4 + 416 k l2 T + 3840 T2 
2 l2 p k l2 + 240 T l2 p 7 k l2 + 720 T
, 
3 k2 l4 + 416 k l2 T + 3840 T2 2 3 k2 l4 + 416 k l2 T + 3840 T2 

Solving the problem exactly:


��������� U = u /. DSolve[{T u ''[x] - k u[x] + p ⩵ 0, u[0] ⩵ 0, u[l] ⩵ 0}, u, x][[1]]
k x k x k l k x
-
ⅇ T -1 + ⅇ T -ⅇ T +ⅇ T p
��������� Function{x}, - 
k l

1+ⅇ T k

��������� Unodes = Ul  4, Ul  2, U3 l  4 // Expand;


Solutions.nb ��� 7

��������� (* Case-1 *)
Vals = {T → 100, k → 10, p → 10, l → 8.}
K1 /. Vals // MatrixForm (* element stiffness matrix *)
Ks1 /. Vals // MatrixForm (* -k u, contribution to stiffness matrix *)
% + %% // MatrixForm
f1 /. Vals // MatrixForm (* element body force *)
K /. Vals // MatrixForm (* 3x3 stiffness *)
f /. Vals // MatrixForm (* body force *)
Unodes /. Vals (* displacement at interior nodes exact solution *)
Ufea /. Vals (* displacement at interior nodes FEA solution*)
��������� {T → 100, k → 10, p → 10, l → 8.}
���������������������
58.3333 - 66.6667 8.33333
- 66.6667 133.333 - 66.6667
8.33333 - 66.6667 58.3333
���������������������
5.33333 2.66667 - 1.33333
2.66667 21.3333 2.66667
- 1.33333 2.66667 5.33333
���������������������
63.6667 - 64. 7.
- 64. 154.667 - 64.
7. - 64. 63.6667
���������������������
6.66667
26.6667
6.66667
���������������������
154.667 - 64. 0
- 64. 127.333 - 64.
0 - 64. 154.667
���������������������
26.6667
13.3333
26.6667

��������� Unodes

��������� {0.369397, 0.476043, 0.369397}


8 ��� Solutions.nb

��������� (* Case-2 *)
Vals = {T → 50, k → 50, p → 10, l → 4.}
K1 /. Vals // MatrixForm (* element stiffness matrix *)
Ks1 /. Vals // MatrixForm (* -k u, contribution to stiffness matrix *)
f1 /. Vals // MatrixForm (* element body force *)
K /. Vals // MatrixForm (* 3x3 stiffness *)
f /. Vals // MatrixForm (* body force *)
Unodes /. Vals (* displacement at interior nodes exact solution *)
Ufea /. Vals (* displacement at interior nodes FEA solution*)
��������� {T → 50, k → 50, p → 10, l → 4.}
���������������������
58.3333 - 66.6667 8.33333
- 66.6667 133.333 - 66.6667
8.33333 - 66.6667 58.3333
���������������������
13.3333 6.66667 - 3.33333
6.66667 53.3333 6.66667
- 3.33333 6.66667 13.3333
���������������������
3.33333
13.3333
3.33333
���������������������
186.667 - 60. 0
- 60. 143.333 - 60.
0 - 60. 186.667
���������������������
13.3333
6.66667
13.3333

��������� Unodes

��������� {0.118182, 0.145455, 0.118182}

Additional check with a single 3 node element.


��������� (* Case-1 *)
Vals = {T → 100, k → 10, p → 10, l → 16.}
K1 + Ks1 /. Vals // MatrixForm
f1 /. Vals // MatrixForm
%[[2]]  %%[[2, 2]]
��������� {T → 100, k → 10, p → 10, l → 16.}
���������������������
39.8333 - 28. 1.5
- 28. 109.333 - 28.
1.5 - 28. 39.8333
���������������������
13.3333
53.3333
13.3333

��������� 0.487805
Solutions.nb ��� 9

��������� (* Case-1 *)
Vals = {T → 50, k → 50, p → 10, l → 8.}
K1 + Ks1 /. Vals // MatrixForm
f1 /. Vals // MatrixForm
%[[2]]  %%[[2, 2]]
��������� {T → 50, k → 50, p → 10, l → 8.}
���������������������
55.8333 - 20. - 2.5
- 20. 173.333 - 20.
- 2.5 - 20. 55.8333
���������������������
6.66667
26.6667
6.66667

��������� 0.153846

Note that in this case, even though the nodal value is very similar to the exact solution, it is not
exactly the same since the exact solution is not a polynomial but has exponential form.

Finally to check the part where we use a single order Gauss Quadrature.
��������� Xi[n_] := Solve[LegendreP[n, x] ⩵ 0, x]
2
W[n_] := /. Xi[n]
1 - x2  D[LegendreP[n, x], x]2

Will do this only for Vals-1


��������� Vals = {T → 100, k → 10, p → 10, l → 8.};
T B1 /. Vals;
MatrixForm[%];
k Bs1 /. Vals;
MatrixForm[%];
B[x_] = %% + %%%%;
MatrixForm[%]; // FullSimplify;
1 l ξ l
B[x] /. x → 0 + + -0 /. Vals;
2 2 2 2
MatrixForm[%]

���������������������

100 0.5625 - 0.375 2. + 2. ξ + 0.0625 2. + 2. ξ2  + 10 1 - 1.5 2. + 2. ξ + 0.8125 2. +
100 - 0.75 + 0.625 2. + 2. ξ - 0.125 2. + 2. ξ2  + 10 1. 2. + 2. ξ - 1. 2. + 2. ξ
100 0.1875 - 0.25 2. + 2. ξ + 0.0625 2. + 2. ξ2  + 10 - 0.25 2. + 2. ξ + 0.3125 2. +

Fourth order polynomial:


p ≤ 2 ngp - 1
we need three Gauss points for exact solution of the problem.
��������� ξi[[2]]

3
��������� -
5
10 ��� Solutions.nb

��������� ξi = x /. Xi[3]
wi = W[3]
1 l ξ l
B[x] /. x → 0 + + -0 /. Vals;
2 2 2 2
l
wi[[1]] % /. ξ → ξi[[1]] +
4
wi[[2]] % /. ξ → ξi[[2]] + wi[[3]] % /. ξ → ξi[[3]] /. Vals;
K1 = MatrixForm[
%]

3 3
��������� 0, - , 
5 5
8 5 5
���������  , , 
9 9 9
���������������������
63.6667 - 64. 7.
- 64. 154.667 - 64.
7. - 64. 63.6667

Note that this element matrix is exactly the same as obtained before for question set. The assembly
will give the same stiffness matrix as before. That matrix was obviously invertible.

If now we use a single Gauss Point, we will get:


��������� ξi = x /. Xi[1]
wi = W[1]
1 l ξ l
B[x] /. x → 0 + + -0 /. Vals;
2 2 2 2
l
wi[[1]] % /. ξ → ξi[[1]] /. Vals;
4
K1 = MatrixForm[%]
��������� {0}

��������� {2}
���������������������
25. 0. - 25.
0. 40. 0.
- 25. 0. 25.

The stiffness matrix that we get from here will be:


��������� Kred = {{40, 0, 0}, {0, 25, 0}, {0, 0, 0}} + {{0, 0, 0}, {25, 0, 0}, {0, 40, 0}};
MatrixForm[Kred]
���������������������
40 0 0
25 25 0
0 40 0

This matrix is, of course, not invertible since it has one column of zeros. However, I will not penalize
you too much if you do not put in so much effort, but kinda work towards this solution. A similar
question was present in HW-3.
Solutions.nb ��� 11

Problem 3

This is a straightforward problem. You can just look into the solved problem in the class from Fish
and Belytschko.

Both elements are exactly the same with length l/2.


Ak
��������� K1 = {{1, - 1}, {- 1, 1}};
l2
MatrixForm[%]
sl2
f1 = {1, 1};
2
MatrixForm[%]
���������������������
2Ak
- 2Ak
l l
- 2Ak 2Ak
l l

���������������������
ls
4
ls
4

The total global stiffness and the forcing matrix is given as:
Ak
��������� K = {{1, - 1, 0}, {- 1, 2, - 1}, {0, - 1, 1}};
l2
MatrixForm[K]
sl2
f = {1, 2, 1};
2
-
(* q = 0 so this does not contribute *)
MatrixForm[f]
���������������������
2Ak
- 2Ak 0
l l
- 2Ak 4Ak
- 2Ak
l l l
0 - 2Ak 2Ak
l l

���������������������
ls
4
ls
2
ls
4

Since T = 0 for node-1, we only need the lower 2,3 rows and columns.
12 ��� Solutions.nb

��������� Kp = K[[{2, 3}, {2, 3}]];


fp = f[[{2, 3}]];
Tnodes = LinearSolve[Kp, fp]
3 l2 s l2 s
���������  , 
8Ak 2Ak

Now to compare with the exact solution. Since this is polynomial, we should expect exact match at
the nodes.
��������� Temp = T /. DSolve[{k A T ''[x] + s ⩵ 0, T[0] ⩵ 0, - k T '[l] ⩵ 0}, T, x][[1]];

��������� Templ  2, Temp[l]


3 l2 s l2 s
���������  , 
8Ak 2Ak

��������� (* Case-1 *)
Vals = {A → 1, k → 5, l → 20, s → 100., q → 0.} ;
Temp[x] /. Vals // Expand
K /. Vals;
MatrixForm[%]
f /. Vals;
MatrixForm[%]
Tnodes /. Vals
Templ  2, Temp[l] /. Vals
Templ  2 - 0 Temp[l] - Templ  2
dTdx =  ,  /. Vals
l2 l2
dTdxEx = D[Temp[x] /. Vals, x]
EnergyError = IntegratedTdxEx - dTdx[[1]]2 , x, 0, l  2 +
IntegratedTdxEx - dTdx[[2]]2 , x, l  2, l /. Vals
EnergyNorm = IntegratedTdxEx2 , {x, 0, l} /. Vals
EnergyError
ϵ =
EnergyNorm
Plot[Temp[x] /. Vals, {x, 0, l} /. Vals];
ListPlot{0, 0}, l  2, Tnodes[[1]], {l, Tnodes[[2]]} /. Vals,
Joined → True, Frame → True, FrameLabel → {x, T};
Show[
%,
%%]
��������� 400. x - 10. x2
���������������������
1
-1 0
2 2
-1 1 -1
2 2
0 -1 1
2 2

���������������������
500.
1000.
500.
Solutions.nb ��� 13

��������� {3000., 4000.}

��������� {3000., 4000.}

��������� {300., 100.}

��������� 10. 40 - 2 x

��������� 66 666.7

��������� 1.06667 × 106

��������� 0.0625

4000

3000
T

2000
���������

1000

0
0 5 10 15 20
x

��������� Tnodes /. Vals


��������� {3000., 4000.}
14 ��� Solutions.nb

��������� (* Case-1 *)
Vals = {A → 1, k → 20, l → 10, s → 200., q → 0.} ;
Temp[x] /. Vals // Expand
K /. Vals;
MatrixForm[%]
f /. Vals;
MatrixForm[%]
Tnodes /. Vals
Templ  2, Temp[l] /. Vals
Templ  2 - 0 Temp[l] - Templ  2
dTdx =  ,  /. Vals
l2 l2
dTdxEx = D[Temp[x] /. Vals, x]
EnergyError = IntegratedTdxEx - dTdx[[1]]2 , x, 0, l  2 +
IntegratedTdxEx - dTdx[[2]]2 , x, l  2, l /. Vals
EnergyNorm = IntegratedTdxEx2 , {x, 0, l} /. Vals
EnergyError
ϵ =
EnergyNorm
Plot[Temp[x] /. Vals, {x, 0, l} /. Vals];
ListPlot{0, 0}, l  2, Tnodes[[1]], {l, Tnodes[[2]]} /. Vals,
Joined → True, Frame → True, FrameLabel → {x, T};
Show[
%,
%%]
��������� 100. x - 5. x2
���������������������
4 -4 0
-4 8 -4
0 -4 4
���������������������
500.
1000.
500.

��������� {375., 500.}

��������� {375., 500.}

��������� {75., 25.}

��������� 5. 20 - 2 x

��������� 2083.33

��������� 33 333.3

��������� 0.0625
Solutions.nb ��� 15

500

400

300
T

���������
200

100

0
0 2 4 6 8 10
x

You might also like