Giter VIP home page Giter VIP logo

streamplot4d's Introduction

StreamPlot4D

Usage:

StreadmPlot4D[ 
	{ vt, vx, vy, vz }, 
	{ t, tmin, tmax },
	{ x, xmin, xmax },
	{ y, ymin, ymax },
	{ z, zmin, zmax }
  ]

generates a stream plot of the vector field { vt, vx, vy, vz } as a function of t, x, y, and z. The 4D phasespace will be shown as a 3D perspective projection where farther streams are shown in diferent colors. For help, type ? StreamPlot4D in Mathematica.

In the following example, 4D phasespace is confined to a tesseract with the color coding: blue = close, red = farther away. The 3D axes are (x,y,z) and the fourth axis is t. The shown vector field is:

	vt = 1, vx = -1 - x^2 + y, vy = 1 + x - y^2, vz = 1

Example

The code behind the plot is:

StreamPlot4D[
 {1, -1 - x^2 + y, 1 + x - y^2, 1},
 {t, -3, 3},
 {x, -3, 3},
 {y, -3, 3},
 {z, -3, 3},
 VectorPoints -> 0,
 StreamColorFunction -> (Blend[{{-3, Blue}, {3, Red}}, #[[1]]] &),
 ProjectionTo3D -> ({#[[2]], #[[3]], #[[4]]} (1 - 0.5 (#[[1]] + 3)/6) &),
 StreamPoints -> Tuples[{{0}, Range[-3, 3, 1], Range[-3, 3, 1], {0}}],
 StreamArrowheads -> Range[0, 1, 0.1],
 PlotRange -> Automatic, PlotRangePadding -> Scaled[.2],
 Boxed -> True, 
 ImageSize -> Scaled[1]
 ]

streamplot4d's People

Contributors

mekeetsa avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.