bvp4c for coupled interface boundary conditions

1 次查看(过去 30 天)
Here I am trying to solve a system of ODE with coupled boundary conditions, but got stucked. I dont know how to define coupled boundary condition in Matlab. Can anybody please help me. If any other information is required please let me know. Moreover, one PDF file is also attached there with name bvp4c with the complete details of the ODE and respective boundary conditions.
function pp(solver)
infinity =1;
maxinfinity=infinity;
pp1=infinity;
pp2=maxinfinity;
%CONSTANTS
%--------------------------------------------------------------------------
p=0.01;
e=0.783;
H=1;
M=1;
a=1.92;
%--------------------------------------------------------------------------
solver = 'bvp4c';
bvpsolver = fcnchk(solver);
infinity = pp1;
maxinfinity = pp2;
Mva=[0.5 1 1.5 2];
colors = ['k','m','r','b'];
for j = 1:4
Le=Mva(j);
for d=Mva(j)
solinit = bvpinit(linspace(0,infinity,45),[1 1 1 0 1 0 1 0 0 1 1 1 1 1 1 1]);
sol = bvpsolver(@fsode,@fsbc,solinit);
eta = sol.x;
f = sol.y;
solinit = bvpinit(linspace(0,0.5,100),[0.001 0 0 0]);
sol = bvp4c(@pp2_ode,@pp2_bc,solinit,options);
x = sol.x;
y1 = sol.y(1,:);
y2 = sol.y(2,:);
y3 = sol.y(3,:);
y4 = sol.y(4,:);
figure(5)
plot(real(y(1,:)+p*exp(1i*t)*y(3,:)),eta,colors(j),'LineWidth',2)
plot(real(y(5,:)+p*exp(1i*t)*y(7,:)),eta,colors(j),'LineWidth',2)
hold on
%--------------------------------------------------------------------------
function dydx = pp2_ode(x,y)
dydx = [y(2)
(((M^2)*y(1))-((H)^2))
y(4)
(((M^2)+(i*((H)^2)))*y(3))-((H)^2)
y(6)
-a*((H)^2)
y(8)
((i*a*(H)^2)*y(7))/e-(a*((H)^2))];
end
%--------------------------------------------------------------------------
function res = pp2_bc(ya,yb)
res = [ ya(1)
]

回答(1 个)

Torsten
Torsten 2023-1-31
Read this carefully, and you will know how to set up your problem:
  1 个评论
Komal Goyal
Komal Goyal 2023-2-1
Thank you @Torsten for you suggestion. After reading that, I was trying to write code for my ODEs, but it was showing some error. Can you please check that once, Just now I uploded that as my question.
Once again thank you

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Boundary Value Problems 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by