

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Hw matlab code numerical methods
Typology: Exercises
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Problem set 9 2
w0=40; L=3; I=0.0002; E=15010^9; f=@(x,th) (w0/(120EIL))(-5x^4+6L^2x^2-L^4); [x1,TH]=system(f,[0,3],0,0.1); x= 0:0.01:3; y=(3.70410^-9)(-x.^5+18x.^3-81x); plot(x1,TH,x,y); xlabel ('Distance along beam (m)') ylabel ('Deflection (m)') title('Distance along beam vs Deflection') legend('Euler approx','Analytical solution') function [t,y]=system(Func,Tspan,Y0,h) t0=Tspan(1); tf=Tspan(2); N=(tf-t0)/h; y=zeros(length(Y0),N+1);
y(:,1)=Y0; t=t0:h:tf; for i=1:N y(:,i+1)=y(:,i)+h*Func(t(i),y(:,i)); end end
w0 = 40; L = 3; E = 15010^9; I = 0.0002; f=@(x) (w0/(120EIL))(-5x.^4+6L^2x.^2-L^4);