# labr12 - y0 = 0 beam displacement = 0 at x=0 v0 =.001...

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

Doug Rivas ME 218 Lab 12 M 5-7 12.1 prb1.m: [t,x] = ode45( 'ex1' ,[0 15], 1); plot(t,x); grid ex1.m: function xprime=ex1(t,x) xprime=sin(t*x); fun1.m: function yprime = fun1(t,y) yprime = -2 * t * y^2; fun2.m: function yprime = fun2(t,y) yprime = [ y(2) ; y(1)-y(2) ]; 12.2

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

View Full Document
12.3 m=2, b=2, k=2
m=4, b=2, k=2 m=2, b=2, k=4

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

View Full Document
m=4, b=2, k=4 12.4 y’=f(x,y,z)= v v’= g(x,y,z)= ((1+v^2)^3/2)*((Ty/EI)*(wx(x-L)/2EI)) 12.5 function dz= beamfunc(x,z) L=100; w=100; E=10^7; T=500; I=500; v= z(2); y=z(1); yprime= v; vprime= ((1+v^2)^(3/2))*((T*y)/(E*I)+(w*x*(x-L))/(2*E*I)); dz= [yprime; vprime];
12.6 12.7 I used a value of v0=.000834

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

View Full Document
(Proof that the beam is within the +/- .0001) 12.8 The final value for v0 was : 0.000833250297675, which is more exact than in 12.7. The final error was: 1.077018228256080e-007
beamdeflect.m: clear all ; clf xspan = [0 100]; % solve over this interval (length of the beam)
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: y0 = 0; % beam displacement = 0 at x=0; v0 = .001; % choose slope of beam at x = 0; [x,z] = ode45( 'beamfunc' , xspan, [y0 v0]); y = z(:,1); % the deflection of the beam v0(1) = v0; % first guess for slope of beam at x = 0; v0(2) = 2; % second guess required for Secant method error(1) = y(length(x)); % the error obtained from the first guess. max_it = 10; tol = 0.000001; i = 1; while (i<max_it)&(abs(error(i))>tol) i = i+1; [x,z] = ode45( 'beamfunc' , xspan, [y0 v0(i)]); y = z(:,1); error(i) = y(length(x)); v0(i+1) = v0(i)-((v0(i)-v0(i-1))*error(i))/(error(i)-error(i-1)); % new guess from Secant method end format long , v0 error(i) plot(x,-y) title( 'Doug Rivas' ) xlabel( 'Position' ) ylabel( 'Deflection' )...
View Full Document

{[ snackBarMessage ]}

### Page1 / 7

labr12 - y0 = 0 beam displacement = 0 at x=0 v0 =.001...

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

View Full Document
Ask a homework question - tutors are online