Skip to main content

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.

Metadata

Release files for sinupy 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sinupy 0.1.1
File Size Uploaded
sinupy-0.1.1.tar.gz 11.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sinupy 0.1.1
File Interpreter ABI Platform
sinupy-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 28.7 kB

Release files / sinupy-0.1.1.tar.gz

Download URL sinupy-0.1.1.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f8ce593846acea604ef360808788f8d429e36a4f28271a316b71509852ded0ef
BLAKE2b-256 checksum
How to use checksums
2801b6d34ae3f686335820a398d96f3843dd5d1a95bcd212efcd951ffbf282dd
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / sinupy-0.1.1-py3-none-any.whl

Download URL sinupy-0.1.1-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a06ef1dea049003df78570261431b8593f5a0c9f1be2af9f7d06bc884acb5802
BLAKE2b-256 checksum
How to use checksums
1ee7d8079ba519748632422e960d871e26fc01ad2f3d1ec6453f5b5e14c69314
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page