euler314 commited on
Commit
6333e73
·
verified ·
1 Parent(s): a860d9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -11
app.py CHANGED
@@ -115,17 +115,18 @@ def compute_low_y_curve(betas, z_a, y):
115
 
116
  @st.cache_data
117
  def compute_high_y_curve(betas, z_a, y):
118
- """
119
- Compute the expression: ((4y + 12)(4 - a) + 16y*β*(a - 1))/(3(4 - a))
120
- """
121
- betas = np.array(betas)
122
- denominator = 3*(4 - z_a)
123
-
124
- if denominator == 0:
125
- return np.full_like(betas, np.nan)
126
-
127
- numerator = (4*y + 12)*(4 - z_a) + 16*y*betas*(z_a - 1)
128
- return numerator/denominator
 
129
 
130
  def generate_z_vs_beta_plot(z_a, y, z_min, z_max, beta_steps, z_steps):
131
  if z_a <= 0 or y <= 0 or z_min >= z_max:
 
115
 
116
  @st.cache_data
117
  def compute_high_y_curve(betas, z_a, y):
118
+ """
119
+ Compute the expression: (-4a(a-1) - 2ay + 2a(2a-1))/(1-2a)
120
+ """
121
+ a = z_a # for clarity in the formula
122
+ betas = np.array(betas)
123
+ denominator = 1 - 2*a
124
+
125
+ if denominator == 0:
126
+ return np.full_like(betas, np.nan)
127
+
128
+ numerator = -4*a*(a-1)*y*betas - 2*a*y + 2*a*(2*a-1)
129
+ return numerator/denominator
130
 
131
  def generate_z_vs_beta_plot(z_a, y, z_min, z_max, beta_steps, z_steps):
132
  if z_a <= 0 or y <= 0 or z_min >= z_max: