Defining derivatives in ode45
Mostrar comentarios más antiguos
Hi,
I want to use ode45 to solve a system of ODE as shown below (see the imgae). I am not sure about coding these two equations as I derived them using finite difference method according to the direction. I coded them as:
dydt(1,1) = f(y(1)) + f(y(2));
dydt(2,1) = - (f(y(1)) + f(y(2))); % with -1
The second one was multiplied by -1 to show a countercurrent flow. I am wondeing if this approach is correct. Or I should ignore the negative sign in coding these equations.
dydt(1,1) = f(y(1)) + f(y(2));
dydt(2,1) = (f(y(1)) + f(y(2))); % without -1
Thank you.

2 comentarios
John D'Errico
el 5 de Mayo de 2019
Why would you ignore the sign?
sina
el 5 de Mayo de 2019
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Ordinary Differential Equations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!