-
Notifications
You must be signed in to change notification settings - Fork 0
/
mwe.tex
81 lines (65 loc) · 1.32 KB
/
mwe.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
% MWE of generating a slope field of a differential equation
% with a calculated solution given an initial value
% written by
% <erik@heckman.ca> erik ben heckman 2021-03-22
% informed by
% https://tex.stackexchange.com/a/471743 (CC BY-SA 4.0)
% and
% https://tex.stackexchange.com/a/471720 (CC BY-SA 3.0)
\documentclass[border=5pt,tikz]{standalone}
\usepackage[]{defield}
\begin{document}
% empty
%
% \begin{tikzpicture} [
% declare function={f(\x,\y)=(1-\x)*\y-\x^2;},
% ]
% \defield%
% \end{tikzpicture}
% minimal
%
\begin{tikzpicture} [
declare function={f(\x,\y)=(1-\x)*\y-\x^2;},
]
\defield[
no axes,
xmin=-3, xmax=3,
ymin=-4, ymax=2,
]
\end{tikzpicture}
% typical use
%
\begin{tikzpicture} [
declare function={f(\x,\y)=(1-\x)*\y-\x^2;},
]
\defield[
title={\( y'=(1-x)y-x^2\)},
x_0=0, y_0=1,
xmin=-3, xmax=3,
ymin=-4, ymax=2,
]
\end{tikzpicture}
% styled
%
\begin{tikzpicture} [
declare function={g(\x,\y)=(1-\x)*\y^2-\x^2;}
]
\defield[
title={\( y'=(1-x)y^2-x^2\)},
function=g,
x_0=0, y_0=1,
xmin=-3, xmax=4,
ymin=-4, ymax=3,
x samples=48,% slope columns
y samples=24,% slope rows
slope style={orange, line width=0.75pt},
curve style={violet, latex-latex, line width=3pt},
no axes,
][% inserted after plot
%\tkzAxeXY
\tkzGrid
][% inserted before plot
%
]
\end{tikzpicture}
\end{document}