Use rk4 (ode45) to get a solution on signals both contra and co propagating

조회 수: 1 (최근 30일)
Hugo
Hugo 2024년 10월 7일
댓글: Hugo 2024년 10월 8일
Hi,
I am trying to solve a system of equation where my solution vector looks like among which is contra propagating with respect to a length parameter and is copropagating . I see no issue when defining my parameters (initial condition and solving domain) if all the components of my vectors are going in the same direction, however how do I define them if it is not the case. Is there a known solution when it comes to defining this kind of systems?
I do not need a code just to be pointed to the right direction, please.
(I have been using ode45 for the copropagating case)
Thanks!

채택된 답변

Hitesh
Hitesh 2024년 10월 8일
Hi Hugo,
From what I understand, you are trying to solve a system of equations whose solution vector contains contra propagating and copropagating vectors with respect to a length parameter(z). It addresses both problems, boundary value problem and an initial condition problem. This is because the components of the solution vector propagate in opposite and same directions simultaneously.
For such problems, one can use solvers specifically designed for boundary value problems, such as bvp4c or bvp5c in MATLAB. These solvers allow you to specify boundary conditions at both ends of the domain, making them suitable for handling components that propagate in different directions.
For more information on Boundary Value Problems, refer to below MATLAB documentation:
Hope this helps!
  댓글 수: 1
Hugo
Hugo 2024년 10월 8일
Thanks, that is what I was looking for, the method I was using was very slow in comparison (a shooting method where I had to solve my system multiple time until I get the right initial conditions)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by