Spaces:
Sleeping
Sleeping
Lennard Schober
commited on
Commit
·
7a286ff
1
Parent(s):
0bb1ad3
Fix formatting
Browse files
app.py
CHANGED
@@ -30,7 +30,7 @@ def complex_heat_eq_solution(x, t, k=glob_k, a=glob_a, b=glob_b, c=glob_c):
|
|
30 |
global glob_k, glob_a, glob_b, glob_c
|
31 |
glob_k, glob_a, glob_b, glob_c = k, a, b, c
|
32 |
return (
|
33 |
-
np.exp(-glob_k * (
|
34 |
+ np.exp(-glob_k * (glob_b * np.pi) ** 2 * t) * np.sin(glob_b * np.pi * x)
|
35 |
+ np.exp(-glob_k * (glob_c * np.pi) ** 2 * t) * np.sin(glob_c * np.pi * x)
|
36 |
)
|
@@ -434,7 +434,6 @@ def plot_all(m, kernel):
|
|
434 |
gr.update(visible=True, value=error_fig),
|
435 |
)
|
436 |
|
437 |
-
|
438 |
# Gradio interface
|
439 |
def create_gradio_ui():
|
440 |
global glob_k, glob_a, glob_b, glob_c
|
@@ -446,9 +445,9 @@ def create_gradio_ui():
|
|
446 |
# Function parameter inputs
|
447 |
gr.Markdown(
|
448 |
"""
|
449 |
-
## Function: $$
|
450 |
|
451 |
-
Adjust the values for <span style='color:
|
452 |
"""
|
453 |
)
|
454 |
|
|
|
30 |
global glob_k, glob_a, glob_b, glob_c
|
31 |
glob_k, glob_a, glob_b, glob_c = k, a, b, c
|
32 |
return (
|
33 |
+
np.exp(-glob_k * (glob_a * np.pi) ** 2 * t) * np.cos(glob_a * np.pi * x)
|
34 |
+ np.exp(-glob_k * (glob_b * np.pi) ** 2 * t) * np.sin(glob_b * np.pi * x)
|
35 |
+ np.exp(-glob_k * (glob_c * np.pi) ** 2 * t) * np.sin(glob_c * np.pi * x)
|
36 |
)
|
|
|
434 |
gr.update(visible=True, value=error_fig),
|
435 |
)
|
436 |
|
|
|
437 |
# Gradio interface
|
438 |
def create_gradio_ui():
|
439 |
global glob_k, glob_a, glob_b, glob_c
|
|
|
445 |
# Function parameter inputs
|
446 |
gr.Markdown(
|
447 |
"""
|
448 |
+
## Function: $$u(x, t)\\coloneqq\\exp(-\\textcolor{magenta}{k}(\\textcolor{cyan}{a}\\pi)^2t)\\sin(\\textcolor{cyan}{a}\\pi x)+0.5\\exp(-\\textcolor{magenta}{k}(\\textcolor{lime}{b}\\pi)^2t)\\sin(\\textcolor{lime}{b}\\pi x)+0.25\\exp(-\\textcolor{magenta}{k}(\\textcolor{orange}{c}\\pi)^2t)\\sin(\\textcolor{orange}{c}\\pi x)$$
|
449 |
|
450 |
+
Adjust the values for <span style='color: magenta;'>k</span>, <span style='color: cyan;'>a</span>, <span style='color: lime;'>b</span> and <span style='color: orange;'>c</span> with the sliders below.
|
451 |
"""
|
452 |
)
|
453 |
|