phase-portrait-generator

plurigrid's avatarfrom plurigrid

Generate phase portraits for 2D dynamical systems. Use when visualizing vector fields, nullclines, and trajectories.

⭐1stars🔀2forks📁View on GitHub🕐Updated Jan 9, 2026

When & Why to Use This Skill

The Phase Portrait Generator is a specialized Claude skill designed to visualize 2D dynamical systems by generating high-quality phase portraits. It enables researchers, scientists, and students to plot vector fields, identify nullclines, and analyze trajectories in state space, facilitating a deeper understanding of autonomous systems and differential equations through visual representation.

Use Cases

  • Case 1: Analyzing stability and equilibria in biological or chemical reaction models by visualizing state space trajectories.
  • Case 2: Visualizing the behavior of non-linear mechanical oscillators, such as the Van der Pol oscillator or pendulum systems, to study limit cycles.
  • Case 3: Educational demonstrations in physics or mathematics courses to illustrate the concepts of phase space, attractors, and bifurcation points.
  • Case 4: Validating numerical solutions of 2D differential equations by comparing them against generated vector fields and nullclines.
namephase-portrait-generator
descriptionGenerate phase portraits for 2D dynamical systems. Use when visualizing vector fields, nullclines, and trajectories.
version1.0.0

Phase Portrait Generator

Generates phase portraits showing vector fields and trajectories in 2D state space.

When to Use

  • Visualizing 2D autonomous systems
  • Plotting nullclines and equilibria
  • Trajectory analysis in phase space

GF(3) Role

PLUS (+1) Generator - creates visual outputs from differential equations.

Quick Example

import numpy as np
import matplotlib.pyplot as plt

def phase_portrait(f, xlim=(-3,3), ylim=(-3,3), density=20):
    x = np.linspace(*xlim, density)
    y = np.linspace(*ylim, density)
    X, Y = np.meshgrid(x, y)
    U, V = f(X, Y)
    plt.streamplot(X, Y, U, V, density=1.5)
    plt.xlabel('x'); plt.ylabel('y')

# Van der Pol oscillator
phase_portrait(lambda x, y: (y, -x + (1 - x**2) * y))

Integration with bifurcation skills

Forms triad with:

  • bifurcation (0): detects transitions
  • bifurcation-generator (+1): parameter space
  • phase-portrait-generator (+1): state space