Solving the same linear ODE with several initial conditions
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, I want to solve a system of the form X(t)'=A*X(t) several times with different initial conditions. Of course, I could solve it separately for each initial condition in a loop, but I was hoping that there is a vectorized method for this.
Here's a more precise description of what I'm looking for: A is an NxN matrix. X0 is MxN where M is the number of initial conditions. TIME is a 1xT vector where T is the number of time bins I want for my solution. I would like a solution X that is MxNxT (or NxMxT, etc) that represents the solution to X'=A*X for each initial condition and at each time.
I first tried using expm since I could apply the result to the matrix X0, but I would need to calculate expm separately at each time bin (requiring a time loop).
I then thought of using ode45 since it takes a vector of times. But it takes only one initial condition (requiring a loop over X0).
Any ideas?
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!