Docsity

Linear Systems Assignment: Solving Forces in a 2D Bridge - Prof. Joh Calandrino, Assignments of Computer Science

Toggle sidebar
bg1
COMP 016
Sept 5, 2007
Assignment #3: Solving linear systems, due Sept 21.
For these two questions, make a word file with your answers, and the commands/scripts
that you used to generate them, and hand in on blackboard. See the lecture notes "What
is a matrix?" online for more details on solving linear systems.
1. We want to evaluate different shapes for a 2-dimensional bridge using 15 bars and 9 rotational
joints. Our bridge spans from a fixed point A to a point E that is fixed vertically, but can roll
horizontally. We would like the bridge shape that minimizes the forces on the bars when the
bridge is loaded with a truck at C exerting 30,000 newtons (meters/sec2) of force and a car at D
exerting 10,000 newtons.
We place the joints in the plane with x and y coordinates as follows, using function h(x) to
determine the shape of the upper part of the bridge.
A B C D E
(-4,0) (-2,0) (0,0) (2,0) (4,0)
F G H I
(-3,h(-
3))
(-1,h(-
1))
(1,h(1)) (3,h(3))
Task: Write a script file that assumes that the function h(x) is defined, and computes the forces
on all bars by setting up the equations for conservation of force at each joint. Define h(x) for
bridges I-IV by using MATLAB's inline command as below. Report the forces for each
bridge, and determine which bridge minimizes the maximum force (in absolute value).
Bridge shapes: Here are four bridge shapes that come from different choices of h(x).
I. h = inline('sqrt(3)');
Flat top with equilateral triangles (drawn above).
II. h = inline('sqrt(4-(x/2)^2)');
Semicircle arch.
III. h = inline('sqrt(3)*cos(pi*x/8)');
Cosine arch.
IV. h = inline('((x/2)^2+3)/4');
Parabola opening up.
Hint: Break your task into small steps, and don’t be overwhelmed by the whole.
Many problems in scientific computing are like this: you do a little programming to set up the
system of equations or constriants that apply to your problem, then use a sophisticated package to
actually find the solution. Here, the constraint or equation is that the horizontal and vertical
components of the forces at one node must sum to zero, otherwise the bridge would move and
tear itself apart. Once you figure out the equation for one joint, the rest become easy.
pf2

Partial preview of the text

Download Linear Systems Assignment: Solving Forces in a 2D Bridge - Prof. Joh Calandrino and more Assignments Computer Science in PDF only on Docsity!

COMP 016 Sept 5, 2007

Assignment #3: Solving linear systems, due Sept 21.

For these two questions, make a word file with your answers, and the commands/scripts

that you used to generate them, and hand in on blackboard. See the lecture notes "What

is a matrix?" online for more details on solving linear systems.

  1. We want to evaluate different shapes for a 2-dimensional bridge using 15 bars and 9 rotational joints. Our bridge spans from a fixed point A to a point E that is fixed vertically, but can roll horizontally. We would like the bridge shape that minimizes the forces on the bars when the bridge is loaded with a truck at C exerting 30,000 newtons (meters/sec^2 ) of force and a car at D exerting 10,000 newtons. We place the joints in the plane with x and y coordinates as follows, using function h(x) to determine the shape of the upper part of the bridge. A B C D E (-4,0) (-2,0) (0,0) (2,0) (4,0) F G H I (-3, h (- 3)) (-1, h (- 1)) (1, h (1)) (3, h (3)) Task: Write a script file that assumes that the function h(x) is defined, and computes the forces on all bars by setting up the equations for conservation of force at each joint. Define h(x) for bridges I-IV by using MATLAB's inline command as below. Report the forces for each bridge, and determine which bridge minimizes the maximum force (in absolute value). Bridge shapes: Here are four bridge shapes that come from different choices of h(x). I. h = inline('sqrt(3)'); Flat top with equilateral triangles (drawn above). II. h = inline('sqrt(4-(x/2)^2)'); Semicircle arch. III. h = inline('sqrt(3)cos(pix/8)'); Cosine arch. IV. h = inline('((x/2)^2+3)/4'); Parabola opening up. Hint: Break your task into small steps, and don’t be overwhelmed by the whole. Many problems in scientific computing are like this: you do a little programming to set up the system of equations or constriants that apply to your problem, then use a sophisticated package to actually find the solution. Here, the constraint or equation is that the horizontal and vertical components of the forces at one node must sum to zero, otherwise the bridge would move and tear itself apart. Once you figure out the equation for one joint, the rest become easy.

On forces: Each bridge has 15 bars: AB, BC, CD, DE (across the bottom), FG, GH, HI (across the top), and AF, FB, BG, GC, CH, HD, DI, IE (zig-zag across the middle). To each bar you attach a force variable, which is the force of expansion of the bar (negative force indicates contraction). At each joint, the sum of the forces received from bars, cars, and ground must cancel out, or the bridge would move or collapse. See p. 67-68 in Gilat. Thus, both the horizontal components and vertical components of forces at a joint should sum to zero. Suppose the angled bar from A = (A.x, A.y) to F = (F.x, F.y) has expansion force f. And consider the horizontal and vertical forces applied to joint F. By convention, forces upward and to the right will be positive. If bar AF has angle , then the horizontal force is f*cos() = f *(F.x-A.x)/|AF| and the vertical force is f*sin() = f *(F.y-A.y)/|AF| , where |AF| denotes the length of the bar sqrt((F.x-A.x)^2 +(F.y-A.y)^2 ) = norm(F-A). Adding up the horizontal forces gives one equation at each joint, and adding up the vertical forces gives a second. The equations for vertical forces at joints C and D will include the downward forces from the truck and car. Joint A is fixed and joint E is fixed vertically, but not horizontally, so we get no equation from A, and one equation from E. (And 27 + 1 = 15 equations is just right for the 15 force variables that we want to find.) Once you have your 15 equations relating the 15 force variables for one bridge, you can have your script set up a matrix M with one equation per row, and one variable per column. The constants appearing on the right hand side are put into a 15x1 vector b. Once the matrix is set up, the solution is easy. MATLAB solves for the vector v of 15 force variables that satisfy _Mv =b_ by “matrix left division,” v = M\b , as described in class and in Gilat 3.3. To see MATLAB’s documentation, type doc mldivide. You can define functions to do the repetitive calculation of horizontal and vertical components of force, as suggested in Gilat, chapter 6. E.g., make a file horiz.m that contains the following: function result = horiz(U,V) % calculate horizontal component of force applied to point U by bar UV. result = (U(1) - V(1))/norm(U-V); Do something similar for vert(U,V), and then you can use f*horiz(F,A) and f*vert(F,A), instead of having to type out the calculation each time you want those values.