Introduction to MATLAB and Basics of Structural Engineering
Objective: -
To solve the problems using Matlab code and using Mastan 2 perform the analysis of the given frame and the truss.
Problem statement: -
1) a) Assume a Howe Truss. Per Structural Idealization, draw a line model for the
truss and state your assumptions
b) From the line model, Calculate the following
No. of reactions r
No. of members m
No. of joints j
c) Calculate if the structure is stable or unstable? How did you arrive at this answer?
d) Is the structure externally stable or unstable Why?
e) Is the structure internally stable or unstable Why?
f) Is the structure determinate or indeterminate? If indeterminate Calculate Static degree of indeterminacy Kinematic degree of indeterminacy
g) Does your answers to the above questions remain the same for the below given coplanar truss
__________________________________________________________________________________________________________
a)

b)
- Number of reactions(r) = 3
- Number of joints (j) =8
- Number of member (m) =13
c)
The above structure is a stable structure as it is a rigid structure according to the equation
m =2j - 3
as the LHS is equal to RHS
d)
The structure is an externally stable structure as the truss don't move after the application of load (No rotation, no translation)
e)
the structure is an internally stable structure as the shape does not change after the load application.
f)
The structure is a determinate structure according to the equation
m+r<=2j
and m+r is equal to 2j so the structure is determinate
g)
Yes, for the given coplanar truss the reaction (r) =3, joints(j) =5 ,member(m) = 7
as the structure satisfies the eqn (m =2j -3), so it is just a rigid or perfect truss that is internally and externally stable and it is a determinate structure according to the equation
_____________________________________________________________________________________________________________
2)
Perform mathematical operations as listed below on matlab and list the answers
taking a = 5, b =7, c=9
● a*b^c = 201768035
● (a*b)^c = 7.8816e+13
● a-b^c = -40353602
● a^b-c = 78116
● a^bc = 1.1520e-04
● a^b/c = 8.6806e+03
Code for the above problem: -
clear all
close all
clc
a=5
b=7
c=9
a*b^c
(a*b)^c
a-b^c
a^b-c
a^bc
a^b/c

____________________________________________________________________________________________________________
3) Understanding vector algebra
Perform Matlab script operations to create a row vector and perform following
commands
● Use colon operator to create row vector by default and by specifying a range
● Use linspace command to generate vectors automatically
● Use length() to arrive at the length of the vector
● Use size() to arrive at size of vector
● Access elements in a vector
● Access a range of elements
● Access a series of particular elements
● Perform scalar transpose and vector transpose
Code for the above problem: -
clear all
close all
clc
j= 2
k =51
%Use colon operator to create row vector by default and by specifying a range
x = j:k
%Access elements in a vector
acess_element = x(22)
%Use length() to arrive at length of vector
len =length(x)
% Use size() to arrive at size of vector
b_size = size(x)
%Access a range of elements
c_range = x(1,6:10)
%use of linspace command
l_lnspce =linspace(1,2,10)
%Vector Transpose of the vector
x_transpose = x'
%scalar transpose
u = 23
u_transpose = u'
The output of the above code: -

_
_______________________________________________________________________________________________________________
4) Create a matrix with m rows and n columns A and B and perform the following commands
● A*B
● AB
● A/B
● A^2
● A^2-A*A
● A.^2
● A.^2-A^2
Code for the above problem: -
clear all
close all
clc
A =[1 2 2 1; 3 4 4 3 ;5 6 6 5 ;7 8 8 7]
B = [9 10 10 9;11 12 12 11;3 7 8 4;1 2 3 4]
A*B
AB
A/B
A^2
A^2-A*A
A.^2
A.^2-A^2
Output of the above code:-



_______________________________________________________________________________________________________________
5) Create a Matlab script to understand the standard commands to create standard matrices
● ones()
● zeroes()
● eye()
● diag()
Code for the above problem:-
clear all
close all
clc
%Inputting number of rows and column m =4 and n=4
m = 4 %-------Row
n= 4 %-------Column
%Ones_function
ones_function = ones(m,n)
%zeros_function
zeros_function = zeros(m,n)
%Eyes_function
eye_function = eye(m,n)
%Diag_function
diag_function = diag(m,n)
Output of the above code:-

________________________________________________________________________________________________________________
6) Create a Matlab script to perform selecting and changing parts of matrices
Create a matrix A with m rows and n columns. Write commands to
● Access single element
● All row elements of column ‘n’
● All column elements of row ‘m’
● Perform commands to replace a selected row with new elements
● Perform commands to replace a selected column with new elements
Code for the above problem: -
close all
clear all
clc
%Assigning an Matrix_A
A=[1 2; 2 1;5 6;8 9]
%Accessing a single element in the A matrix
Access_single_element = A(4,2)
%Accessing the all row element in the matrix A
All_row_elements_of_column_n = A(:,1)
%Accessing the all column element in the matrix A
All_column_elements_of_row_m=A(2,:)
%Replacing the row element in the matrix A
x_row_replace =[10 11]
A(3,:) = x_row_replace
%Replacing the the all column element in the matrix A
y_column_replace = [99;98;97;96]
A(:,2) = y_column_replace
The output of the above code: -


____________________________________________________________________________________________________
7) Perform analysis on the following 2D frame using Mastan 2

Moment about Z

Shear Y values

Shear Z values

Displacement at point of application of loads at Node 2,3 as UDL and Node N5 Axial force:-


Model information:-

Result and conclusion: -
- We performed the analysis but for the truss, we only should have an axial force, and but for the frame analysis we have other forces also.
- We use the 1st order elastic frame analysis for the above problem.
-
The above report consist of a screen snapshot of
● Model information
● Moment about Z
● Shear values
● Displacement at point of application of loads