Applying Boundary Condition to ODE45

Hi all,
I have a set of coupled differential equations which are readily arranged to be solved on ode45 in a domain [0 L]. However, all the boundary conditions of the differential equations are given at x=L instead of x=0. I cannot enforce these BCs to my problem using MATLAB. How can i accomplish that ? (I would like to solve set of ODEs using 4th order Runge Katta Method)
Kind Regards

 採用された回答

Stephan
Stephan 2019 年 4 月 21 日
編集済み: Stephan 2019 年 4 月 21 日

0 投票

Hi,
you can reverse tspan. If you for example use:
tspan = [20 0]
then the integration will be backwards and your condition is an initial condition.
Best regards
Stephan

2 件のコメント

Oguz Altunkas
Oguz Altunkas 2019 年 4 月 21 日
was it that simple :D thanks alot Stephen
Maomao Wang
Maomao Wang 2021 年 3 月 28 日
Awesome, that works, thanks alot Stephen.

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

その他の回答 (0 件)

カテゴリ

質問済み:

2019 年 4 月 21 日

コメント済み:

2021 年 3 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by