필터 지우기
필터 지우기

how to change time integration in pdepe

조회 수: 2 (최근 30일)
feynman feynman
feynman feynman 2024년 2월 8일
댓글: feynman feynman 2024년 3월 4일
ode15s is used in pdepe. How to change it to say ode23 etc when in need?
  댓글 수: 6
Torsten
Torsten 2024년 2월 8일
I don't know how "pdepe" is arranged. If you can find the call to "ode15s" somewhere while editing the code, you could try to change it to a call to "ode23".
feynman feynman
feynman feynman 2024년 2월 8일
not really, because in pdepe there are functions like pdentrp that we can't use out of pdepe.

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

채택된 답변

Sanju
Sanju 2024년 2월 28일
I understand that you want to change ODE solver whenever required,
‘pdepe’ is a function specifically designed for solving systems of partial differential equations in MATLAB. ‘pdepe’ internally selects an appropriate ODE solver based on the characteristics of the problem, and it does not allow you to specify ‘ode23’ or any other specific ODE solver.
If you need more control over the ODE solver used within ‘pdepe’, you can try to adjust the options provided to ‘pdepe’. For instance, you can specify tolerances, time steps, and other parameters that might affect the behaviour of the internal ODE solver.
Also, there’s an option for directly selecting the desired ODE solver for which you can directly use ‘ode23’ function call to solve the ODE,
Here’s an example code you can refer to,
% Define the ODE function
odefun = @(t, y) -y;
% Define the initial condition
y0 = 1;
% Define the time span
tspan = [0 10];
% Solve the ODE using ode23
[t, y] = ode23(odefun, tspan, y0);
Similarly, you can use other ODE solvers available in MATLAB such as ode45, ode23s, etc., by replacing ode23 with the desired solver function handle.
You can also refer to the following documentation links if required,
Hope this helps!
  댓글 수: 16
Torsten
Torsten 2024년 3월 3일
편집: Torsten 2024년 3월 3일
Because the other options are not related to the structure of the DAE problem, but to the performance of its solution.
If the solver cannot cope with the structure of the problem, this is a Ko criterion right at the beginning.
feynman feynman
feynman feynman 2024년 3월 4일
great point thank you

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

추가 답변 (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