<jupyter_start><jupyter_text>Physics Project written in Python Using Jupyter**This is a reproduction of a scientific paper calculations based on my master degree in Physics which resulted in the publication:** [*de Broglie-Proca and Bopp-Podolsky massive photon gases in cosmology*](http://iopscience.iop.org/article/10.1209/0295-5075/118/19001/meta).You can also download the paper for free at [arXiv](https://arxiv.org/abs/1611.00877).The original program was done in a Wolfram Mathematica notebook together with [E<NAME>](http://demorais.com.br/). The following content was done by <NAME> in Python using IPython (now Jupyter) notebook.The original work was written in Portuguese and can be found [here](http://naldoni.org/wp-content/uploads/2017/06/PPGF_Dissertacao_Clicia_Naldoni_de_Souza.pdf).author: *<NAME>*.  AbstractThe same procedure established by the classical field theory which leads usto Maxwell's equations also leads to Podolsky's electrodynamics providedthat the Lagrangian contains derivatives of the field strength. WithPodolsky's field equations in hand, which has a coupling constant $a$associated to the photon mass, it's possible to derive an equation of statefor Podolsky's radiation. The equation of state is of the type $P=w\left(a,T\right) \varepsilon $, where $P$ is the pressure of the photon gas; $%\varepsilon $ is its energy density and $w$ is the barotropic parameterdepending on the temperature $T$ and the photon mass. If we use the equationof state in the fluid equation and afterwards in Friedmann's equation, it'spossible to solve the cosmic dynamics for a universe filled with Podolskyradiation. We show that the cosmic dynamics is not affected in a significantway by the massive photons, once $0,282<w_{\text{Podolsky}}<w_{\text{Maxwell}%}=1/3$ for any value of $T$, or equivalently of the cosmic time $t$.Podolsky correction to the Stefan-Boltzmann law is obtained for every $T$;it potentially describes the whole cosmic history. This correction issignificant in the interval $0\lesssim \xi \lesssim 8$ for the dimensionlessparameter $\xi =\beta m$. The maximum influence of the photon mass takesplace at $\xi _{\text{ref}}=2,899$. Out the above interval for $\xi $,Podolsky cosmic dynamics tends to the Maxwell's one: the scale factorbehaves as $\sqrt{t}$ in the limits corresponding to the primeval universe ($%\xi \ll 1$) and present-day universe $(\xi \gg 1)$, when $w_{\text{Podolsky}%}\rightarrow w_{\text{Maxwell}}$.$\textbf{Keywords}$: Podolsky. Maxwell. Electrodynamics. Cosmology.---  Energy Density of a Podolsky FluidThe logarithm of the partition function, $Z$, for a photon gas considering Podolsky Electrodynamics is:$\ln Z\left(  \beta,m,V\right)  =\frac{\pi^{2}V}{45\beta^{3}}+\frac{g_{N}V\betam^{4}}{2\pi^{2}}\sum_{k=1}^{\infty}\frac{K_{2}\left(  k\ \beta\ m\right)}{\left(  k\ \beta\ m\right)  ^{2}},$where $m$ is the photon gas mass (according to the electrodynamic modeladopted), $V$ is the volume, $K_{2}\left(  k\ \beta\ m\right)  $ and $K_{1}\left(  k\ \beta\ m\right)  $ are thespecial Bessel functions of second type. Notice that the first term is the Maxwell's term and what follows is the Podolsky's correction of Maxwell's electrodynamics.$\beta$ is defined as:$\beta\equiv\frac{1}{k_{B}T},$$T$ is the temperature of the gas, $k_{B}$ is the Boltzmann constant. The total number of states which allows a number of internal degrees of freedom, e.g. spin, is quantified by the degeneracy factor $g_{N}$.Based on the partition function is possible to derive the equation of energy density for a photon gas using the Podolsky's Electrodynamics:$\varepsilon(\beta,\xi)=\frac{\pi^{2}}{15\beta^{4}}\left[  1+\frac{15~g_{N}\ \xi^{4}}{2\pi^{4}}\left(  A+3B\right)  \right]$$A\left(  \xi\right)  =\sum_{k=1}^{\infty}\left(  \frac{K_{1}\left(k\ \xi\right)  }{\left(  k\ \xi\right)  }\right)$   ; $B\left(  \xi\right)  =\sum_{k=1}^{\infty}\left(  \frac{K_{2}\left(k\ \xi\right)  }{\left(  k\ \xi\right)  ^{2}}\right)$The program below plots the Maxwell's term together with the Podolsky's term.<jupyter_code>import numpy as np
from scipy.special import kn
import matplotlib.pyplot as plt
import math
gn=3 #degeneracy factor 
#defining the special Bessel functions of second type K_1
def k_one(epis,n): 
    s=0
    for i in range (1,n+1):
        s+=(kn(1,i*epis)/(i*epis))
    return s

#defining the special Bessel functions of second type K_2
def k_two(epis,n):
    s=0
    for i in range (1,n+1):
        s+=(kn(2,i*epis)/((i*epis)**2))
    return s

epis=np.linspace(0,10,1000)

podolsky_dens_epis=(1+(((15*gn)*(epis**4)/(2*(math.pi**4)))*(k_one(epis,50)+3*k_two(epis,50))))

plt.figure(dpi=90)#resolution
plt.plot(epis,podolsky_dens_epis,color='k',label="Podolsky")
plt.axhline(y=1.0, color='r', linestyle='--',label="Maxwell")


ax=plt.gca()#an axis object
ax.set_ylim([0.5,3.0])
ax.set_xlim([0,10])
plt.xlabel(r'$\beta m$')
plt.ylabel(r'$\epsilon/\epsilon_{M}$')

plt.legend(loc='best')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13896676011213457, 'fraction_numerical': 0.024229074889867842, 'mean_word_length': 4.93935790725327, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 8, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '437707', 'license': 'MIT', 'n_tokens_mistral': 1738, 'n_tokens_neox': 1597, 'n_words': 560, 'path': '1.00-Podolsky-Electrodynamics-Python-Physics_Energy-Density.ipynb', 'repo_name': 'clicianaldoni/python-physics', 'size': '5035'}