MATLAB Answers

Time-dependent parameter for ODE system

1 view (last 30 days)
Ildar Sadreev
Ildar Sadreev on 24 Nov 2019
Commented: Ildar Sadreev on 26 Nov 2019
suppose I have a system of ODEs for y1 and y2:
d/dt(y1) = a*f(t) - b*y1,
d/dt(y2) = m*y1 - n*y2,
where a, b, m and n are positive constants and f(t) is a time-dependent parameter.
The problem is that f(t) is available only as a vector (not an explicit function of t) on the same time scale as the one used for the ODEs solving.
How could I pass the corresponding value of f into the system of ODEs for the corresponding time?
Your suggestions would be greatly appreciated.
Many thanks,


Sign in to comment.

Accepted Answer

Stephan on 24 Nov 2019
Edited: Stephan on 24 Nov 2019
use interp1 to achieve this - an example of how to do this is here.

  1 Comment

Sign in to comment.

More Answers (0)

Sign in to answer this question.