How to plot the direction field of a system of first-order ODEs using MATLAB?
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to use MATLAB to plot the direction field of a system of first-order ODEs. I can plot the direction field of one single ODE using quiver(), but I have no idea about how to do it with a system of ODEs. For exmple, I want to draw the direction field of the following system of ODEs:

Could anyone show me how to do this, or provide me with some reference links and websites of instruction so that I can self-study? Thank you so much!
0 commentaires
Réponse acceptée
Sam Chak
le 8 Jan 2023
The basic code looks like the following:
[X, Y] = meshgrid(-2:4/14:2, -2:4/14:2);
U = 2*X + 9/5*Y;
V = -5/2*X - 1*Y;
quiver(X, Y, U, V)
axis square
xlabel('x_{1}'), ylabel('x_{2}')
2 commentaires
Sam Chak
le 10 Jan 2023
You are welcome, @Kieth Duong. If you find the MATLAB code solves the problem, please consider accepting ✔ and voting 👍 the Answer. Thanks a bunch! 🙏
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Ordinary Differential Equations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
