notebooks

Weierstrass ℘ Playground

This repository contains an interactive Jupyter notebook that visualizes complex fields derived from the Weierstrass ℘ function on a rectangular lattice and overlays shared second-order trajectories.

Features

Getting Started

  1. Install required dependencies:
    pip install numpy matplotlib ipywidgets
    
  2. Enable Jupyter widgets (for classic Jupyter):
    jupyter nbextension enable --py widgetsnbextension --sys-prefix
    
  3. Open the notebook:
    jupyter notebook weierstrass_playground.ipynb
    
  4. Run all cells and interact with the controls at the bottom.

Usage

  1. Set lattice parameters: Adjust p, q (lattice periods) and N (truncation level)
  2. Configure rendering: Set grid resolution, contour levels, and vector field display
  3. Add particles: Define initial positions (z0) and velocities (v0) for trajectories
  4. Integrate: Set time step (dt) and duration (T) for trajectory integration
  5. Render: Click the “Render” button to generate the visualization
  6. Save: Use “Save PNG” to export the current figure

Mathematical Background

The Weierstrass ℘ function is implemented using a truncated lattice sum for rectangular lattice Λ = ℤp + ℤiq:

℘(z) = 1/z² + Σ[1/(z-ω)² - 1/ω²]

where the sum runs over non-zero lattice points ω within the truncation bound N.

Trajectories are integrated using RK4 method with blow-up detection near poles and for large step sizes.

Examples

Dependencies