BOUNDARY CONDITIONS FOR BVP4C...... IN 4 ODE unknowns..... only 2 Unknown values are calculated... for remaining 2 values are 0 at all intervals.... Please go through following....... waiting for reply...... thanks.....
Show older comments
function ex1bvp
clc
solinit = bvpinit(linspace(0,1,15),@ex1init);
sol = bvp4c(@ex1ode,@ex1bc,solinit);
x = sol.x;
y = sol.y;
clf reset
plot(x,y')
axis([0 1 -0.5 2.5])
title('Example problem for BEAM')
xlabel('z')
% --------------------------------------------------------------------------
function dydx = ex1ode(x,y)
m=1;
L=4;
mp=m*pi/L;
c11=1.0989*(10^6);
c22=1.0989*(10^6);
c12=0.32967*(10^6);
c21=0.32967*(10^6);
c33=0.3846*(10^6);
Bx=0;
Bz=0;
dydx = [ (-mp*y(2))+(y(3)/c33)
(c21*mp*y(1)/c22)+(y(4)/c22)
((c11-(c21*c12/c22))*mp*mp*y(1))-(c12*mp*y(4)/c22)-Bx
((mp*y(3))-Bz) ]
%-------------------------------------------------------------------------
function res = ex1bc(ya,yb)
res = [ ya(4)
yb(4)-1
ya(3)
yb(3)];
%-------------------------------------------------------------------------
function v = ex1init(x)
v = [ 0.0000001
-100
1
-0.1 ];
Answers (0)
Categories
Find more on Numerical Integration and Differential Equations 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!