Skip to main content

The sinupy package make it convenient to analyze the characteristic sinusoidal waves propagating in various kinds of medium. Typical waves in plasma have been given in the code to demonstrate how the package works and other users are free to follow the steps to research on their medium or charcteristic waves of interest.

Project description

The sinupy Package

The sinupy package makes it convenient to analyze the characteristic sinusoidal waves propagating in various kinds of medium. Typical waves in plasma have been given in the code to demonstrate how the package works and other users are free to follow the steps to research on their medium or charcteristic waves of interest.

Wave Equation

The electromagnetic wave equation is the theoretical basics of our formula derivation. The following formulas reveal what we call as the tensor coefficient matrix $T$

wave_equation

You can acquire the sympy.Array representation of the above (tensor) matrix coefficients by the WaveEq class' coeff_matrix() method. For the relevant variable, you can get them by attribute e.g., wave_eq.wave.k[1] means the wave's $k_y$ component of $\vec{k}$ vector.

Example Snapshots

How the refraction index $N$ changes with $\omega$ and $\theta$

N2(omega_theta)

$\omega-\vec{k}$ Diagram

w_k

Refer to the sinupy/nb/dispersion_relation.ipynb for more info.

The Famous CMA Diagram in Plasma Physics

CMA

Refer to the sinupy/nb/CMA.ipynb for more info.

Usage Tips

  • Unstable APIs

    The APIs are not stable now, please contact Wenyin Wei (wenyin.wei.ww@gmail.com) for face-to-face communication to save your time. Though unstable, they are easy to understand, if the user is familiar with Python enough, he or she can easily recognize the techniques and tricks the package uses.

    The jupyter notebooks in the sinupy/nb folder are complete and self-contained to allow the newcoming users to understand how the code works.

  • Consider the users of this package are scientists who spend a lot of time on the decution of physical formulas, the attributes in any classes in sinupy are intentionally set public without leading underscores _.

  • Sympy Variable Name Crash

    The variable name crash is very dangerous in sinupy so we carefully choose our sympy name to avoid they happen to be the same. For example, we do not expect the computer get confused between the static magnetic field attribute B in MagnetizedPlasma and the dynamic field B in ElectroMagneticWave, of which the definitions are as:

    # ElectroMagneticWave
    B_x, B_y, B_z = _symbols('B_x_{varidx}, B_y_{varidx}, B_z_{varidx}'.format(varidx=self.varidx), complex=True)
    self.B = _Array([B_x, B_y, B_z])
    # MagnetizedPlasma
    B_x, B_y, B_z = _symbols('B_x, B_y, B_z')
    self.B = _Array([B_x, B_y, B_z])
    

    For sinupy, varidx is a class attribute to help distinguish various physical quantities, which defaults to be a string with nothing ''. Therefore, users do not need to worry, when varidx defaults to be '', about that B_x_ crashes with B_x, because sympy recognize them as different symbols due to the trailing underscore _.

    For other variables that may coincide, users should be careful when they define their own variables. The probability to name crashes is not that big if the user defines long enough names.

  • What if I really want to replace a pre-existing variable name in sinupy?

    In most of cases, the pre-existing variable names would not cause big troubles, because the symbols would not interwine in one formula. However, when the user wants to cancel some pre-existing variables because they occupy some names that are very concise and meaningful, they can choose to inherit the class where the variable attribute is defined and override the constructor. We try to make sinupy as open as posisble to extension and the python inheritance hierarchy helps a lot. Using a custom class generally works well in sinupy.

Goal

  • Be a standard formula deduction in sinusoidal analysis.
  • Extend to general curvilinear coordinate system with the help of einsteinpy.
  • Multi-wave coupling relation and their respective growth rate.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sinupy-0.1.1.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sinupy-0.1.1-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file sinupy-0.1.1.tar.gz.

File metadata

  • Download URL: sinupy-0.1.1.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.9

File hashes

Hashes for sinupy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f8ce593846acea604ef360808788f8d429e36a4f28271a316b71509852ded0ef
MD5 84f45c544f7e34b6dc6a96470a03324b
BLAKE2b-256 2801b6d34ae3f686335820a398d96f3843dd5d1a95bcd212efcd951ffbf282dd

See more details on using hashes here.

File details

Details for the file sinupy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sinupy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.9

File hashes

Hashes for sinupy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a06ef1dea049003df78570261431b8593f5a0c9f1be2af9f7d06bc884acb5802
MD5 f6dd4798e375eb2e7f05c38adccc19a9
BLAKE2b-256 1ee7d8079ba519748632422e960d871e26fc01ad2f3d1ec6453f5b5e14c69314

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page