Skip to content

Instantly share code, notes, and snippets.

@zafarali
Created December 1, 2015 15:59
Show Gist options
  • Select an option

  • Save zafarali/1025b58b9ec5c2741cae to your computer and use it in GitHub Desktop.

Select an option

Save zafarali/1025b58b9ec5c2741cae to your computer and use it in GitHub Desktop.
A mathematica snippet to turn a polar dynamical system into a stream plot.
# your polar functions dr/dt and d\[Theta]/dt here:
field = {r (1 - r^2) (4 - r^2), 2 - r^2};
# Creates the stream plot
StreamPlot[
Evaluate@TransformedField["Polar" -> "Cartesian",
field, {r, \[Theta]} -> {x, y}], {x, -3, 3}, {y, -3, 3}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment