Spaces:
Running
Running
Franny Dean
commited on
Commit
•
f0f0a6f
1
Parent(s):
d2e9c9a
gamma to beta for interpretability
Browse files- .ipynb_checkpoints/app-checkpoint.py +4 -4
- app.py +4 -4
.ipynb_checkpoints/app-checkpoint.py
CHANGED
@@ -775,7 +775,7 @@ def generate_example():
|
|
775 |
return video, animated, Rm, Ra, Emax, Emin, Vd, Tc, start_v
|
776 |
|
777 |
|
778 |
-
def lvad_plots(Rm, Ra, Emax, Emin, Vd, Tc, start_v,
|
779 |
|
780 |
ncycle = 10000
|
781 |
|
@@ -800,7 +800,7 @@ def lvad_plots(Rm, Ra, Emax, Emin, Vd, Tc, start_v, gamma):
|
|
800 |
#gamma = 1.8
|
801 |
c = 0.065 #(in simaan2008dynamical: 0.67, but too fast -> 0.061 gives better shape)
|
802 |
slope0 = 100.
|
803 |
-
w0 = suctionw
|
804 |
|
805 |
#compute new pv loops and ef with lvad added:
|
806 |
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)
|
@@ -887,7 +887,7 @@ with gr.Blocks() as demo:
|
|
887 |
LVAD_button = gr.Button("Add LVAD")
|
888 |
|
889 |
with gr.Row():
|
890 |
-
|
891 |
|
892 |
with gr.Row():
|
893 |
lvad = gr.Plot()
|
@@ -903,6 +903,6 @@ with gr.Blocks() as demo:
|
|
903 |
|
904 |
simulation_button.click(fn=pvloop_simulator_plot_only, inputs = [sl1,sl2,sl3,sl4,sl5,sl6,sl7], outputs = [simulation])
|
905 |
|
906 |
-
LVAD_button.click(fn=lvad_plots, inputs = [sl1,sl2,sl3,sl4,sl5,sl6,sl7,
|
907 |
|
908 |
demo.launch()
|
|
|
775 |
return video, animated, Rm, Ra, Emax, Emin, Vd, Tc, start_v
|
776 |
|
777 |
|
778 |
+
def lvad_plots(Rm, Ra, Emax, Emin, Vd, Tc, start_v, beta):
|
779 |
|
780 |
ncycle = 10000
|
781 |
|
|
|
800 |
#gamma = 1.8
|
801 |
c = 0.065 #(in simaan2008dynamical: 0.67, but too fast -> 0.061 gives better shape)
|
802 |
slope0 = 100.
|
803 |
+
w0 = suctionw * beta #if doesn't work (x6 negative), change gamma down to 1.4 or up to 2.1 # switch to beta = 1/gamma 3/12 for interpretability
|
804 |
|
805 |
#compute new pv loops and ef with lvad added:
|
806 |
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)
|
|
|
887 |
LVAD_button = gr.Button("Add LVAD")
|
888 |
|
889 |
with gr.Row():
|
890 |
+
beta = gr.Slider(.4, 1.0, value= 1.4, label="Pump speed parameter:")
|
891 |
|
892 |
with gr.Row():
|
893 |
lvad = gr.Plot()
|
|
|
903 |
|
904 |
simulation_button.click(fn=pvloop_simulator_plot_only, inputs = [sl1,sl2,sl3,sl4,sl5,sl6,sl7], outputs = [simulation])
|
905 |
|
906 |
+
LVAD_button.click(fn=lvad_plots, inputs = [sl1,sl2,sl3,sl4,sl5,sl6,sl7,beta], outputs = [lvad, EF_o, EF_n, CO_o, CO_n])
|
907 |
|
908 |
demo.launch()
|
app.py
CHANGED
@@ -775,7 +775,7 @@ def generate_example():
|
|
775 |
return video, animated, Rm, Ra, Emax, Emin, Vd, Tc, start_v
|
776 |
|
777 |
|
778 |
-
def lvad_plots(Rm, Ra, Emax, Emin, Vd, Tc, start_v,
|
779 |
|
780 |
ncycle = 10000
|
781 |
|
@@ -800,7 +800,7 @@ def lvad_plots(Rm, Ra, Emax, Emin, Vd, Tc, start_v, gamma):
|
|
800 |
#gamma = 1.8
|
801 |
c = 0.065 #(in simaan2008dynamical: 0.67, but too fast -> 0.061 gives better shape)
|
802 |
slope0 = 100.
|
803 |
-
w0 = suctionw
|
804 |
|
805 |
#compute new pv loops and ef with lvad added:
|
806 |
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)
|
@@ -887,7 +887,7 @@ with gr.Blocks() as demo:
|
|
887 |
LVAD_button = gr.Button("Add LVAD")
|
888 |
|
889 |
with gr.Row():
|
890 |
-
|
891 |
|
892 |
with gr.Row():
|
893 |
lvad = gr.Plot()
|
@@ -903,6 +903,6 @@ with gr.Blocks() as demo:
|
|
903 |
|
904 |
simulation_button.click(fn=pvloop_simulator_plot_only, inputs = [sl1,sl2,sl3,sl4,sl5,sl6,sl7], outputs = [simulation])
|
905 |
|
906 |
-
LVAD_button.click(fn=lvad_plots, inputs = [sl1,sl2,sl3,sl4,sl5,sl6,sl7,
|
907 |
|
908 |
demo.launch()
|
|
|
775 |
return video, animated, Rm, Ra, Emax, Emin, Vd, Tc, start_v
|
776 |
|
777 |
|
778 |
+
def lvad_plots(Rm, Ra, Emax, Emin, Vd, Tc, start_v, beta):
|
779 |
|
780 |
ncycle = 10000
|
781 |
|
|
|
800 |
#gamma = 1.8
|
801 |
c = 0.065 #(in simaan2008dynamical: 0.67, but too fast -> 0.061 gives better shape)
|
802 |
slope0 = 100.
|
803 |
+
w0 = suctionw * beta #if doesn't work (x6 negative), change gamma down to 1.4 or up to 2.1 # switch to beta = 1/gamma 3/12 for interpretability
|
804 |
|
805 |
#compute new pv loops and ef with lvad added:
|
806 |
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)
|
|
|
887 |
LVAD_button = gr.Button("Add LVAD")
|
888 |
|
889 |
with gr.Row():
|
890 |
+
beta = gr.Slider(.4, 1.0, value= 1.4, label="Pump speed parameter:")
|
891 |
|
892 |
with gr.Row():
|
893 |
lvad = gr.Plot()
|
|
|
903 |
|
904 |
simulation_button.click(fn=pvloop_simulator_plot_only, inputs = [sl1,sl2,sl3,sl4,sl5,sl6,sl7], outputs = [simulation])
|
905 |
|
906 |
+
LVAD_button.click(fn=lvad_plots, inputs = [sl1,sl2,sl3,sl4,sl5,sl6,sl7,beta], outputs = [lvad, EF_o, EF_n, CO_o, CO_n])
|
907 |
|
908 |
demo.launch()
|