# Direction Field for an Ordinary Differential Equation [duplicate]

I have found links for plot the direction field of a differential equation. For example:

How can I plot the direction field for a differential equation?

And:

Plotting the direction field of a differential equation

But when I am teaching differential equations in the spring 2015, these are not the forms I would prefer. I am struggling mightily with the VectorScale options unitlen, aratio, sfun, so much so that I fear my students would not be able to handle these.

The equation I am dealing with is:

$$\frac{dy}{dt}=e^{-t}-2y$$

If I do the following:

VectorPlot[{1, Exp[-t] - 2 y}, {t, -2, 3}, {y, -1, 2}, Axes -> True]


I get the following image: Now, the difficulty here is that some of the arrows overlap, some are too small to interpret. I've spent about 4 hours this morning playing with the VectorScale command, trying to understand unitlen, a ratio, and sfun, but minimal success. So far, here is the best image I have come up with. I normalized all the vectors so they had length one, then I set the VectorScale to 0.03.

VectorPlot[Normalize[{1, Exp[-t] - 2*y}], {t, -2, 3}, {y, -1, 2}, VectorScale -> .03, Axes -> True ]

Here is the resulting image: This is the one I like the best so far, but I am just a beginner. If folks on this site have better suggestions so that I can easily help students who have never used Mathematica before, I'd love to hear them.

• Mark McClure has done some nice things. E.g. mathematica.stackexchange.com/questions/43155/… – Michael E2 Nov 22 '14 at 21:09
• Related: 43478 – C. E. Nov 22 '14 at 21:37
• @Pickett I can't imagine a better answer than Mark's answer to 43478. I suppose one could replace the 0.03 by 0.5 divided by the number of VectorPoints (15), or deal with the slightly off lengths due to the AspectRatio. – Michael E2 Nov 22 '14 at 21:53
• @MichaelE2 I agree with you so much that I initially (before I commented) voted to close this as a duplicate, but my insecurity got the better of me and I retracted my vote so now I've lost my voting rights :) – C. E. Nov 22 '14 at 22:05
• @Pickett No big deal. Good find, although I realize you may have had an advantage. :) – Michael E2 Nov 22 '14 at 22:40