How do i solve huge coupled first order differential equations

조회 수: 3 (최근 30일)
Arun S
Arun S 2021년 7월 17일
댓글: Star Strider 2021년 7월 17일
Hello all,
I have a system of 25 coupled first order constant coefficient linear differential equations (time evolution of a multistep reaction). The problem is I want to calculate the solution upto say 100 microseconds. I am able to calculate upto 1 microsecond using ode45 (which itself gives an array of 16912805 data points). Anything 3 microseconds and above crashes my computer completely.
Is there any way I can solve this problem? a user defined function or an ode solver which allows me to input the timestep (because when i read the documentation for ode45, i found out that the time step is controlled internally and thus i cant specify a larger timestep to save computation time).
  댓글 수: 2
Torsten
Torsten 2021년 7월 17일
Don't use ode45 for chemical reaction problems, but ode15s instead.
Arun S
Arun S 2021년 7월 17일
Thank you ode15s drastically reduced my computation time.

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

채택된 답변

Star Strider
Star Strider 2021년 7월 17일
The integration times are adaptive, however it is possible control the points at which the differential equation system is evaluated and appear in the output.
For example to integrate at 100 points between 0 and 100 microseconds, this could work:
tspan = linspace(0, 1E-4, 100);
Use that (or something similar) for tspan’ in your system to see if it does what you want.
.
  댓글 수: 2
Arun S
Arun S 2021년 7월 17일
Thank you so much. This along with using ode15s solved my problem.
Star Strider
Star Strider 2021년 7월 17일
As always, my pleasure!
.

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

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