Skip to content
Snippets Groups Projects
Commit 53cfab8b authored by Nicolas Mantilla Molina's avatar Nicolas Mantilla Molina
Browse files

Notebook para calcular el trabajo de un sistema para los CPSs

parent 61fb9f0f
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id: tags:
``` python
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
```
%% Cell type:code id: tags:
``` python
# Link de datos
sistema5 = "https://raw.githubusercontent.com/davidalejandromiranda/StatisticalPhysics/main/data/S5_Sistema_5.csv"
# Descargar datos V en cm^3 y P en Pa
data = pd.read_csv(sistema5, names=("V","P"), skiprows=1)
# Aproximar la integral
integral = round(np.trapz(data.P, data.V))
integral
```
%% Output
-426
%% Cell type:code id: tags:
``` python
# Graficar
plt.plot(data.V, data.P, label="P(V)")
plt.fill_between(data.V, data.P, alpha=0.2)
plt.xlabel("Volumen ($cm^3$)")
plt.ylabel("Presión ($Pa$)")
plt.title("Integral de $P(V)$ = " + str(integral)+ " $\mu J$")
plt.legend()
plt.show()
```
%% Output
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment