File:Shooting method trajectories.svg

Original file(SVG file, nominally 495 × 350 pixels, file size: 45 KB)

Summary

Description
English: Graph showing trajectories of the shooting method for different values of the initial value of w'(0).
Español: Gráfico que muestra trayectorias del método de disparo para diferentes valores del valor inicial para w'(0).
Date
Source Own work
Author Nicoguaro
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with Matplotlib.
Source code
InfoField

Python code

# -*- coding: utf-8 -*-
"""
Illustrate the shooting method for the equation

    w'' = 3/2*w**2

The initial values picked for the first derivative are
w'(0) = s = [-40, -36, -10, -8, -7]
"""
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
import seaborn as sns

sns.set_style("white")


def func(y, t):
    return [y[1], 1.5*y[0]**2]


t = np.linspace(0, 1.1, 50)
diff_ini = [-40, -36, -10, -8, -7]
plt.figure(figsize=(6, 4))
for dy in diff_ini:
    y0 = [4, dy]    
    y = odeint(func, y0, t)
    plt.plot(t, y[:, 0], label=r"$s=%i$" % dy)

plt.plot(1, 1, "o", mfc="#3c3c3c")
plt.legend(loc="best")
plt.xlabel(r"$t$")
plt.ylabel(r"$w(t; s)$")
plt.savefig("Shooting_method_trajectories.svg", bbox_inches="tight")
plt.show()

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution
This file is licensed under the Creative Commons Attribution 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.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

9 November 2016

File history

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

Date/TimeThumbnailDimensionsUserComment
current00:07, 10 November 2016Thumbnail for version as of 00:07, 10 November 2016495 × 350 (45 KB)NicoguaroUser created page with UploadWizard
The following pages on the English Wikipedia use this file (pages on other projects are not listed):

Metadata