BVP4C, differential equation for beam deflection
Show older comments
Hi fantastic MathWorks community.
I've been browsing and reading tons of material trying to understand how to implement BVP4C into my problem - but with no luck..
The guides that are available usually looks something like: y´´ + 2y = 0 - but my equation has a value that changes with x.
I want to plot the deflection w along the length x.
The boundary conditions are:
My M(x), E(x) and I(x) are vectors , example:
M = [50 40 30 20 10 0]
I = [1 1 1 2 2 2]
E = [190e9 190e9 100e9 100e9 100e9 100e9]
---------------
I started with converting it into a first order ODE:
This is what I wrote so far... I don't know where to go from here.
function dwdx = mybvp(x,w, M, E, I)
dwdx = [ w(2); M/(E*I)];
end
function res = mybvpbc(wl,wr)
res = [ wl(1); wr(2) ];
end
Thanks in advance!
Answers (1)
This is the solution for w(0)=w'(0)=0:
M = [50 40 30 20 10 0];
I = [1 1 1 2 2 2];
E = [190e9 190e9 100e9 100e9 100e9 100e9];
A = [-1 0 1 0 0 0 0 0; ...
0 1 0 0 0 0 0 0 ; ...
1 -2 1 0 0 0 0 0; ...
0 1 -2 1 0 0 0 0; ...
0 0 1 -2 1 0 0 0; ...
0 0 0 1 -2 1 0 0; ...
0 0 0 0 1 -2 1 0; ...
0 0 0 0 0 1 -2 1];
b = [0 ; 0 ; (M./(I.*E)).'];
w = A\b;
w = w(2:7)
And this is the solution for w(0)=0, w'(L)=0:
M = [50 40 30 20 10 0];
I = [1 1 1 2 2 2];
E = [190e9 190e9 100e9 100e9 100e9 100e9];
A = [1 -2 1 0 0 0 0 ;...
0 1 0 0 0 0 0 ;...
0 1 -2 1 0 0 0 ;...
0 0 1 -2 1 0 0 ;...
0 0 0 1 -2 1 0 ;...
0 0 0 0 1 -2 1 ;...
0 0 0 0 0 1 -1];
b = [M(1)/(I(1)*E(1)) ; 0 ; (M(2:end-1)./(I(2:end-1).*E(2:end-1))).';0.5*M(end)/(I(end)*E(end))];
w = A\b;
w = w(2:7)
This is the best approximation for w you can get with your data.
3 Comments
Ed
on 6 Mar 2022
Torsten
on 6 Mar 2022
First you will have to tell us what the correct boundary condition is.
The usual discretization for
w''(x) = f(x)
is
(w(x(i+1))-2*w(x(i))+w(x(i-1)))/dx^2 = f(x(i))
In your case:
x(i) = i (i=0,...,5)
and
f(x(i)) = M(x(i))/(I(x(i))*E(x(i)))
So you get the equations (assuming w(0)=w'(0)=0)
(w(1)-w(-1))/2 = 0 %implements w'(0) = 0
w(0) = 0 %implements w(0) = 0
(w(1)-2*w(0)+w(-1))/1^2 = M(0)/(I(0)*E(0)) % implements w''(0) = M(0)/(I(0)*E(0))
(w(2)-2*w(1)+w(0))/1^2 = M(1)/(I(1)*E(1)) % implements w''(1) = M(1)/(I(1)*E(1))
(w(3)-2*w(2)+w(1))/1^2 = M(2)/(I(2)*E(2)) % implements w''(2) = M(2)/(I(2)*E(2))
(w(4)-2*w(3)+w(2))/1^2 = M(3)/(I(3)*E(3)) % implements w''(3) = M(3)/(I(3)*E(3))
(w(5)-2*w(4)+w(3))/1^2 = M(4)/(I(4)*E(4)) % implements w''(4) = M(4)/(I(4)*E(4))
(w(6)-2*w(5)+w(4))/1^2 = M(5)/(I(5)*E(5)) % implements w''(5) = M(5)/(I(5)*E(5))
If you write this in matrix form
A*w = b
with the unknowns
w(-1),w(0),w(1),w(2),w(3),w(4),w(5),w(6)
you get A and b.
Categories
Find more on Pulsed Waveforms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!