MATLAB Answers

ODE with time dependant variable

23 views (last 30 days)
hello, I have this problem and I need to solve it with either RK-4 or Euler method. f, K, rm, u are constants.

  0 Comments

Sign in to comment.

Accepted Answer

Bjorn Gustavsson
Bjorn Gustavsson on 3 Dec 2020
Go to the help and then online documentation for ODE45, there you will find illustrated examples for both multiple coupled ODEs and ODEs with time-dependent coefficients. For your example it seems that only the solutions G_i(t) depends on time, but that is covered there. You might have to write your coupled ODEs with some thought using either a loop, or a sparse matrix to calculate the (G_i - G_i-1) factors, but that should in principle be rather straightforward. (Advice on that: Check with a small enough n that you can inspect the equation/function by hand.)
HTH

  0 Comments

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!