how can i solve mutiple point bvp problem using bvp4c of two higher order ODE.

1 view (last 30 days)
Am trying to solve two higher order multiple boundary problems ODE equations using bvp4c. here are my equations.
k*u(1)''''(x) = -k1(x). boundary conditions u1(0)= u1(0)'= u2(L) = u2(L)'= 0.
k*u(2)''''(x) = -k1(x). boundary conditions u1(a)= u2(a),u1(a)'= u2(a)',u1(a)''= u2(a)'', -k*u1(a)''' + P + k* u2(a)''''= 0.
Where k,p and K1 are known parameters and the two equations indicate two regions on the same graph.
HERE ARE MY CODES
function dydx = fourode8(x,y);
dydx = zeros(4,1);
xp1 = 0;
delta1 = 10;
p=0;
if(x>xp1 && x<xp1+delta1)
p = 80*10^(-6);
end
k1=0;
if(x>xp1 && x<xp1+delta1)
k1 = 60*10^(-3);
end
k=4000*10^(-3);
switch region
case 1
dydx(1) = [ y(2)
y(3)
y(4)
-abs(k1*y(2))/k];
case 2
dydx(2) = [ y(6)
y(7)
y(8)
-abs(k1*y(6))/k];
end
boundary Conditions
function res = fourbc(ya,yb)
res = [ ya(1)
ya(2)
ya(4)-yb(4)
ya(5)-yb(5)
ya(6)-yb(6)
-k*ya(7)+k*yb(8)+p
yb(1)
yb(2) ];
end
Code to call my function
xc = 5;
xinit =[0, 2.5, xc, xc, 7.5, 10]
solinit = bvpinit(xinit,[0 0 0 0]);
sol = bvp4c(@fourode8,@fourbc,solinit);
y = deval(sol,x);
plot(x,y(1,:),'LineWidth',2);
When i run my command i keep getting an error saying '' too many inputs argument''. i really need help. plssssss

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!