tutor-notes-2005-sheet-6

tutor-notes-2005-sheet-6 - N9+£5 ‘8» tu’t‘brs The...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: N9+£5 ‘8» tu’t‘brs The University of Queensland School of Engineering MECH27OO Engineering Analysis I (2005) Exercise Sheet 6 1. The planar truss shown below has 7 equal-length members (labelled 1 through 7) and 5 pin joints :(labelled a through e). The reaction forces at the supports are shown as R1, R2 and R3. With the external leads F1 and F2, write the equations of static equilibrium 'of the truss by considering vertical and horizontal forces at each pin. Denote the tension in the members as T1 through T7 (with a negative value indicating that the member is in compression). 2. Write your set of linear'equations for the equilibrium of the truss in standard (ma~ trix) form A51? = :17 with the vector of unknowns being R1 R3 3. Write a Python program that solves your system of linear equations using a direct solver (such as Gauss-Jordan elimination) for the external loads [Fll = 10 kN, |F2| == 7'kN, 01 = 7 5° and 02 = 45". You may find that it is convenient to use the “Numeric” module or the example “matrix.p ” module provided on the course web page to solve the matrix equation. Those who are keen are free (and are encouraged) to write their own linear algebra functions. Read chapter 2 of Schilling & Harris’ text for algorithm suggestions. 4. Write a Python program to solve the equations from question 1 using Gauss-Seidel iteration. MackZZIoO “042% Kw Tums Q1 W14 @TI'UQ W055 ékowh Gleam!» L70: ;L equating/nah mW/i Md 5 Pin Jam Qabfiww a—e,‘ 714’. am“ Kym, aJ‘ ’Hru 5vflfo-rts m I,th 00 91,92 own Q3 - MIRHLA m and gm}? F1395 _, mu m u)me fiafia‘towm 7/) 41% (Ms 1,9 conéfdm-yka 44M. vxnhcéfl omol horizowa pump a!" Lani“ Pam, MW M onux. 0“) a +41hél‘on may 194V nzgchiu 173 {Ad/@641 & Gama/#109th ‘H’v +4/h5iamo l‘h 'H'\-k MWW do/how 199 1] “E > (Jn‘Y‘ajvy‘ 1.0;]qu ‘9 2/. R1+T1' Ooséo" + T2 = O 1 9 RZ+T1 sinéo° =0 )4 —-T2+T5 *Tacosgcfi +T4 60566 =0 T3 sineo‘ + T4‘5in606 = O ~F1 00691 +T7 -T1 coééo’ +T3 06560" =0 ‘F16I'h91 “T1 éinéao' - T3 sin 60' = 0 4:2 5&9? ~T4 SinED° - Te SEEDa = 0 "TS "Te CoééOo = 0 +11, sinéo" + 23 = O. xxx-9w“ (“09.9.000‘0'99? 9 x ‘9 x ~F2 00592 ~T; —T4 cos (’0‘ +Tg coséo' = O 5 it ‘9 wavy)“ Pmb‘m 8.2.2 in B 5 Gottfnid gpreadfikat Totals 1&0 Engtkzexs Me.ng Hi“ WZVOO Mo‘l'w (jar Tulmrs 611 mu your 9m“, gauging .‘n sumac)“; (mmx) Gar-MA wH’lA M Vodbr cf Uhkflowm H 521 [12, R2 23 T1 7; T3 T4 . Ts 1: T7 ] o ‘ 1 I 2 ‘ 3 \ 4 I 5 ‘ 6 ‘ 4 I S \ 9 0 A = 1 O O cased 1 0 o O o O 1 O 1 o aimed o o o o o o 2 O O o o ‘1 waséo" coséd 1 o O 3 o o o o 0 mm“ 5.590“ .0 o o 4 o o o ~095é6 o a:st O o O 1 9 0 O O - 513160“ 0 ‘51}160’ O O O O A o o o o o o - Coséo’ o (0560 - 1 3} O O o o o o $11160“ o —sf»£o O 3 O o o O o o O -1 ~cosLo o 9 O o ’l o o D o o StRéo 0 9T: \: O, O, O/ O , F1 60.99, ) F1 fining I 132/004 52 ) szfnez) O, [O o 1 2 '5 4 I5/ 5. /'l l9/ ,9 I Gem-ea J: E 1533 11344, 2&5 4%.‘523 ' 42751:, 2.409 — 2.409 1.61 3304, 4.398] units» on. HQ @ Wfita 0» 399%“ sonft Mm)!“ mm U$< of) {La Nam mod/uh Ali's éohm 90w" éme a? Unear £0},wa 16r- M Mrme Law, 15]: 10 km 1 la): 7%) ) (91:75“ We! 92:45". fimpor’c mafia import Hume/M ~10:10 ; cséoz «M,o«s(€0.o/’|BOA<M.PI}) ,' sné0= A : MUmmio-Rro:-’>( ("#0) '9: HomMIb.%mo$((n,1.)) 4“ 0v 56% dulmenswm A[o][o] = ’Lo ; Amp] = (.540,- ALOJE4] =1.o 9 [3111]: F31 4c maW‘CJob (Wta‘l ) ac: solw,_12m2.or,w)udh°% (A, 9) Pmkt “éolu‘t’wh mean.» = x. ) # file: truss.py “""Example of using the Numeric extension: truss problem‘ Set up and solve the system of linear equations that describe the static equilibrium of a determinant truss‘ P. Jacobs, School of Engineering, UQ 13—Oct-03, 27—Oct—03 from math import pi, sin, cos useNumeric = 1 if useNumeric: # Use the standard package Numeric (a.k.a. numpy) import Numeric import LinearAlgebra else: # Use our own matrix package import matrix print “Begin truss..." F1 10.0; thl F2 7.0; ch — angle = 60.0/180 H H I" 75.0/180 * pi # external force 1 45.0/180 * pi # external force 2 *pi cs = cos(angle); sn 2 sin(angle) print “angle=“, angle, "cs=", cs, “sn=“, sn n = 10 if useNumeric: # When we set create the arrays, we need to specify the typecode # as Float so that we don’t get the default integer elements. A = Numeric.zeros((n,n), Numeric.Float) # matrix of coefficients y = Numeric.zeros((n,1), Numeric.Float) # RHS vector else: A = matrix.zeros(n,n) y = matrix.zeros(n,1) A[O][0] = 1.0; A[O][3] = cs; A[0][4] = 1.0 A[l][l] = 1.0; A[l][3] = sn A[2][4] = —l.0; A[2][5] = ~cs; A[2][6] = cs; A[2][7] = 1.0 A[3][5] = sn; A[3][6] = sn A[4][3] = -cs; A[4][5] = cs; A[4][9] = 1.0 A[5][3] = -sn; AI5][5] = -sn A[6][6] = —cs; A[6][8] = cs; A[6][9] = —1.0 A[7][6] = ~sn; A[7][8] = —sn A[8][7] = ~l.0; A[8][8] = -cs A{9][2] = 1.0; A[9][8] = sn # number of equations print “Coefficients AF“, A if useNumeric: # all truss angles equal # With Numeric, we don’t need to specify column index # for the RHS vector but we may if we so wish. y[4] = Fl * cos(thl) y[5] = Fl * sin(thl) y[6] = F2 * cos(th2) y[7] = F2 * sin(th2) else' # With our list—of—list matrices, we do need to specify column index # for the RHS vector. YE4][0] = Fl Y[5][0] = Fl YESJEOJ 3 F2 Y[7][0] = F2 print “RES y=“, y if useNumeric: *3fX-X- cos(th1) sin(th1) cos(th2) sin(th2) x = LinearAlgebra.solve_linear_equations(A, y) resid = Numeric.matrixmultiply(A,x) — y else: x = matrix.gauSs-jordan(A, y) resid = matrix.msub(matrix.mmult(A,x), y) print “Solution x=", x print “Check solution...residual=", resid print "Done." Begin truss... angle= 1.0471975512 cs= 0.5 sn= 0.866025403784 Co HHHHHl—DHflHQHflI—IHP—lflflHP—IF‘I So E [ [ 'J'r—vr-Ir-n-Ir-IH C O r—n—tr—1r-Ir-1r-‘H—Ir—Ir-1 U efficients A= [ 1. 0‘5 0.866 0. O. «0.5 -0.866 t n o o o d o o o o o F‘O o o o o o o o o .. . . . . . . 0000 .o.. n - OOOOOOOOOl—‘O m . ] - 1 - 1 2.58819045] 9.65925826] 4.94974747] 4.94974747] 0~ 1 0~ 1] lution x= L[ 11.74590343] 2.8631023 ] —13.56300101] —O.75643741] 2.4094503 ] —2.4094503 ] 1.65301288] ~3.30602577] —5.3980352 ]] eck solution...residual= [[ -2.41993925e—16] 2.01661604e-17] 0.00000000e+00] —4.44089210e-16] 0.00000000e+00] 0.00000000e+00] 0.00000000e+OO] —7.70867745e—17] —6.54858112e-17]] ne. §=tt OOO 7.53793792] # tidied up by hand 1. 0. O. O. O. 0. ~1 -0.5 0.5 O. 0.866 0.866 0. 0.5 O. O. —0.866 0. 0 0. -0.5 0 O. -0.866 0 0. O. 0 0 0. 3.81639165e-l6] ! OHOOOOOI—‘OO u ...
View Full Document

This note was uploaded on 11/26/2011 for the course MECH 2700 taught by Professor Peterjacobs during the Three '11 term at Queensland.

Page1 / 7

tutor-notes-2005-sheet-6 - N9+£5 ‘8» tu’t‘brs The...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online