bvp4c for coupled interface boundary conditions

조회 수: 4 (최근 30일)
Komal Goyal
Komal Goyal 2023년 1월 31일
댓글: Komal Goyal 2023년 2월 1일
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