0% found this document useful (0 votes)
14 views21 pages

Materials Files-631967 Lecture6Midtermproject

MATLAB Project

Uploaded by

gitanxtreme
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)
14 views21 pages

Materials Files-631967 Lecture6Midtermproject

MATLAB Project

Uploaded by

gitanxtreme
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/ 21

ENGR 108

Introduction to Computing for


Engineers and Scientists
LECTURE 5: LINEAR ALGEBRA (PART 1)
Objectives

After this lecture, students will be able to:


◦ Apply the methods of linear algebra to an engineering problem
◦ Interpret MATLAB output and translate it into a readable report

2
Circuit analysis

Kirchoff’s two rules describe the current flow through a circuit


◦ Kirchoff’s voltage rule: The sum of all the voltage sources and voltage drops
around any closed loop is equal to zero.
◦ Kirchoff’s current rule: The sum of all the currents entering a point is equal
to the sum of all the currents leaving that point.

Ohm’s law tells us the voltage drop across a resistor: 𝑉 = 𝑖𝑅


Circuit analysis
Circuit analysis
Loop 1 Choose directions for the currents,
then choose loops and nodes that
cover all the currents

Loop 2
Kirchoff’s voltage law:
100 V − 5KΩ 𝑖2 − 10KΩ 𝑖4 = 0
Node 1 −1KΩ 𝑖1 − 2KΩ 𝑖3 + 5KΩ 𝑖2 = 0
Node 2 −2KΩ 𝑖3 − 10KΩ 𝑖4 + 5KΩ 𝑖5 = 0
Loop 3
Kirchoff’s current law:
𝑖2 + 𝑖3 = 𝑖4
𝑖1 = 𝑖3 + 𝑖5
𝑖6 = 𝑖4 + 𝑖5
Node 3
Circuit analysis
Rewrite the equations as a system of linear equations:

− 5𝑖2 − 10𝑖4 = 0.1


−1𝑖1 + 5𝑖2 − 2𝑖3 = 0
− 2𝑖3 − 10𝑖4 + 5𝑖5 = 0
𝑖2 + 𝑖3 − 𝑖4 = 0
−𝑖1 + 𝑖3 + 𝑖5 = 0
𝑖4 + 𝑖5 − 𝑖6 = 0

To increase the accuracy of the solution, you want the ratio of the largest
element to the smallest element to be relatively small, so we divided the
first three equations by 1,000
Circuit analysis

So that we don’t have to keep


track of commas and semicolons,
we can type the coefficient
matrix into MATLAB with the
variable editor
MATLAB automatically fills
empty spaces with zeros for you
Circuit analysis
We can use left division to find the solution

>> i = A\b
ans =
0.0189
0.0049
0.0027
0.0076
0.0162
0.0238
Circuit analysis
DOES THE ANSWER MAKE PHYSICAL SENSE?
Try checking the nodes and loops we didn’t use

Does 𝑖6 = 𝑖1 + 𝑖2 ?
◦ >> i(6), i(1)+i(2)
ans =
0.0238
ans =
0.0238

This is OK
Circuit analysis
DOES THE ANSWER MAKE PHYSICAL SENSE?
Try checking the nodes and loops we didn’t use

Is the sum of voltages of the


outermost loop zero?
◦ >> 100-1000*i(1)-
5000*i(5)
ans =
-2.8422e-014

This answer is so close to zero


that it’s acceptable
Circuit analysis
Truss analysis

A truss is made up of elements


that are pinned at the ends,
allowing them to rotate freely
There are two equilibrium
equations for each joint
◦ Σ𝐹𝑥 = 0
◦ Σ𝐹𝑦 = 0
Truss analysis

We have ten unknowns (the


seven bar forces and the three
reactions)
Each joint provides two
equations, so we just need to
write the equations for each joint
We’ll do joints A and C as
examples
Truss analysis

Σ𝐹𝑥 = 0
𝐹1𝑥 + 𝐹2𝑥 − 𝑅1 = 0
𝐹1 cos 60° + 𝐹2 − 𝑅1 = 0

Σ𝐹𝑦 = 0
𝐹1𝑦 + 𝑅2 = 0
𝐹1 sin 60° + 𝑅2 = 0
Truss analysis

Σ𝐹𝑥 = 0
−𝐹2 − 𝐹3𝑥 + 𝐹5𝑥 + 𝐹6 = 0
−𝐹2 − 𝐹3 cos 60° + 𝐹5 cos 60° + 𝐹6 = 0

Σ𝐹𝑦 = 0
𝐹3𝑦 + 𝐹5𝑦 − 𝑓2 = 0
𝐹3 sin 60° + 𝐹5 sin 60° = 𝑓2
Truss analysis
Truss analysis
Truss analysis
>> stiffness\forces
ans =
1.0e+003 *
This means each
What if 𝑓1 = 𝑓2 = 1000 lb? 0.2818 entry in the matrix is
◦ forces = 1.5774 multiplied by 1,000
[0, 0, -1000, 0, 0, -0.2818
1000, 0, 0, 0, 0]’ -0.7182
1.4365
Use matrix left division to find 0.7182
the solution -1.4365
1.7182
-0.2440
1.2440
Truss analysis
Check: do the external forces balance?
Take the moment (torque) of all the forces about 𝐷

Σ𝑀𝐷 = 0
0.5𝑅3 + 0.5𝑓2 = 1.5𝑅2 + 0.866𝑅1

>> x = stiffness\forces
>> 0.5*x(10)+0.5*(1000)-1.5*x(9)-0.866*x(8)
ans =
0
Truss analysis
Name Force Direction
Member 1 281.8 lb tension
Member 2 1,577 lb tension
Member 3 281.8 lb compression
Member 4 718.2 lb compression
Member 5 1,437 lb tension
Member 6 718.2 lb tension
Member 7 1,437 lb compression
Reaction 1 1,718 lb left
Reaction 2 244.0 lb down
Reaction 3 1,244 lb up
Next week

• Work on the midterm project


• Midterm exam: October 22—28

You might also like