frances-dean commited on
Commit
229621d
·
verified ·
1 Parent(s): 073aa1e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -431,7 +431,7 @@ def solve_ODE_for_volume(Rm, Ra, Emax, Emin, Vd, Tc, start_v, t):
431
 
432
  return volumes
433
 
434
- def pvloop_simulator(Rm, Ra, Emax, Emin, Vd, Tc, start_v, animate=True):
435
 
436
 
437
  # Define initial parameters
@@ -491,13 +491,18 @@ def pvloop_simulator(Rm, Ra, Emax, Emin, Vd, Tc, start_v, animate=True):
491
  if animate:
492
  anim = animation.FuncAnimation(fig, partial(update), frames=100, interval=30)
493
  anim.save("prediction.mp4")
 
 
 
 
 
494
 
495
  return plt, Rm, Ra, Emax, Emin, Vd, Tc, start_v
496
 
497
  def pvloop_simulator_plot_only(Rm, Ra, Emax, Emin, Vd, Tc, start_v):
498
- plot,_,_,_,_,_,_,_ =pvloop_simulator(Rm, Ra, Emax, Emin, Vd, Tc, start_v, animate=True)
499
- plt.title('Simulated LV Pressure Volume Loop', fontsize=16)
500
- return plot
501
 
502
  #########################################
503
  # LVAD functions
 
431
 
432
  return volumes
433
 
434
+ def pvloop_simulator(Rm, Ra, Emax, Emin, Vd, Tc, start_v, animate=True, loop_simulated=False):
435
 
436
 
437
  # Define initial parameters
 
491
  if animate:
492
  anim = animation.FuncAnimation(fig, partial(update), frames=100, interval=30)
493
  anim.save("prediction.mp4")
494
+
495
+ if loop_simulated:
496
+ plt.title('Simulated LV Pressure Volume Loop', fontsize=16)
497
+ anim = animation.FuncAnimation(fig, partial(update), frames=100, interval=30)
498
+ anim.save("simulated.mp4")
499
 
500
  return plt, Rm, Ra, Emax, Emin, Vd, Tc, start_v
501
 
502
  def pvloop_simulator_plot_only(Rm, Ra, Emax, Emin, Vd, Tc, start_v):
503
+ plot,_,_,_,_,_,_,_ =pvloop_simulator(Rm, Ra, Emax, Emin, Vd, Tc, start_v, animate=False, loop_simulated=True)
504
+ animated_sim = "simulated.mp4"
505
+ return animated_sim
506
 
507
  #########################################
508
  # LVAD functions