File:Hyperbolic flow example, illustrating stable and unstable manifolds.png

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Original file(692 × 665 pixels, file size: 309 KB, MIME type: image/png)

Summary

Description
English: ```python

import numpy as np import matplotlib.pyplot as plt

  1. Define the vector field

def f(x, y):

   return np.array([x + np.exp(-y), -y])
  1. Define the domain

xmin, xmax, ymin, ymax = -1.7, -0.5, -1, 1

  1. Define the grid

nx, ny = 80, 80 x = np.linspace(xmin, xmax, nx) y = np.linspace(ymin, ymax, ny) X, Y = np.meshgrid(x, y)

  1. Evaluate the vector field on the grid

U, V = f(X, Y)

  1. Plot the vector field

fig, ax = plt.subplots(figsize=(8, 8)) ax.set_xlim(xmin, xmax) ax.set_ylim(ymin, ymax)

  1. Plot the integral curves

x0, y0 = np.meshgrid(np.linspace(-2, 0, 40), np.linspace(-1, 1, 40)) t = np.linspace(0, 5, 100) for i in range(x0.shape[0]):

   for j in range(x0.shape[1]):
       x, y = x0[i,j], y0[i,j]
       sol = np.zeros((2, t.size))
       sol[:,0] = [x, y]
       for k in range(1, t.size):
           sol[:,k] = sol[:,k-1] + f(sol[0,k-1], sol[1,k-1])*(t[k]-t[k-1])
       ax.plot(sol[0,:], sol[1,:], 'b-', linewidth=1, alpha=0.1)

plt.show()

```
Date
Source Own work
Author Cosmia Nebula

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

18 April 2023

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current23:30, 18 April 2023Thumbnail for version as of 23:30, 18 April 2023692 × 665 (309 KB)Cosmia NebulaUploaded while editing "Stable manifold" on en.wikipedia.org
The following pages on the English Wikipedia use this file (pages on other projects are not listed):

Global file usage

The following other wikis use this file:

Metadata