File:VoigtCDF.svg

From LaTeX CAS translator demo
Jump to navigation Jump to search

Original file(SVG file, nominally 720 × 540 pixels, file size: 2.8 MB)

This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.

Summary

Description
English: SVG version of .
Date
Source Own work
Author Shiyu Ji

Python Source Code

# CDF of Voigt Distribution

import matplotlib.pyplot as pl
import numpy as np
from scipy.special import wofz
import scipy.integrate as integral
import matplotlib.patches as mpatches
from math import pi

t0 = -10.0
dt = 0.01
t_final = 10.0
T = np.arange(t0, t_final, dt)
ax = pl.figure().add_subplot(111)

def V(sigma, gamma, x):
    z = (x + 1j * gamma) / (sigma * (2**0.5))
    return wofz(z).real / (sigma * (2*pi)**0.5)

def cdf(ax, sigma, gamma, color):
    for t in T:
        old_value = integral.quad(lambda x: V(sigma, gamma, x), -100, t)
        new_value = integral.quad(lambda x: V(sigma, gamma, x), -100, t+dt)
        ax.plot([t, t+dt], [old_value, new_value], color, linewidth=1.0)

cdf(ax, 1.53, 0.00, 'k-')
cdf(ax, 1.30, 0.50, 'b-')
cdf(ax, 1.00, 1.00, 'g-')
cdf(ax, 0.01, 1.80, 'r-')

blackPatch = mpatches.Patch(color='black', label='$\sigma=1.53, \gamma=0.00$')
bluePatch = mpatches.Patch(color='blue', label='$\sigma=1.30, \gamma=0.50$')
greenPatch = mpatches.Patch(color='green', label='$\sigma=1.00, \gamma=1.00$')
redPatch = mpatches.Patch(color='red', label='$\sigma=0.01, \gamma=1.80$')
pl.legend(handles = [blackPatch, bluePatch, redPatch, greenPatch], loc=2)

pl.show()

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

26 May 2017

File history

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

Date/TimeThumbnailDimensionsUserComment
current10:22, 26 May 2017Thumbnail for version as of 10:22, 26 May 2017720 × 540 (2.8 MB)wikimediacommons>Shiyu JiUser created page with UploadWizard

There are no pages that use this file.