Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -831,14 +831,13 @@ def lvad_plots(Rm, Ra, Emax, Emin, Vd, Tc, start_v, beta, loop_simulated=True):
|
|
| 831 |
new_ef, pao_ed, pao_es, CO, MAP, Vlvs, Plvs = f_lvad(Rs, Rm, Ra, Rc, Ca, Cs, Cr, Ls, Emin, Vd, Tc, start_v, Emax, c, slope0, w0, x60, y00, y01, y02, y03, y04)
|
| 832 |
|
| 833 |
# Create the figure and the loop that we will manipulate
|
| 834 |
-
N =
|
| 835 |
|
| 836 |
fig, ax = plt.subplots(figsize=(6, 4))
|
| 837 |
plt.ylim((0,220))
|
| 838 |
plt.xlim((0,250))
|
| 839 |
start = (N-2)*60000
|
| 840 |
end = (N)*60000
|
| 841 |
-
line1 = ax.plot(Vlv0[start:end], Plv0[start:end], lw=1, color='b',label='No LVAD')
|
| 842 |
#point1 = ax.scatter(Vlv0[start:(start+1)], Plv0[start:(start+1)], c="b", s=5)#, label='End Diastole')
|
| 843 |
|
| 844 |
if loop_simulated:
|
|
@@ -858,7 +857,7 @@ def lvad_plots(Rm, Ra, Emax, Emin, Vd, Tc, start_v, beta, loop_simulated=True):
|
|
| 858 |
# fig.subplots_adjust(left=0.25, bottom=0.25)
|
| 859 |
|
| 860 |
def update(frame):
|
| 861 |
-
|
| 862 |
# update to add more of the loop
|
| 863 |
end = (N-2)*60000+1000 * frame
|
| 864 |
#x = Vlv0[start:end]
|
|
@@ -866,6 +865,7 @@ def lvad_plots(Rm, Ra, Emax, Emin, Vd, Tc, start_v, beta, loop_simulated=True):
|
|
| 866 |
x2 = Vlvs[start:end]
|
| 867 |
y2 = Plvs[start:end]
|
| 868 |
#ax.plot(x2, y2, lw=1, color='b',label='No LVAD')
|
|
|
|
| 869 |
ax.plot(x2, y2, lw=1, color=(78/255, 192/255, 44/255), label=f"LVAD, ω(0)= {round(w0,2)}r/min")
|
| 870 |
|
| 871 |
|
|
|
|
| 831 |
new_ef, pao_ed, pao_es, CO, MAP, Vlvs, Plvs = f_lvad(Rs, Rm, Ra, Rc, Ca, Cs, Cr, Ls, Emin, Vd, Tc, start_v, Emax, c, slope0, w0, x60, y00, y01, y02, y03, y04)
|
| 832 |
|
| 833 |
# Create the figure and the loop that we will manipulate
|
| 834 |
+
N = 2
|
| 835 |
|
| 836 |
fig, ax = plt.subplots(figsize=(6, 4))
|
| 837 |
plt.ylim((0,220))
|
| 838 |
plt.xlim((0,250))
|
| 839 |
start = (N-2)*60000
|
| 840 |
end = (N)*60000
|
|
|
|
| 841 |
#point1 = ax.scatter(Vlv0[start:(start+1)], Plv0[start:(start+1)], c="b", s=5)#, label='End Diastole')
|
| 842 |
|
| 843 |
if loop_simulated:
|
|
|
|
| 857 |
# fig.subplots_adjust(left=0.25, bottom=0.25)
|
| 858 |
|
| 859 |
def update(frame):
|
| 860 |
+
|
| 861 |
# update to add more of the loop
|
| 862 |
end = (N-2)*60000+1000 * frame
|
| 863 |
#x = Vlv0[start:end]
|
|
|
|
| 865 |
x2 = Vlvs[start:end]
|
| 866 |
y2 = Plvs[start:end]
|
| 867 |
#ax.plot(x2, y2, lw=1, color='b',label='No LVAD')
|
| 868 |
+
ax.plot(Vlv0[start:end], Plv0[start:end], lw=1, color='b',label='No LVAD')
|
| 869 |
ax.plot(x2, y2, lw=1, color=(78/255, 192/255, 44/255), label=f"LVAD, ω(0)= {round(w0,2)}r/min")
|
| 870 |
|
| 871 |
|