-
Notifications
You must be signed in to change notification settings - Fork 3
/
physics-vanderpol_oscilator.tex
58 lines (48 loc) · 1.3 KB
/
physics-vanderpol_oscilator.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
% https://latexdraw.com/phase-portrait-of-van-der-pol-oscillator/
\documentclass[border=0.2cm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat = newest}
% Define arrow's style
\usetikzlibrary{decorations.markings}
% Arrow style
\tikzset{decorated arrows/.style={
postaction={
decorate,
decoration={
markings,
mark=between positions 0 and 1 step 15mm with {\arrow[black]{stealth};}
}
},
}
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
grid=both,
grid style={dashed,red!20},
xmin = -4, xmax = 4,
ymin = -4, ymax = 4,
width = \textwidth,
height = 0.7\textwidth,
xlabel = {$x$},
ylabel = {$y$},
title={Phase Portrait of Van Der Pol Oscillator},
view = {0}{90},
]
% Vector Field
\addplot3[
quiver = {
u = {y/sqrt(y^2+(0.8*(1-x^2)*y-x)^2)},
v = {(0.8*(1-x^2)*y-x)/sqrt(y^2+(0.8*(1-x^2)*y-x)^2)},
scale arrows = 0.25,
},
-stealth,
domain = -4:4,
domain y = -4:4,
lightgray]
{0};
% Plot the Limit Cycle
\addplot[ultra thick, red, decorated arrows] file {./data/vanderpol.txt};
\end{axis}
\end{tikzpicture}
\end{document}