File:Van der Pol oscillator phase plot Liénard transformation.webm

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(WebM audio/video file, VP9, length 9.7 s, 1,600 × 1,600 pixels, 12.66 Mbps overall, file size: 14.61 MB)

Captions

Captions

van der Pol oscillator phase plot after , still with mu varying from 0.1 to 3.0.

Summary[edit]

Description
English: ```python

%%capture for i, mu in enumerate(np.exp(np.linspace(np.log(0.1), np.log(4.0), 121))):

   def system(t, xy):
       x, y = xy
       dx = mu * (x - x**3/3) - y
       dy = x / mu
       return [dx, dy]
   vmin, vmax, wmin, wmax = -4, 4, -4, 4
   t_span = [0, 10]
   trajectory_resolution = 30
   initial_conditions = [(x, y) for x in np.linspace(vmin, vmax, trajectory_resolution) for y in np.linspace(wmin, wmax, trajectory_resolution)]
   sols = {}
   for ic in initial_conditions:
       sols[ic] = solve_ivp(system, t_span, ic, dense_output=True, max_step=0.01)
   vs = np.linspace(vmin, vmax, 200)
   v_axis = np.linspace(vmin, vmax, 20)
   w_axis = np.linspace(wmin, wmax, 20)
   v_values, w_values = np.meshgrid(v_axis, w_axis)
   dv, dw = system(0, (v_values, w_values))
   fig, ax = plt.subplots(figsize=(16,16))
   # integral curves
   for ic in initial_conditions:
       sol = sols[ic]
       ax.plot(sol.y[0], sol.y[1], color='k', alpha=0.4, linewidth=0.5)
   # vector fields
   arrow_lengths = np.sqrt(dv**2 + dw**2)
   dv = dv / arrow_lengths * np.tanh(arrow_lengths)
   dw = dw / arrow_lengths * np.tanh(arrow_lengths)
   alpha_values = 1 - (arrow_lengths / np.max(arrow_lengths))**0.2
   ax.quiver(v_values, w_values, dv, dw, color='blue', linewidth=0.5, scale=25, alpha=alpha_values)
   # nullclines
   vs = np.linspace(vmin, vmax, 1000)
   ax.plot(vs, mu * (vs - vs**3/3),  color="green", alpha=0.4)
   ax.set_title(f'van der Pol oscillator\n$\mu={mu:.2f}$')
   ax.set_xlim(vmin, vmax)
   ax.set_ylim(wmin, wmax)
   ax.set_xticks([])
   ax.set_yticks([])
   dir_path = f"./vdp2"
   if not os.path.exists(dir_path):
       os.makedirs(dir_path)
   fig.savefig(f"{dir_path}/{i}.png")

import imageio.v3 as iio import os from natsort import natsorted import moviepy.editor as mp

for dir_path in ["./vdp", "./vdp2"]:

   file_names = natsorted((fn for fn in os.listdir(dir_path) if fn.endswith('.png')))
   # Create a list of image files and set the frame rate
   images = []
   fps = 12
   # Iterate over the file names and append the images to the list
   for file_name in file_names:
       file_path = os.path.join(dir_path, file_name)
       images.append(iio.imread(file_path))
   filename = dir_path[2:]
   iio.imwrite(f"{filename}.gif", images, duration=1000/fps, rewind=True)
   clip = mp.ImageSequenceClip(images, fps=fps)
   clip.write_videofile(f"{filename}.mp4")
```
Date
Source Own work
Author Cosmia Nebula

Licensing[edit]

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.

File history

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

Date/TimeThumbnailDimensionsUserComment
current06:47, 21 April 20239.7 s, 1,600 × 1,600 (14.61 MB)Cosmia Nebula (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

Transcode status

Update transcode status
Format Bitrate Download Status Encode time
VP9 1440P 10.28 Mbps Completed 06:48, 21 April 2023 41 s
Streaming 1440p (VP9) 10.28 Mbps Completed 00:06, 24 January 2024 7.0 s
VP9 1080P 5.1 Mbps Completed 06:48, 21 April 2023 25 s
Streaming 1080p (VP9) Not ready Unknown status
VP9 720P 2.47 Mbps Completed 06:47, 21 April 2023 15 s
Streaming 720p (VP9) Not ready Unknown status
VP9 480P 1.21 Mbps Completed 06:47, 21 April 2023 9.0 s
Streaming 480p (VP9) Not ready Unknown status
VP9 360P Not ready Error on 06:47, 21 April 2023
Streaming 360p (VP9) Not ready Unknown status
VP9 240P 188 kbps Completed 06:47, 21 April 2023 5.0 s
Streaming 240p (VP9) 188 kbps Completed 15:06, 21 December 2023 1.0 s
WebM 360P 515 kbps Completed 06:47, 21 April 2023 3.0 s
Streaming 144p (MJPEG) 613 kbps Completed 13:17, 12 November 2023 1.0 s

File usage on other wikis

The following other wikis use this file:

Metadata