APL 705 Lab Assignment 1 1. Evaluate the following expressions a

APL 705
Lab Assignment 1
1. Evaluate the following expressions
a.
b.
c.
d.
e.
3*3+4/2
5/2 -2\5
floor (6/4)
round (5/2)
ceil (3/4)
2. Array operation
Create a vector x with the elements
a. 2, 4, 6, 8, ...
b. 10, 8, 6, 4, 2, 0, -2, -4
c. 1, 1/2, 1/3, 1/4, 1/5, ...
d. 0, 1/2, 2/3, 3/4, 4/5, ...
e. Fibonacci series: 0, 1, 1, 2, 3, 5, 8…. xn=xn-1+xn-2
f. -1, 1/4, -1/27, 1/256, ... {xn} = { (-1/n)n }
3. Write a code to multiply two matrices of size m x n and n x j
If A=[1 2 3;2 4 5;4 3 2] and B=[3 1 -1;2 4 -1;4 3 6] Calculate the value of AxB and AxBT from the
code. Compare the results with A*B and A*B’ in command line
4. Write a code to sort a vector compare the result with “sort” command
5. Considering the matrix A=[1 2 3;2 4 5;4 3 2]; write a code to evaluate the sum of the diagonal terms.
Also explore the MATLAB command(s) to do the same operation
6. Write a script which provides two input vectors x=[1 2 3 4 5 6 7 8]; and y= [8 7 6 5 4 3 2 1] to a
function. Write a function to calculate z = x*y’ and zz = x’*y and print the output in the main script.
7. Write a script which reads a vector from an input file and prints the same vector in another output
file.
8. Evaluate the following expression for
(i)
n = -3 x = ? (ii) n = 9 x = ? (iii) n = 10 x= ? How to make it work for all values?
if n < 0
x = n^2;
elseif n < 10
x = n+1;
elseif n > 10
x = n -10;
end
Assignment – 2
Finite Element Methods
APL 705
1. Consider a bar of length 50 cm with uniform area of cross section, 25 cm2 as shown in
Figure 1. The bar is fixed at point A and is pulled with a force of 2 KN at point B.
a) Develop a finite element code in MATLAB and use one element to calculate the
displacement at point B and reaction force at point A.
b) Refine the finite element mesh by increasing the number of elements to four and
compare the results with those obtained in part (a).
Figure 1.
2. Consider a tapered bar as shown in Figure 2. The bar has a uniform thickness of
2.5cm, Young’s Modulus E = 200 GPa. It is fixed at point P and is subjected to a
point load of 5 KN at point Q.
a) Model the bar with two finite elements to determine displacement at point Q and
reaction force at point P.
b) Solve the problem using five elements.
Figure 2.
Assignment – 2
Finite Element Methods
APL 705
Answers
Prob 1 : Displacement at point P : 2 × 10-6 m
Prob 2 : Displacement at point Q (using 5 elements) : 4.7528 × 10-6 m.
Reaction force at P : -5 KN.
Assignment – 3
Finite Element Methods
APL 705
1. Consider a three member truss shown in Figure 1. All members of truss have identical
areas of cross section 30 cm2 and modulus E = 200 GPa. The hinged supports at joints
allow free rotation of members about z- axis (taken positive out of the plane of the
paper). Determine the horizontal and vertical displacements at joint C and forces in
each member of the structure.
Figure 1.
2. A small railroad bridge is constructed of steel (E = 200 GPa) members, all of which
have a cross-sectional area of 3250 mm2. A train stops on the bridge, and the loads
applied to the truss on one side of the bridge are as shown in Figure 2. Estimate how
much the point R moves horizontally because of this loading. Also determine the nodal
displacements and element stresses.
Figure 2.
Assignment – 3
Finite Element Methods
APL 705
Answers
Prob 1: At point C : Horizontal Disp. = 0.9714 × 10-4 m ; Vertical Disp. = -0.5 × 10-4 m.
Member Forces : FAB = 0; FBC = 300 KN; FAC = 141.42KN;
Prob 2 : Point R moves horizontally by 3.1337 mm.
Assignment – 4
Finite Element Methods
APL 705
1. Evaluate the following integrals using Gauss integration (Use data from Table 1):
1
a)
e
x
cos( x)dx
[Exact : 1.933421497]
1
0.8
b)
 (0.2  25x  200 x
2
 675 x3  900 x 4  400 x5 )dx
[Exact : 1.640533]
0
 3
c)
  (x
2
 x)sin y dxdy
[Exact : 9]
0 0
2. Use one point, two point and three point Gauss integration to evaluate the following
expressions for stiffness matrix and force vector of an element (E = 200 GPa) :
 1

x   80   1
1

K  E  1   
dx
 
40   1   80 80 
0
 80 
x

2 1
80

1 
x 
80 
F   1   
 dx
10 0  40   1 
 80 
80
2
Table 1: Weights (wi) and Gauss Points (  i ) for Gauss-Legendre Quadrature
1
r
1
i 1
 F ( )d   F (i )wi
r
1
2
3
4
Gauss Points
0.000
1/√3, −1/√3
3
3

, 0.00,
5
5
±0.3399810435,
± 0.8611363116
Weights
2.000
1.000, 1.000
5/9, 8/9, 5/9
0.6521451548, 0.6521451548, 0.3478548451,
0.3478548451
Assignment – 5
Finite Element Methods
APL 705
1. Consider a cantilever beam made up of steel (E = 200 GPa) of rectangular cross section
(I = 4 × 106 mm4) shown in Fig. 1. Use two elements and determine the displacement
at point B. Also determine the reactions at point A.
Figure 1.
2. A steel (E = 200 GPa) beam with area moment of inertia, I = 4 × 106 mm4 is subjected
to partial uniform distributed load as shown in Fig. 2. Determine the slopes at point 2
and 3.
Figure 2.
3. Consider a cantilever beam of length L and subjected to linearly varying distributed
load q(x) and point load F0 as shown in Fig. 3. Determine the displacement field and
bending moment in the beam using two elements. [E = 200 GPa ; I = 4 × 106 mm4]
Figure 3.
Assignment – 5
Finite Element Methods
APL 705
Problem 1:
Problem 2:
Assignment – 5
Finite Element Methods
APL 705
Problem 3:
Assignment – 6
Finite Element Methods
APL 705
1. Consider the frame made up of steel as shown in Figure 1. Determine the
displacements and rotations at points B and C. Also, determine the reaction forces at
points A and D.
Figure 1.
2. Determine the deflection at centre of BC for the frame shown in Figure 2. Also,
determine the reactions at A and D.
Figure 2.
Assignment – 6
Finite Element Methods
APL 705
Problem 1:
Problem 2: