Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

%Program for fem - Cantilever beam with varying udl

close all
clear all
clc;
l=1;
ae=1;
a=1;
x=linspace(0,1,16);
%Exact Result
y=(a*x.*(3*l.^2-x.^2)/(6*ae));
%Result by weak form quadratic eqn
z=(a*l.*(7*l*x-3*x.^2)/(12*ae));
%Result by strong form quad eqn
v=(15*a*l.*(2*l*x-x.^2)/(48*ae));
%Plot
plot(x,y,'-o');
hold on
plot(x,z,'-s');
hold on
plot(x,v,'-d');
legend('Exact Result','Weak Form','Strong Form')

Published with MATLAB® R2014b

You might also like