Boundary value problem with 3 regions

3 ビュー (過去 30 日間)
Jagadeesh Korukonda
Jagadeesh Korukonda 2020 年 4 月 25 日
編集済み: Anadi Mondal 2022 年 9 月 6 日
Hello,
I have BVP with 3 region d²Y/dX²=constant
Region 1: [0,a] d²Y1/dX²=constant1
Region 2: [a,b] d²Y2/dX²=constant2
Region 3: [b,c] d²Y3/dX²=constant3
BCs: Y1(0)=Pc(constant)
Y1' = Y2' @x=a Y1 = Y2 @x=a
Y2' = Y3' @x=b Y2 = Y3 @x=b
Y3(c) = Pl (constant)
0<a<b<c
Help me in solve this problem using bvp5c
  1 件のコメント
darova
darova 2020 年 4 月 25 日
Can you show your attemtps?

サインインしてコメントする。

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 25 日
This page has a detailed explanation for BVP with multiple boundary conditions: https://www.mathworks.com/help/matlab/math/solve-bvp-with-multiple-boundary-conditions.html
For your problem, try this code
a = 1;
b = 2;
c = 3;
x = [linspace(0,a,10) linspace(a,b,10) linspace(b,c,10)];
yinit = [1; 1];
x0 = bvpinit(x,yinit);
sol = bvp5c(@odeFun, @bcFun, x0);
function dydx = odeFun(x, y, r)
switch r
case 1
c = 0.2; % constant in region 1
case 2
c = 0.5; % constant in region 2
case 3
c = 0.3; % constant in region 3
end
dydx = [y(2); c];
end
function res = bcFun(YL, YR)
res = [YL(1,1); % Y1(0)=Pc(constant)
YR(1,1) - YL(1,2); % Y1 = Y2 @x=a
YR(2,1) - YL(2,2); % Y1' = Y2' @x=a
YR(1,2) - YL(1,3); % Y2 = Y3 @x=b
YR(2,2) - YL(2,3); % Y2' = Y3' @x=b
YR(1,3)-1]; % Y3(c) = Pl (constant)
end
  1 件のコメント
Anadi Mondal
Anadi Mondal 2022 年 9 月 6 日
編集済み: Anadi Mondal 2022 年 9 月 6 日
Thank you @Ameer Hamza . I was badly seraching for the solution technique for this type of problem.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by