Package: sinupy
The sinupy PackageThesinupypackage 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 EquationThe electromagnetic wave equation is the theoretical basics of our formula derivation. The following formulas reveal what we call as the tensor coefficient matrix $T$You can acquire thesympy.Arrayrepresentation of the above (tensor) matrix coefficients by theWaveEqclass'coeff_matrix()method. For the relevant variable, you can get them by attributee.g.,wave_eq.wave.k[1]means the wave's $k_y$ component of $\vec{k}$ vector.Example SnapshotsHow the refraction index $N$ changes with $\omega$ and $\theta$$\omega-\vec{k}$ DiagramRefer to thesinupy/nb/dispersion_relation.ipynbfor more info.The Famous CMA Diagram in Plasma PhysicsRefer to thesinupy/nb/CMA.ipynbfor more info.Usage TipsUnstable APIsThe 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 areeasy 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 thesinupy/nbfolder 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 CrashThe 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 attributeBinMagnetizedPlasmaand the dynamic fieldBinElectroMagneticWave, of which the definitions are as:# ElectroMagneticWaveB_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])# MagnetizedPlasmaB_x,B_y,B_z=_symbols('B_x, B_y, B_z')self.B=_Array([B_x,B_y,B_z])For sinupy,varidxis a class attribute to help distinguish various physical quantities, which defaults to be a string with nothing ''. Therefore, users do not need to worry, whenvaridxdefaults to be '',  about thatB_x_crashes withB_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.GoalBe 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.