Skip to content
Snippets Groups Projects
Commit b8ff6e4e authored by Mijael Yerson Sanchez Huamanyauri's avatar Mijael Yerson Sanchez Huamanyauri
Browse files

Final homework

parent d582a4d3
No related branches found
No related tags found
No related merge requests found
source diff could not be displayed: it is too large. Options to address this: view the blob.
%% Cell type:code id: tags:
``` python
import numpy as np
from matplotlib import pyplot as plt
```
%% Cell type:code id: tags:
``` python
data_vm = np.loadtxt("../data-used/vc_cmv_vm_test2.txt",skiprows=4)
ni_vm = 54
nf_vm = 500
time_vm = data_vm[ni_vm:nf_vm,0]/1000
time_vm = time_vm - time_vm[0]
press_vm = data_vm[ni_vm:nf_vm,1]
flow_vm = data_vm[ni_vm:nf_vm,2]
vol_vm = data_vm[ni_vm:nf_vm,3]
```
%% Cell type:code id: tags:
``` python
fig, axs = plt.subplots(3,1,constrained_layout=True)
# PRESSURE
axs[0].plot(time_vm,press_vm)
axs[0].set_title("Pressure")
axs[0].set_xlabel("t (s)")
axs[0].set_ylabel("P ($cmH_2O$)")
axs[0].grid()
plt.sca(axs[0])
plt.yticks([0,10,20,30,40,50,60])
t_scale_vm = np.array(range(23))*0.4
plt.xticks(t_scale_vm.tolist())
# FLOW
axs[1].plot(time_vm,flow_vm)
# VOLUMEN
axs[2].plot(time_vm,vol_vm)
#plt.grid(b=True,which='both')
fig.set_figheight(10)
fig.set_figwidth(10)
plt.show()
```
%% Output
%% Cell type:code id: tags:
``` python
data_aux = np.loadtxt("../data-used/vc_cmv_calibrator_test2.txt",skiprows=1)
n = len(data_aux)
data_cal = np.zeros((n,4))
data_cal[:,0] = np.arange(n)
data_cal[:,1:4] = data_aux
ni_cal = 0
nf_cal = 500
time_cal = data_cal[ni_cal:nf_cal,0]/1000
time_cal = time_cal - time_cal[0]
vol_cal = data_cal[ni_cal:nf_cal,1]
press_cal = data_cal[ni_cal:nf_cal,2]
flow_cal = data_cal[ni_cal:nf_cal,3]
```
%% Cell type:code id: tags:
``` python
fig, axs = plt.subplots(3,1,constrained_layout=True)
# PRESSURE
axs[0].plot(time_cal,press_cal)
axs[0].set_title("Pressure")
axs[0].set_xlabel("t (s)")
axs[0].set_ylabel("P ($cmH_2O$)")
axs[0].grid()
plt.sca(axs[0])
plt.yticks([0,10,20,30,40,50,60])
t_scale_cal = np.array(range(5))*0.1
plt.xticks(t_scale_cal.tolist())
# FLOW
axs[1].plot(time_cal,flow_cal)
# VOLUMEN
axs[2].plot(time_cal,vol_cal)
#plt.grid(b=True,which='both')
fig.set_figheight(10)
fig.set_figwidth(10)
plt.show()
```
%% Output
%% Cell type:code id: tags:
``` python
```
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