Skip to content

Instantly share code, notes, and snippets.

@BrianWeinstein
Last active May 13, 2018 13:40
Show Gist options
  • Save BrianWeinstein/6f3881b6801a39a335a5 to your computer and use it in GitHub Desktop.
Save BrianWeinstein/6f3881b6801a39a335a5 to your computer and use it in GitHub Desktop.
x[A1_, A2_, f1_, f2_, p1_, p2_, d1_, d2_, t_] := A1 Sin[t f1 + p1] E^(-d1 t) + A2 Sin[t f2 + p2] E^(-d2 t)
y[A3_, A4_, f3_, f4_, p3_, p4_, d3_, d4_, t_] := A3 Sin[t f3 + p3] E^(-d3 t) + A4 Sin[t f4 + p4] E^(-d4 t)
Manipulate[
ParametricPlot[
{x[A1, A2, f1, f2, p1, p2, d1, d2, t],
y[A3, A4, f3, f4, p3, p4, d3, d4, t]},
{t, 0, tmax},
PlotPoints -> 200, Axes -> False, PlotStyle -> {Thick, Opacity[0.5]}, PlotRange -> All
],
Style["time", Bold, Medium],
{{tmax, 100}, 0.001, 200},
Delimiter,
Style["x1", Bold, Medium],
{{A1, 1}, 0, 4},
{{f1, 1}, 0, 20, 0.5, Appearance -> "Open"},
{{p1, 0}, 0, 2 Pi},
{{d1, 0.01}, 0, 0.1},
Delimiter,
Style["x2", Bold, Medium],
{{A2, 1}, 0, 4},
{{f2, 2}, 0, 20, 0.5, Appearance -> "Open"},
{{p2, 0}, 0, 2 Pi},
{{d2, 0.01}, 0, 0.1},
Delimiter,
Style["y1", Bold, Medium],
{{A3, 1}, 0, 4},
{{f3, 3}, 0, 20, 0.5, Appearance -> "Open"},
{{p3, 0}, 0, 2 Pi},
{{d3, 0.01}, 0, 0.1},
Delimiter,
Style["y2", Bold, Medium],
{{A4, 1}, 0, 4},
{{f4, 4}, 0, 20, 0.5, Appearance -> "Open"},
{{p4, 0}, 0, 2 Pi},
{{d4, 0.01}, 0, 0.1},
ControlPlacement -> Left
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment