True
Scientific Computing
@article{10.7717/peerj-cs.103,
title = {SymPy: symbolic computing in Python},
author = {Meurer, Aaron and Smith, Christopher P. and Paprocki, Mateusz and \v{C}ert\'{i}k, Ond\v{r}ej and Kirpichev, Sergey B. and Rocklin, Matthew and Kumar, AMiT and Ivanov, Sergiu and Moore, Jason K. and Singh, Sartaj and Rathnayake, Thilina and Vig, Sean and Granger, Brian E. and Muller, Richard P. and Bonazzi, Francesco and Gupta, Harsh and Vats, Shivam and Johansson, Fredrik and Pedregosa, Fabian and Curry, Matthew J. and Terrel, Andy R. and Rou\v{c}ka, \v{S}t\v{e}p\'{a}n and Saboo, Ashutosh and Fernando, Isuru and Kulal, Sumith and Cimrman, Robert and Scopatz, Anthony},
year = 2017,
month = jan,
keywords = {Python, Computer algebra system, Symbolics},
abstract = {
SymPy is an open source computer algebra system written in pure Python. It is built with a focus on extensibility and ease of use, through both interactive and programmatic applications. These characteristics have led SymPy to become a popular symbolic library for the scientific Python ecosystem. This paper presents the architecture of SymPy, a description of its features, and a discussion of select submodules. The supplementary material provide additional examples and further outline details of the architecture and features of SymPy.
},
volume = 3,
pages = {e103},
journal = {PeerJ Computer Science},
issn = {2376-5992},
url = {https://doi.org/10.7717/peerj-cs.103},
doi = {10.7717/peerj-cs.103}
}
pip
lil = np.finfo(np.float64).resolution # smallest recognizable value
big = np.finfo(np.float64).max # biggest recognizable value
big / lil
C:\Users\cd-desk\AppData\Local\Temp\ipykernel_21564\563832135.py:3: RuntimeWarning:
overflow encountered in scalar divide
\(\displaystyle \infty\)
==
) between floating-point numbers are often unreliable.Symbolic computation deals with the computation of mathematical objects symbolically. This means that the mathematical objects are represented exactly, not approximately, and mathematical expressions with unevaluated variables are left in symbolic form.
3
units, and vertical displacement of 4
units, and we wish to determine the minimum distance.subs()
to get solutions given values.3
for x
y
is, itself, a distance expressed over a right triangle with sides a
and b
\(\displaystyle x^{2} + 3 x - \frac{1}{2}\)
.subs()
vectorize
lambdify
specified with "scipy"
(or "numpy"
) if you have SciPy or even just NumPy installedfactor()
sympy.factor()
2
.doit
Derivative
and Integral
sympy.solve()
==
and Eq()
==
in equations, so use Eq()
Rational()
srepr
is string representation and is more exact and verbose.pprint
.
use_unicode
to False
texlive
tex
commandintegral.py
;
to separate linesnvim
editsnvim
and add lines specifying I want a document and that I want “math mode”.pdf
via\[ {}^3\text{H} \xrightarrow{\lambda} {}^3\text{He} + \text{e}^- + \bar{\nu}_\text{e} \]
Tritium is a radioactive isotope of hydrogen. It has the same number of protons and electrons as hydrogen but has 2 neutrons, whereas regular hydrogen does not have any. This makes tritium unstable and radioactive. Tritium is produced naturally from interactions of cosmic rays with gases in the upper atmosphere, and is also a by-product of nuclear reactors.
Like all radioactive isotopes, tritium decays. As it decays, it emits beta radiation.
The physical half-life of tritium is 12.33 years, meaning that it takes just over 12 years for tritium to decay to half of its original amount. As tritium decays, it changes to helium.
\[ \frac{d}{d t} y{\left(t \right)} = - \lambda y{\left(t \right)} \]
sympy.dsolve()
\(\displaystyle \frac{d}{d t} y{\left(t \right)} = - \lambda y{\left(t \right)}\)