I'd like to plot the graph of the direction field for a differential equation, to get a feel for it. I'm a novice, right now, when it comes to plotting in Mathematica, so I'm hoping that someone can provide a fairly easy to understand and thorough explanation. My hope is that I will become fairly proficient at understanding plotting in Mathematica, as well as differential equations. I'm a little more familiar with differential equations, but very far from what I'd consider to be an expert.
I do have an equation in mind, taken from this question from Math.SE:
$$y'=\dfrac{y+e^x}{x+e^y}$$
I ran DSolve
on it, and after a minute it was unable to evaluate the function. So perhaps this could make for an interesting exploration for others as well. I'm wondering what experience in Mathematica has taught others about what can be done in Mathematica - I'm hoping someone can offer some useful tips and demonstrations.
I'm really interested in learning about what can be done with differential equations, so I think that other equations will suffice if they serve as a better example.
Answer
For a first sketch of the direction field you might use StreamPlot
:
f[x_, y_] = (y + E^x)/(x + E^y)
StreamPlot[{1, f[x, y]}, {x, 1, 6}, {y, -20, 5}, Frame -> False,
Axes -> True, AspectRatio -> 1/GoldenRatio]
Comments
Post a Comment