Need to be done on Python
AE4132 - Finite Element Analysis Spring 2022 Homework 2: Rayleigh-Ritz Method Due Friday, February 11th 2022 Problem 1 Consider the bar depicted in Figure 1. 1. Derive the corresponding expression for the elastic potential. 2. Use the Rayleigh-Ritz method to find approximate solutions considering the following approximate displace- ment fields. Comment on your results. (a) û = ax+ b (b) û = ax2 + bx+ c (c) û = ax3 + bx2 + cx+ d (d) û = ax+ b for 0 < x="">< l/2="" and="" cx+="" d="" for="" l/2="">< x="">< l 3. the last case is what we call a piece-wise linear approximation, in this case for 2 segments. write a generic expression for the potential corresponding to a piece-wise linear approximation resulting from dividing the bar into n identical segments of length l/n . show that in the limit for n → ∞ the approximate potential converges to the exact one. comment on the implications of your result. 4. for the particular case where p = 400 n, q = 100 n/m, l = 2 m, a = 0.0003 m2, e = 70 gpa, and ν = 0.3, use your expression from part 3 to create and plot the solution for n = 50 in python. include the source code. p l q figure 1: schematics for problem 1 ae4132: finite element analysis - spring 2022, homework 2 2 problem 2 consider the bars you solved in the previous homework assignment, as shown in figure 2. based on your knowl- edge of the exact solution, propose û such that, by using the rayleigh-ritz method, would allow you to recover the exact solution. discuss your choice of û and solve both cases using rayleigh-ritz. for the first schematic, consider the case where q = 1 lbf/in, p = 90 lbf , l = 8 ft, e = 20 mpsi, and a = 5 in2. compute n(x) using a) your solution for û and b) integrating the governing equation. plot n vs x for both a) and b) on the same graph. include your source code. note: if your plots overlap each other, use different line styles in the plots. for example, use plt.(x, y, ls='-') for the first line and plt.(x, y, ls='--') for the second to plot solid and dashed lines, respectively. p l q l q figure 2: schematics for problem 2 problem 3 consider the beam you solved in the previous homework assignment, as shown in figure 3. 1. derive the corresponding expression for the elastic potential. 2. find an approximate solution via the rayleigh-ritz method using: (a) û = ax2 + bx+ c (b) û = a cos(bx) + c 3. consider the particular case where q = 40 n/m, l = 1 m, e = 120 gpa, ν = 0.4, izz = 0.8 cm 4, and p = βql. calculate the total potential energy, π, for cases (a) and (b) and plot π vs β, for β values from -10 to 10. include your source code. 4. which solution do you think is better? why? p l q figure 3: beam configuration for problem 3. l="" 3.="" the="" last="" case="" is="" what="" we="" call="" a="" piece-wise="" linear="" approximation,="" in="" this="" case="" for="" 2="" segments.="" write="" a="" generic="" expression="" for="" the="" potential="" corresponding="" to="" a="" piece-wise="" linear="" approximation="" resulting="" from="" dividing="" the="" bar="" into="" n="" identical="" segments="" of="" length="" l/n="" .="" show="" that="" in="" the="" limit="" for="" n="" →="" ∞="" the="" approximate="" potential="" converges="" to="" the="" exact="" one.="" comment="" on="" the="" implications="" of="" your="" result.="" 4.="" for="" the="" particular="" case="" where="" p="400" n,="" q="100" n/m,="" l="2" m,="" a="0.0003" m2,="" e="70" gpa,="" and="" ν="0.3," use="" your="" expression="" from="" part="" 3="" to="" create="" and="" plot="" the="" solution="" for="" n="50" in="" python.="" include="" the="" source="" code.="" p="" l="" q="" figure="" 1:="" schematics="" for="" problem="" 1="" ae4132:="" finite="" element="" analysis="" -="" spring="" 2022,="" homework="" 2="" 2="" problem="" 2="" consider="" the="" bars="" you="" solved="" in="" the="" previous="" homework="" assignment,="" as="" shown="" in="" figure="" 2.="" based="" on="" your="" knowl-="" edge="" of="" the="" exact="" solution,="" propose="" û="" such="" that,="" by="" using="" the="" rayleigh-ritz="" method,="" would="" allow="" you="" to="" recover="" the="" exact="" solution.="" discuss="" your="" choice="" of="" û="" and="" solve="" both="" cases="" using="" rayleigh-ritz.="" for="" the="" first="" schematic,="" consider="" the="" case="" where="" q="1" lbf/in,="" p="90" lbf="" ,="" l="8" ft,="" e="20" mpsi,="" and="" a="5" in2.="" compute="" n(x)="" using="" a)="" your="" solution="" for="" û="" and="" b)="" integrating="" the="" governing="" equation.="" plot="" n="" vs="" x="" for="" both="" a)="" and="" b)="" on="" the="" same="" graph.="" include="" your="" source="" code.="" note:="" if="" your="" plots="" overlap="" each="" other,="" use="" different="" line="" styles="" in="" the="" plots.="" for="" example,="" use="" plt.(x,="" y,="" ls='-' )="" for="" the="" first="" line="" and="" plt.(x,="" y,="" ls='--' )="" for="" the="" second="" to="" plot="" solid="" and="" dashed="" lines,="" respectively.="" p="" l="" q="" l="" q="" figure="" 2:="" schematics="" for="" problem="" 2="" problem="" 3="" consider="" the="" beam="" you="" solved="" in="" the="" previous="" homework="" assignment,="" as="" shown="" in="" figure="" 3.="" 1.="" derive="" the="" corresponding="" expression="" for="" the="" elastic="" potential.="" 2.="" find="" an="" approximate="" solution="" via="" the="" rayleigh-ritz="" method="" using:="" (a)="" û="ax2" +="" bx+="" c="" (b)="" û="a" cos(bx)="" +="" c="" 3.="" consider="" the="" particular="" case="" where="" q="40" n/m,="" l="1" m,="" e="120" gpa,="" ν="0.4," izz="0.8" cm="" 4,="" and="" p="βqL." calculate="" the="" total="" potential="" energy,="" π,="" for="" cases="" (a)="" and="" (b)="" and="" plot="" π="" vs="" β,="" for="" β="" values="" from="" -10="" to="" 10.="" include="" your="" source="" code.="" 4.="" which="" solution="" do="" you="" think="" is="" better?="" why?="" p="" l="" q="" figure="" 3:="" beam="" configuration="" for="" problem=""> l 3. the last case is what we call a piece-wise linear approximation, in this case for 2 segments. write a generic expression for the potential corresponding to a piece-wise linear approximation resulting from dividing the bar into n identical segments of length l/n . show that in the limit for n → ∞ the approximate potential converges to the exact one. comment on the implications of your result. 4. for the particular case where p = 400 n, q = 100 n/m, l = 2 m, a = 0.0003 m2, e = 70 gpa, and ν = 0.3, use your expression from part 3 to create and plot the solution for n = 50 in python. include the source code. p l q figure 1: schematics for problem 1 ae4132: finite element analysis - spring 2022, homework 2 2 problem 2 consider the bars you solved in the previous homework assignment, as shown in figure 2. based on your knowl- edge of the exact solution, propose û such that, by using the rayleigh-ritz method, would allow you to recover the exact solution. discuss your choice of û and solve both cases using rayleigh-ritz. for the first schematic, consider the case where q = 1 lbf/in, p = 90 lbf , l = 8 ft, e = 20 mpsi, and a = 5 in2. compute n(x) using a) your solution for û and b) integrating the governing equation. plot n vs x for both a) and b) on the same graph. include your source code. note: if your plots overlap each other, use different line styles in the plots. for example, use plt.(x, y, ls='-') for the first line and plt.(x, y, ls='--') for the second to plot solid and dashed lines, respectively. p l q l q figure 2: schematics for problem 2 problem 3 consider the beam you solved in the previous homework assignment, as shown in figure 3. 1. derive the corresponding expression for the elastic potential. 2. find an approximate solution via the rayleigh-ritz method using: (a) û = ax2 + bx+ c (b) û = a cos(bx) + c 3. consider the particular case where q = 40 n/m, l = 1 m, e = 120 gpa, ν = 0.4, izz = 0.8 cm 4, and p = βql. calculate the total potential energy, π, for cases (a) and (b) and plot π vs β, for β values from -10 to 10. include your source code. 4. which solution do you think is better? why? p l q figure 3: beam configuration for problem 3.>