Page 1 of 1

Create a script to solve for the beam deflection problem discussed during the lectures on 3/17 and 3/22. The known param

Posted: Mon Apr 25, 2022 9:36 am
by answerhappygod
Create A Script To Solve For The Beam Deflection Problem Discussed During The Lectures On 3 17 And 3 22 The Known Param 1
Create A Script To Solve For The Beam Deflection Problem Discussed During The Lectures On 3 17 And 3 22 The Known Param 1 (55.88 KiB) Viewed 29 times
these are the examples
Create A Script To Solve For The Beam Deflection Problem Discussed During The Lectures On 3 17 And 3 22 The Known Param 2
Create A Script To Solve For The Beam Deflection Problem Discussed During The Lectures On 3 17 And 3 22 The Known Param 2 (43.61 KiB) Viewed 29 times
Create A Script To Solve For The Beam Deflection Problem Discussed During The Lectures On 3 17 And 3 22 The Known Param 3
Create A Script To Solve For The Beam Deflection Problem Discussed During The Lectures On 3 17 And 3 22 The Known Param 3 (48.09 KiB) Viewed 29 times
Create A Script To Solve For The Beam Deflection Problem Discussed During The Lectures On 3 17 And 3 22 The Known Param 4
Create A Script To Solve For The Beam Deflection Problem Discussed During The Lectures On 3 17 And 3 22 The Known Param 4 (49.06 KiB) Viewed 29 times
Create a script to solve for the beam deflection problem discussed during the lectures on 3/17 and 3/22. The known parameters are as follows: w = 40 kN/m, P1 = 35 kN, L1 = 2 m, L2 = 6 m, L = 10 m, El = 5e7 N/m2. Your code should display two graphs: • Plot y(x) • Plot M(x) *** hint: use diag function to formulate the coefficient matrix. To earn extra credit of 5 pt, convert above script into a user-defined function for beam deflection y(x) • Beam(w, P1, L1, L2, L, EI)
Back Mar17.m Î 8 March 17 88 Example 1, use ode45 to solve for a system of 3 ODES clear,clc close all [ty] = ode45 ( @dydtfun, [0,12], [0,1,1]); plot(t,y(:,1),t,y(:,2),t,8(:,3)) xlabel('time) ylabel('y values' legend('yi', 'y', 'y3') 88 Example 2, use ode45 to solve for a vibration system yo = [0.5, 0); tspan = [0,50); [ty] - ode45 (@vibfun, tspan, y0); figure subplot(2,1,1) plot(t,y(:,1)) subplot(2,1,2) plot(t,y(:,2)) ** Example 2 modified, compare ode45 and ode15s clear,clc close all yo - (0.5, 0); tspan = [0, 1e6]; & le6 is 10 6 [t,y) = ode45(@vibsfun, tspan, y0); tic toc tic toc [ti,y1] = ode15s(@vibsfun,tspan, yo); plot(t,y(:,1),t,y(:,2), t1,y1(:,1),'o',t1,y1(:,2),'o' legend('x by ode45', 'v by ode45', 'x by ode15s', 'v by ode15s) ) 88 Define all the ode functions $ Example 1 function yprime - dydt fun(t,y) yprime - 10;0;0); yprime (1) = y(2)*Y(3)*t; yprime (2) = -Y(1)*y(3); yprime (3) = -0.51*y(1)*y(2); end # alternatively 8yprime = [y(2)*Y(3)*t;-y(1)*Y(3);-0.51*y(1)*y(2) 8 Example 2 function yprime - vibfun(t,y)
88 Define all the ode functions % Example 1 function yprime = dydtfun(t,y) yprime = [0;0;0]; yprime(1) = y(2)*y(3)*t; yprime (2) = -y(1)*y(3); yprime (3) = -0.51*y(1) *y(2); end & alternatively yprime = (y(2)*y(3)*t;-y(1)*y(3);-0.51*y(1)*y(2)] % Example 2 function yprime = vibfun(t,y) fy(1) is x % y(2) is xdot 8 yprime (1) is xdot or y(2) % yprime (2) is x2dot m = 10; k = 4; c = 2; f0 = 0.05; w = 2; yprime = [0;0); yprime (1) = y(2); yprime (2) = f0/m*sin(w*t) - c/m*y(2) - k/m*y(1); end Example 2 modified to be a stiff ode problem function yprime = vibsfun(t,y) % y(1) is x % Y(2) is xdot $yprime (1) is xdot or y(2) % yprime (2) is x2dot m = 1; k = le-3; c = 1; yprime = [0:0]; yprime(1) = y(2); yprime (2) = - c/m*y(2) k/m*y(1); end
% Mar. 22 88 Beam deflection define all the known parameters & divide the length into n subdivisions 8 N = 10000; dx = L/N; ni = round (L1/dx); N2 = round ((L2-L1)/dx); calculate the reactions forces R1 = R2 = & create the known vector, p_n Pn = zeros (N+1,1); % replace the elements in Pn using the specific expression/values for that $ beam section for n = 2:N1+1 Pn(n) = end for n = N1+2: N1+N2+1 Pn(n) = end for n = N1+N2+2:N Pn(n) = end & define the coefficient matrix A A = zeros(N+1,N+1); f use diag function to modify the matrix A, matching the tridiagnol matrix % solve for the linear equations у A\Pn;